Bug 802 - Dos attr mapping code incorrectly modifies owning group bits when compiled with ACL support
Dos attr mapping code incorrectly modifies owning group bits when compiled wi...
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.0
All Linux
: P3 normal
: none
Assigned To: Jim McDonough
:
Depends on:
Blocks: 807
  Show dependency treegraph
 
Reported: 2003-11-21 13:10 UTC by John Janosik
Modified: 2005-08-24 10:19 UTC (History)
2 users (show)

See Also:


Attachments
fixes group perm bits to match acl following stat in file_chmod (2.07 KB, patch)
2003-11-25 12:57 UTC, Jim McDonough
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Janosik 2003-11-21 13:10:14 UTC
Here is an example of the incorrect behaviour:

[root@cslinux07 test2]# getfacl  /data/test2/tt.tt 
getfacl: Removing leading '/' from absolute path names 
# file: data/test2/tt.tt 
# owner: root 
# group: root 
user::rwx 
group::--- 
mask::rwx 
other::--- 

and after the attrib set: 

[root@cslinux07 test2]# getfacl  /data/test2/tt.tt 
getfacl: Removing leading '/' from absolute path names 
# file: data/test2/tt.tt 
# owner: root 
# group: root 
user::rwx 
group::rwx 
mask::rwx 
other::--- 

You can see the problem in smbd/dosmode.c:file_chmod.  file_chmod uses
SMB_VFS_STAT to get the current mode bits, calculates the new mode bits, then
uses SMB_VFS_CHMOD to set the new bits.  The problem is that SMB_VFS_STAT
returns user, mask, and other bits, but SMB_VFS_CHMOD knows that ACLS are in use
and sets user, group, and other.
Comment 1 Jim McDonough 2003-11-25 12:57:32 UTC
Created attachment 270 [details]
fixes group perm bits to match acl following stat in file_chmod

This patch replaces the mask bits with group permission bits by looking them up
in the acl after doing a stat (which returns mask bits instead of group
permission bits) before we do a chmod.
Comment 2 Jeremy Allison 2003-11-25 15:43:04 UTC
Applied the patch.
Comment 3 Gerald (Jerry) Carter 2005-08-24 10:19:46 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.