Bug 2239 - dos filemode allows changing of ownership but no permission changes
Summary: dos filemode allows changing of ownership but no permission changes
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Config Files (show other bugs)
Version: 3.0.10
Hardware: x86 Linux
: P3 major
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
: 1159 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-12 23:56 UTC by Alex Karle
Modified: 2006-12-08 11:57 UTC (History)
2 users (show)

See Also:


Attachments
patch to fix problem that "dos filemode" doesn't function correctly (2.25 KB, patch)
2005-03-25 01:59 UTC, MORIYAMA Masayuki
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Karle 2005-01-12 23:56:58 UTC
I'm using samba 3.0.10 on FC3 with LDAP pwd-backend and acls.
The "dos filemode" parameter isn't working as it should.
Normally the user that has write access to a file, should
be able to change permissions of that file. But instead
of beeing able to change the permissions the user can  
become the owner of that file.

Alex
Comment 1 Alex Karle 2005-01-13 01:29:36 UTC
I searched the logs an found follwing entry:

[2005/01/13 09:25:20, 3] smbd/dosmode.c:unix_mode(111)
unix_mode(test2/testfile) returning 0744
[2005/01/13 09:20:55, 2] smbd/open.c:open_file(245)
testuser1 opened file test2/testfile read=Yes write=No (numopen=1)

As it seems dosmode.c is reading the wrong permissions of the file
as the user (testuser1) is is in the group assigned to the file
("Domain Users:x:513:testuser1" - /etc/groups) and 770 mode set on the
file ("-rwxrwx---  1 root Domain Users 0 13. Jan 07:02 testfile").

Hope that helps finding the bug.

Thanks in advance,

Alex.

(In reply to comment #0)
> I'm using samba 3.0.10 on FC3 with LDAP pwd-backend and acls.
> The "dos filemode" parameter isn't working as it should.
> Normally the user that has write access to a file, should
> be able to change permissions of that file. But instead
> of beeing able to change the permissions the user can  
> become the owner of that file.
> 
> Alex

Comment 2 Jeremy Allison 2005-01-13 15:24:43 UTC
Do you have EA support on that filesystem ? Can you go a getfattr call on the
file in question and see if it's storing the DOS mode in EA's, not unix mode bits ?

Thanks,

Jeremy.
Comment 3 Alex Karle 2005-01-14 02:04:21 UTC
(In reply to comment #2)
> Do you have EA support on that filesystem ? Can you go a getfattr call on the
> file in question and see if it's storing the DOS mode in EA's, not unix mode
bits ?
> 
> Thanks,
> 
> Jeremy.

I have EA support enabled (both smb.conf and fs) but with or without EA enabled
the behavior is the same. A getfattr on the file returns nothing. 

By the way, if I set the read only bit in the windows dialog then the
permissions are changed from 770 to 550 and it is not possible for the
windows-user to change it back. Another bug or the same ?   

Thanks,

Alex.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2005-02-22 16:34:56 UTC
*** Bug 1159 has been marked as a duplicate of this bug. ***
Comment 5 MORIYAMA Masayuki 2005-03-25 01:59:23 UTC
Created attachment 1120 [details]
patch to fix problem that "dos filemode" doesn't function correctly
Comment 6 Jeremy Allison 2005-04-13 16:31:36 UTC
Ok maybe I'm being really dumb here but I need you to explain what the proposed
patch is doing. It seems to be setting the file user owner to be the mapping of
the given owner SID in the DACL. If this uid isn't the owner won't that fail on
set ? I need to code up a test for this to make sure, but I'm guessing the
setfacl would fail in this case.

Can you explain it to me please ?

Jeremy.
Comment 7 Gerald (Jerry) Carter (dead mail address) 2006-04-14 14:55:16 UTC
This should be fixed now in 3.0.23 (didn't use the patch though).