summaryrefslogtreecommitdiff
path: root/source3/smbd/share_access.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-03-09 15:51:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:11:09 -0500
commit9f18298beee5c6abf2cffc9e1d36da2795f4e9d6 (patch)
tree62ed987a77f9e3c7d027daa3bde3c352e05139db /source3/smbd/share_access.c
parente11a85eebd660073f3f68b7d6d289476e5193d28 (diff)
downloadsamba-9f18298beee5c6abf2cffc9e1d36da2795f4e9d6.tar.gz
samba-9f18298beee5c6abf2cffc9e1d36da2795f4e9d6.tar.bz2
samba-9f18298beee5c6abf2cffc9e1d36da2795f4e9d6.zip
r14075: * add support for long variable names in smb.conf in the form of %(....)
* add support for %(DomainSID) * replace standard_sub_XXX() functions with wrappers around their alloc_sub_XXX() counterparts * add support for using SIDs in read list, et. al. (anything that is checked by nt_token_contains_name_in_list()) (This used to be commit 71d960250d2c6d01096a03e98884d3f9c395baa0)
Diffstat (limited to 'source3/smbd/share_access.c')
-rw-r--r--source3/smbd/share_access.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c
index a429937f8d..df5f445587 100644
--- a/source3/smbd/share_access.c
+++ b/source3/smbd/share_access.c
@@ -85,6 +85,13 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
* result that might be interpreted in a wrong way. */
smb_panic("substitutions failed\n");
}
+
+ /* check to see is we already have a SID */
+
+ if ( string_to_sid( &sid, name ) ) {
+ DEBUG(5,("token_contains_name: Checking for SID [%s] in token\n", name));
+ return nt_token_check_sid( &sid, token );
+ }
if (!do_group_checks(&name, &prefix)) {
if (!lookup_name(mem_ctx, name, LOOKUP_NAME_ALL,
@@ -153,14 +160,12 @@ BOOL token_contains_name_in_list(const char *username,
return False;
}
- mem_ctx = talloc_new(NULL);
- if (mem_ctx == NULL) {
+ if ( (mem_ctx = talloc_new(NULL)) == NULL ) {
smb_panic("talloc_new failed\n");
}
while (*list != NULL) {
- if (token_contains_name(mem_ctx, username, sharename,
- token, *list)) {
+ if (token_contains_name(mem_ctx, username, sharename,token, *list)) {
TALLOC_FREE(mem_ctx);
return True;
}