Contents of /trunk/samba/patches/samba-3.0.24-vista-backup-acl.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 2201 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 2201 byte(s)
-import
1 | Index: samba-3.0.24/source/smbd/posix_acls.c |
2 | =================================================================== |
3 | --- samba-3.0.24.orig/source/smbd/posix_acls.c 2007-02-08 08:11:29.000000000 -0600 |
4 | +++ samba-3.0.24/source/smbd/posix_acls.c 2007-02-08 08:12:02.000000000 -0600 |
5 | @@ -655,6 +655,7 @@ |
6 | } |
7 | return 0; |
8 | } |
9 | + |
10 | /**************************************************************************** |
11 | Function to create owner and group SIDs from a SMB_STRUCT_STAT. |
12 | ****************************************************************************/ |
13 | @@ -666,6 +667,27 @@ |
14 | } |
15 | |
16 | /**************************************************************************** |
17 | + Is the identity in two ACEs equal ? Check both SID and uid/gid. |
18 | +****************************************************************************/ |
19 | + |
20 | +static BOOL identity_in_ace_equal(canon_ace *ace1, canon_ace *ace2) |
21 | +{ |
22 | + if (sid_equal(&ace1->trustee, &ace2->trustee)) { |
23 | + return True; |
24 | + } |
25 | + if (ace1->owner_type == ace2->owner_type) { |
26 | + if (ace1->owner_type == UID_ACE && |
27 | + ace1->unix_ug.uid == ace2->unix_ug.uid) { |
28 | + return True; |
29 | + } else if (ace1->owner_type == GID_ACE && |
30 | + ace1->unix_ug.gid == ace2->unix_ug.gid) { |
31 | + return True; |
32 | + } |
33 | + } |
34 | + return False; |
35 | +} |
36 | + |
37 | +/**************************************************************************** |
38 | Merge aces with a common sid - if both are allow or deny, OR the permissions together and |
39 | delete the second one. If the first is deny, mask the permissions off and delete the allow |
40 | if the permissions become zero, delete the deny if the permissions are non zero. |
41 | @@ -692,7 +714,7 @@ |
42 | |
43 | curr_ace_next = curr_ace->next; /* Save the link in case of delete. */ |
44 | |
45 | - if (sid_equal(&curr_ace->trustee, &curr_ace_outer->trustee) && |
46 | + if (identity_in_ace_equal(curr_ace, curr_ace_outer) && |
47 | (curr_ace->attr == curr_ace_outer->attr)) { |
48 | |
49 | if( DEBUGLVL( 10 )) { |
50 | @@ -732,7 +754,7 @@ |
51 | * we've put on the ACL, we know the deny must be the first one. |
52 | */ |
53 | |
54 | - if (sid_equal(&curr_ace->trustee, &curr_ace_outer->trustee) && |
55 | + if (identity_in_ace_equal(curr_ace, curr_ace_outer) && |
56 | (curr_ace_outer->attr == DENY_ACE) && (curr_ace->attr == ALLOW_ACE)) { |
57 | |
58 | if( DEBUGLVL( 10 )) { |