diff options
author | Jeremy Allison <jra@samba.org> | 2001-04-11 00:05:23 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-04-11 00:05:23 +0000 |
commit | 9dd77c4fb1282d23cfbfd9d0ed790be62534e201 (patch) | |
tree | a75329b21c2d23b812e45dce4ade4498114d5dce /source/rpc_server | |
parent | 8ecf6c33673693ca64f99bd7fb26d3383658d86b (diff) | |
download | samba-9dd77c4fb1282d23cfbfd9d0ed790be62534e201.tar.gz samba-9dd77c4fb1282d23cfbfd9d0ed790be62534e201.tar.xz samba-9dd77c4fb1282d23cfbfd9d0ed790be62534e201.zip |
Restrict dfs add and dfs remote to root at Shirish's advice.
Jeremy.
Diffstat (limited to 'source/rpc_server')
-rw-r--r-- | source/rpc_server/srv_dfs_nt.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/rpc_server/srv_dfs_nt.c b/source/rpc_server/srv_dfs_nt.c index 22e7a24f58f..c01ab8f2d9d 100644 --- a/source/rpc_server/srv_dfs_nt.c +++ b/source/rpc_server/srv_dfs_nt.c @@ -44,6 +44,7 @@ uint32 _dfs_exist(pipes_struct *p, DFS_Q_DFS_EXIST *q_u, DFS_R_DFS_EXIST *r_u) uint32 _dfs_add(pipes_struct *p, DFS_Q_DFS_ADD* q_u, DFS_R_DFS_ADD *r_u) { + struct current_user user; struct junction_map jn; struct referral* old_referral_list = NULL; BOOL exists = False; @@ -51,6 +52,13 @@ uint32 _dfs_add(pipes_struct *p, DFS_Q_DFS_ADD* q_u, DFS_R_DFS_ADD *r_u) pstring dfspath, servername, sharename; pstring altpath; + get_current_user(&user,p); + + if (user.uid != 0) { + DEBUG(10,("_dfs_add: uid != 0. Access denied.\n")); + return ERROR_ACCESS_DENIED; + } + unistr2_to_ascii(dfspath, &q_u->DfsEntryPath, sizeof(dfspath)-1); unistr2_to_ascii(servername, &q_u->ServerName, sizeof(servername)-1); unistr2_to_ascii(sharename, &q_u->ShareName, sizeof(sharename)-1); @@ -103,12 +111,20 @@ uint32 _dfs_add(pipes_struct *p, DFS_Q_DFS_ADD* q_u, DFS_R_DFS_ADD *r_u) uint32 _dfs_remove(pipes_struct *p, DFS_Q_DFS_REMOVE *q_u, DFS_R_DFS_REMOVE *r_u) { + struct current_user user; struct junction_map jn; BOOL found = False; pstring dfspath, servername, sharename; pstring altpath; + get_current_user(&user,p); + + if (user.uid != 0) { + DEBUG(10,("_dfs_add: uid != 0. Access denied.\n")); + return ERROR_ACCESS_DENIED; + } + unistr2_to_ascii(dfspath, &q_u->DfsEntryPath, sizeof(dfspath)-1); if(q_u->ptr_ServerName) unistr2_to_ascii(servername, &q_u->ServerName, sizeof(servername)-1); |