[Samba] Re: Can not clear Read-only attribute

tom m. tomm at lime-technology.com
Thu Mar 12 00:30:55 GMT 2009


John H Terpstra - Samba Team <jht <at> samba.org> writes:

> 
> tom m. wrote:
> > Using 'security=share' or 'security=user', via Windows right-click any Samba
> > exported file and set the Read-only attribute.  This works, but now can not
> > clear the Read-only attribute, Windows reports simply "Access is denied".
> >  
> > This happens with 3.3.0 and 3.3.1, but NOT 3.2.3.
> > 
> > Setting 'force user = root' does not help.
> > 
> 
> I've not seen this problem at all.  I have samba-3.3.0, 3.3.1 and GIT
> updates in production use without this problem.  What is in your
> smb.conf and what are the permissions on the file system?
> 
> Also, what do your logs report at log level 3?
> 
> - John T.

If it were a permission problem, then it wouldn't be possible to set Read-only
attribute in the first place, correct?

Here's the result of creating an empty file called 'test.txt' via notepad, as
viewed from the linux-side.  The 'create mask' is 711 and 'map archive' is yes:

-rwx------ 1 root root         0 Mar 11  2009 test.txt*

Result after right-clicking test.txt and setting Read-only attribute:

-r-x------ 1 root root         0 Mar 11 18:02 test.txt*

Now if I right-click test.txt again and try to clear Read-only attribute,
windows reports "Access denied" and permissions stay the same:

-r-x------ 1 root root         0 Mar 11 18:02 test.txt*

Now if I 'chmod 502 test.txt' we get:

-r-x----w- 1 root root         0 Mar 11 18:02 test.txt*

Right-click 'test.txt' in explorer and file still shows as Read-only, but
clearing Read-only now works and we get this:

-rwx----w- 1 root root         0 Mar 11 18:02 test.txt*


Here is output of 'testparm':

[global]
        workgroup = MSHOME
        server string = Samba server
        null passwords = Yes
        log level = 3
        log file = /var/log/sambalog
        unix extensions = No
        load printers = No
        printcap name = /dev/null
        disable spoolss = Yes
        show add printer wizard = No
        local master = No
        ldap ssl = no
        force user = root
        create mask = 0711
        directory mask = 0711
        use sendfile = Yes
        map hidden = Yes
        map system = Yes
        msdfs root = Yes

[atest]
        path = /mnt/atest
        read only = No


The log is very large, here are a few lines before the operation fails:

[2009/03/11 15:26:38,  3] smbd/dosmode.c:unix_mode(124)
  unix_mode(test.txt) returning 0700
[2009/03/11 15:26:38,  3] smbd/error.c:error_packet_set(61)
  error packet at smbd/nttrans.c(498) cmd=162 (SMBntcreateX) NT_STATUS_ACCESS_DENIED




More information about the samba mailing list