1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-05 12:22:11 +03:00

r17032: I thought I had already merged this from trunk:

> r16959 | vlendec | 2006-07-11 23:10:44 +0200 (Di, 11 Jul 2006) | 1 line
>
> get_share_security does not need snum, activate RPC-SAMBA3-SRVSVC

Volker
(This used to be commit c89471e157)
This commit is contained in:
Volker Lendecke
2006-07-14 17:46:06 +00:00
committed by Gerald (Jerry) Carter
parent 2a2d67f5ad
commit 1f2419d9f8
4 changed files with 13 additions and 8 deletions

View File

@ -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);
}

View File

@ -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))

View File

@ -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"

View File

@ -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;
}