The Samba-Bugzilla – Attachment 270 Details for
Bug 802
Dos attr mapping code incorrectly modifies owning group bits when compiled with ACL support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fixes group perm bits to match acl following stat in file_chmod
dosmode.patch (text/plain), 2.07 KB, created by
Jim McDonough
on 2003-11-25 12:57:32 UTC
(
hide
)
Description:
fixes group perm bits to match acl following stat in file_chmod
Filename:
MIME Type:
Creator:
Jim McDonough
Created:
2003-11-25 12:57:32 UTC
Size:
2.07 KB
patch
obsolete
>Index: smbd/posix_acls.c >=================================================================== >RCS file: /home/cvs/samba/source/smbd/posix_acls.c,v >retrieving revision 1.61.2.29 >diff -u -r1.61.2.29 posix_acls.c >--- smbd/posix_acls.c 3 Nov 2003 14:34:24 -0000 1.61.2.29 >+++ smbd/posix_acls.c 25 Nov 2003 18:34:30 -0000 >@@ -3177,6 +3177,44 @@ > return True; > } > >+int fix_acl_group_bits( connection_struct *conn, char *fname, mode_t *mode ) >+{ >+ int entry_id = SMB_ACL_FIRST_ENTRY; >+ SMB_ACL_ENTRY_T entry; >+ SMB_ACL_T posix_acl; >+ >+ posix_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS); >+ while (SMB_VFS_SYS_ACL_GET_ENTRY(conn, posix_acl, >+ entry_id, &entry) == 1) { >+ SMB_ACL_TAG_T tagtype; >+ SMB_ACL_PERMSET_T permset; >+ >+ /* get_next... */ >+ if (entry_id == SMB_ACL_FIRST_ENTRY) >+ entry_id = SMB_ACL_NEXT_ENTRY; >+ >+ if (SMB_VFS_SYS_ACL_GET_TAG_TYPE(conn, entry, &tagtype) ==-1) >+ return -1; >+ >+ if (tagtype == SMB_ACL_GROUP_OBJ) { >+ if (SMB_VFS_SYS_ACL_GET_PERMSET(conn, entry, >+ &permset) == -1) >+ return -1; >+ else { >+ *mode &= ~(S_IRGRP|S_IWGRP|S_IXGRP); >+ *mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, >+ permset, SMB_ACL_READ) ? S_IRGRP : 0); >+ *mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, >+ permset, SMB_ACL_WRITE) ? S_IWGRP : 0); >+ *mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, >+ permset, SMB_ACL_EXECUTE) ? S_IXGRP : 0); >+ return 0;; >+ } >+ } >+ } >+ return -1; >+} >+ > /**************************************************************************** > Do a chmod by setting the ACL USER_OBJ, GROUP_OBJ and OTHER bits in an ACL > and set the mask to rwx. Needed to preserve complex ACLs set by NT. >Index: smbd/dosmode.c >=================================================================== >RCS file: /home/cvs/samba/source/smbd/dosmode.c,v >retrieving revision 1.27.2.5 >diff -u -r1.27.2.5 dosmode.c >--- smbd/dosmode.c 14 Oct 2003 03:56:42 -0000 1.27.2.5 >+++ smbd/dosmode.c 25 Nov 2003 18:34:30 -0000 >@@ -197,6 +197,8 @@ > return(-1); > } > >+ fix_acl_group_bits(conn, fname, &st->st_mode); >+ > if (S_ISDIR(st->st_mode)) > dosmode |= aDIR; > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 802
: 270