summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/sharesec.c8
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c9
-rwxr-xr-xsource3/script/tests/test_posix_s3.sh1
-rw-r--r--source3/utils/sharesec.c3
4 files changed, 13 insertions, 8 deletions
diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c
index 8105d5c37a..9c40eb0ac7 100644
--- a/source3/lib/sharesec.c
+++ b/source3/lib/sharesec.c
@@ -108,7 +108,8 @@ SEC_DESC *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def
Pull a security descriptor from the share tdb.
********************************************************************/
-SEC_DESC *get_share_security( TALLOC_CTX *ctx, int snum, size_t *psize)
+SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename,
+ size_t *psize)
{
prs_struct ps;
fstring key;
@@ -122,12 +123,13 @@ SEC_DESC *get_share_security( TALLOC_CTX *ctx, int snum, size_t *psize)
/* Fetch security descriptor from tdb */
- slprintf(key, sizeof(key)-1, "SECDESC/%s", lp_servicename(snum));
+ slprintf(key, sizeof(key)-1, "SECDESC/%s", servicename);
if (tdb_prs_fetch(share_tdb, key, &ps, ctx)!=0 ||
!sec_io_desc("get_share_security", &psd, &ps, 1)) {
- DEBUG(4,("get_share_security: using default secdesc for %s\n", lp_servicename(snum) ));
+ DEBUG(4, ("get_share_security: using default secdesc for %s\n",
+ servicename));
return get_share_security_default(ctx, psize, GENERIC_ALL_ACCESS);
}
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 12a86ce9f3..a313bbb881 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -338,7 +338,7 @@ BOOL share_access_check(connection_struct *conn, int snum, user_struct *vuser, u
if (mem_ctx == NULL)
return False;
- psd = get_share_security(mem_ctx, snum, &sd_size);
+ psd = get_share_security(mem_ctx, lp_servicename(snum), &sd_size);
if (!psd)
goto out;
@@ -415,7 +415,7 @@ static void init_srv_share_info_502(pipes_struct *p, SRV_SHARE_INFO_502 *sh502,
pstrcpy(passwd, "");
- sd = get_share_security(ctx, snum, &sd_size);
+ sd = get_share_security(ctx, lp_servicename(snum), &sd_size);
init_srv_share_info502(&sh502->info_502, net_name, get_share_type(snum), remark, 0, 0xffffffff, 1, path, passwd, sd, sd_size);
init_srv_share_info502_str(&sh502->info_502_str, net_name, remark, path, passwd, sd, sd_size);
@@ -493,7 +493,7 @@ static void init_srv_share_info_1501(pipes_struct *p, SRV_SHARE_INFO_1501 *sh150
ZERO_STRUCTP(sh1501);
- sd = get_share_security(ctx, snum, &sd_size);
+ sd = get_share_security(ctx, lp_servicename(snum), &sd_size);
sh1501->sdb = make_sec_desc_buf(p->mem_ctx, sd_size, sd);
}
@@ -1684,7 +1684,8 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
SEC_DESC *old_sd;
size_t sd_size;
- old_sd = get_share_security(p->mem_ctx, snum, &sd_size);
+ old_sd = get_share_security(p->mem_ctx, lp_servicename(snum),
+ &sd_size);
if (old_sd && !sec_desc_equal(old_sd, psd)) {
if (!set_share_security(p->mem_ctx, share_name, psd))
diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh
index d4a03f8581..1fce6455fe 100755
--- a/source3/script/tests/test_posix_s3.sh
+++ b/source3/script/tests/test_posix_s3.sh
@@ -34,6 +34,7 @@ raw="$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE"
raw="$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH"
rpc="RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY"
+rpc="$rpc RPC-SAMBA3-SRVSVC"
tests="$base $raw $rpc"
diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c
index aa4210b51d..3f66d4da6e 100644
--- a/source3/utils/sharesec.c
+++ b/source3/utils/sharesec.c
@@ -382,7 +382,8 @@ int main(int argc, const char *argv[])
switch ( mode ) {
case SMB_ACL_VIEW:
- if (!(secdesc = get_share_security( ctx, snum, &sd_size )) ) {
+ if (!(secdesc = get_share_security( ctx, sharename,
+ &sd_size )) ) {
fprintf(stderr, "Unable to retrieve permissions for share [%s]\n", sharename);
return -1;
}