summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_srvsvc_nt.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-11 21:19:25 +0000
committerJeremy Allison <jra@samba.org>2001-04-11 21:19:25 +0000
commit0ca9f5c023df2ee498dcd1bdb2f29abc632a5d60 (patch)
tree4a20b4111f497e2c0ddbe02fa2e39e7d66fdeaa7 /source3/rpc_server/srv_srvsvc_nt.c
parent362e4bb21a3c630eb0625a1b3ab9f70dafc85d7e (diff)
downloadsamba-0ca9f5c023df2ee498dcd1bdb2f29abc632a5d60.tar.gz
samba-0ca9f5c023df2ee498dcd1bdb2f29abc632a5d60.tar.bz2
samba-0ca9f5c023df2ee498dcd1bdb2f29abc632a5d60.zip
Fix for core dump in security = share code with new share security db.
Jeremy. (This used to be commit 20b13bafdff2fd7be9219ed164e7fe91b597298d)
Diffstat (limited to 'source3/rpc_server/srv_srvsvc_nt.c')
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index bce5c33225..0c165bf9fa 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -293,7 +293,7 @@ void map_generic_share_sd_bits(SEC_DESC *psd)
Can this user access with share with the required permissions ?
********************************************************************/
-BOOL share_access_check(int snum, uint16 vuid, uint32 desired_access)
+BOOL share_access_check(connection_struct *conn, int snum, uint16 vuid, uint32 desired_access)
{
uint32 granted, status;
TALLOC_CTX *mem_ctx = NULL;
@@ -313,17 +313,25 @@ BOOL share_access_check(int snum, uint16 vuid, uint32 desired_access)
if (!psd)
goto out;
+ ZERO_STRUCT(tmp_user);
if (vuser) {
- ZERO_STRUCT(tmp_user);
tmp_user.vuid = vuid;
tmp_user.uid = vuser->uid;
tmp_user.gid = vuser->gid;
tmp_user.ngroups = vuser->n_groups;
tmp_user.groups = vuser->groups;
tmp_user.nt_user_token = vuser->nt_user_token;
- puser = &tmp_user;
+ } else {
+ tmp_user.vuid = vuid;
+ tmp_user.uid = conn->uid;
+ tmp_user.gid = conn->gid;
+ tmp_user.ngroups = conn->ngroups;
+ tmp_user.groups = conn->groups;
+ tmp_user.nt_user_token = conn->nt_user_token;
}
+ puser = &tmp_user;
+
ret = se_access_check(psd, puser, desired_access, &granted, &status);
out: