Bug 3618 - vfs_recycle.c does not maintain group suid/owner on directories
vfs_recycle.c does not maintain group suid/owner on directories
Status: NEW
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.21c
Other Windows XP
: P3 enhancement
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-20 15:00 UTC by Oliver Schulze L.
Modified: 2006-04-05 01:59 UTC (History)
0 users

See Also:


Attachments
nmbd logfile (5.50 KB, text/plain)
2006-04-05 01:57 UTC, Sebastian Held
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Schulze L. 2006-03-20 15:00:22 UTC
Currently, vfs_recycle.c does not maintain the unix 's' mode on directories.
If you delete a directory with mode drwxrsx---, the directory is created
in the recyle with mode drwx------ instead of drwxrsx---

Example:
1. you have a share called docs1 in /opt/shares/docs1
2. inside docs1 you have 2 directories: dir1 and dir2
3. you setup the 's' mode in the directories with:
   chmod g+swr -R dir1 dir2
   chmod o-rwx -R dir1 dir2
4. you have 2 groups,
   group1: user1, user2
   group2: user3, user4
5. you setup the ownership of the group with:
   chgrp -R group1 dir1
   chgrp -R group2 dir2
6. users in group1 can create/edit/delete all files in dir1
   users in group2 can create/edit/delete all files in dir2
7. if user1 from group1 delete the file dir1/sdir/file.txt that file
   is moved to the recycle bin and this files does not have the same permitions
   the original:
The actual result is:
   recycle/dir1               -rwx------ user1.domain-users
   recycle/dir1/sdir          -rwx------ user1.domain-users
   recycle/dir1/sdir/file.txt -rw-rw---- user1.group1

The expected result is:
   recycle/dir1               -rwxrsx--- user1.group1
   recycle/dir1/sdir          -rwxrsx--- user1.group1
   recycle/dir1/sdir/file.txt -rw-rw---- user1.group1
8. the problem occurs when user2 delete file the dir1/sdir/file2.txt,
   the file file2.txt does not goes to the recycle because dir1 and dir1/sdir
   are owned by user. The error is permision denied.
9. this way, the recycle only works for the first user from the group that
   delete a file

This scenario is used commonly, asi suggested in the howto:
"MS Word with Samba Changes Owner of File"
http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/AccessControls.html#id2581807
Comment 1 Sebastian Held 2006-04-05 01:57:48 UTC
Created attachment 1843 [details]
nmbd logfile
Comment 2 Sebastian Held 2006-04-05 01:59:10 UTC
Comment on attachment 1843 [details]
nmbd logfile

sorry wrong bug...