summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-17 03:36:38 +0000
committerJeremy Allison <jra@samba.org>2001-03-17 03:36:38 +0000
commit0dfc30cf87ab3b5746701034150e3a6400857148 (patch)
treecd4243ccb69598cbfb80d27a6fa4e7274f5cdbaa /source3/smbd
parent70c812e6aee0fa9b10b660f4051cc5460c023917 (diff)
downloadsamba-0dfc30cf87ab3b5746701034150e3a6400857148.tar.gz
samba-0dfc30cf87ab3b5746701034150e3a6400857148.tar.bz2
samba-0dfc30cf87ab3b5746701034150e3a6400857148.zip
lib/system.c (Finally) fixed all insure errors in password caching code. We can't
stop libc routines from calling getpwXXX functions, so caching a pointer to them is impossible. This new code now makes two copies of the returned struct passwd struct - one used as a cache, one returned to allow the caller to modify. When doing a lookup we compare against the cached copy. Code is now easier to understand also. smbd/posix_acls.c: If we move the head of the linked list, remember to pass a reference to that pointer..... Jeremy. (This used to be commit af364b93d92f70aa52195c46d3cc516830752609)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/posix_acls.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index f73f122f43..e358e0238c 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -930,9 +930,10 @@ static void free_canon_ace_list( canon_ace *list_head )
entries, last entry = other.
********************************************************************************/
-static void arrange_posix_perms( char *filename, canon_ace *list_head)
+static void arrange_posix_perms( char *filename, canon_ace **pp_list_head)
{
extern DOM_SID global_sid_World;
+ canon_ace *list_head = *pp_list_head;
canon_ace *owner_ace = NULL;
canon_ace *other_ace = NULL;
canon_ace *ace = NULL;
@@ -1011,6 +1012,10 @@ static void arrange_posix_perms( char *filename, canon_ace *list_head)
owner_ace->attr = DENY_ACE;
owner_ace->perms = 0;
}
+
+ /* We have probably changed the head of the list. */
+
+ *pp_list_head = list_head;
}
/******************************************************************************
@@ -1080,7 +1085,7 @@ static canon_ace *unix_canonicalise_acl(files_struct *fsp, SMB_STRUCT_STAT *psbu
DLIST_ADD(list_head, group_ace);
DLIST_ADD(list_head, owner_ace);
- arrange_posix_perms(fsp->fsp_name,list_head );
+ arrange_posix_perms(fsp->fsp_name,&list_head );
return list_head;
@@ -1219,6 +1224,8 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
* acl_mask.
*/
+ DEBUG(10,("canonicalize_acl: ace entries before arrange :\n"));
+
for ( ace_count = 0, ace = list_head; ace; ace = next_ace, ace_count++) {
next_ace = ace->next;
@@ -1229,9 +1236,13 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
if (ace->perms == 0) {
DLIST_PROMOTE(list_head, ace);
}
+
+ if( DEBUGLVL( 10 ) ) {
+ print_canon_ace(ace, ace_count);
+ }
}
- arrange_posix_perms(fsp->fsp_name,list_head );
+ arrange_posix_perms(fsp->fsp_name,&list_head );
if( DEBUGLVL( 10 ) ) {
char *acl_text = sys_acl_to_text( posix_acl, NULL);
@@ -1239,6 +1250,12 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
dbgtext("canonicalize_acl: processed acl %s\n", acl_text == NULL ? "NULL" : acl_text );
if (acl_text)
sys_acl_free_text(acl_text);
+
+ dbgtext("canonicalize_acl: ace entries after arrange :\n");
+
+ for ( ace_count = 0, ace = list_head; ace; ace = next_ace, ace_count++) {
+ print_canon_ace(ace, ace_count);
+ }
}
return list_head;