[Samba] Read-Only file attributes not being preserved.

Mortos thehole at blueyonder.co.uk
Wed Feb 25 19:16:20 GMT 2004


Hey All,
I'm having problems with samba/windows file attributes.  I'm using
roaming profiles (Win2000) with Samba serving as the PDC. Samba also
stores the profiles. The 'Create Mask'  is 0744 and the 'force create'
is 00.
Now the problem is my read-only files are not kept at read-only when I
log in. Basically, I create a *read-only* file in my window profiles
directory (say 'My Documents') and logout.  When I log back into
Windows, the file is now *read-write*. The file is also read-write on
the linux machine so Samba has saved it as read-write.
However, turning samba logging to 5, I get the following (The test file
is 'ReadOnlyTest.txt'. My emphasis.):

[2004/02/24 10:55:38, 5] smbd/filename.c:unix_convert(193)
  unix_convert begin: name = clifford/profile/My
Documents/SMBTEST/ReadOnlyTest.txt, dirpath = clifford/profile/My
Documents/SMBTEST, start = ReadOnlyTest.txt

[2004/02/24 10:55:38, 5] smbd/filename.c:unix_convert(314)
  New file ReadOnlyTest.txt

[2004/02/24 10:55:38, 5] smbd/mangle_hash.c:is_8_3(368)
  Checking prf305.tmp for 8.3

[2004/02/24 10:55:38, 3] smbd/reply.c:rename_internals(3948)
  rename_internals: case_sensitive = 0, case_preserve = 1, short case
preserve = 1, directory = clifford/profile/My
Documents/SMBTEST/prf305.tmp, newname = clifford/profile/My
Documents/SMBTEST/ReadOnlyTest.txt, newname_last_component =
ReadOnlyTest.txt, mangle_is_8_3 = 1

[2004/02/24 10:55:38, 5] smbd/files.c:file_new(123)
  allocated file structure 2418, fnum = 6514 (1 used)

[2004/02/24 10:55:38, 3] lib/util.c:unix_clean_name(387)
  unix_clean_name [clifford/profile/My Documents/SMBTEST/prf305.tmp]

[2004/02/24 10:55:38, 4] smbd/open.c:open_file_shared1(942)
  calling open_file with flags=0x0 flags2=0x0 mode=00

[2004/02/24 10:55:38, 2] smbd/open.c:open_file(246)
  clifford opened file clifford/profile/My Documents/SMBTEST/prf305.tmp
*read=Yes write=No* (numopen=1)

[2004/02/24 10:55:38, 2] smbd/close.c:close_normal_file(213)
  clifford closed file clifford/profile/My Documents/SMBTEST/prf305.tmp
(numopen=0)

[2004/02/24 10:55:38, 5] smbd/files.c:file_free(346)
  freed files structure 6514 (0 used)

[2004/02/24 10:55:38, 3] smbd/reply.c:rename_internals(4045)
  rename_internals: succeeded doing rename on clifford/profile/My
Documents/SMBTEST/prf305.tmp -> clifford/profile/My
Documents/SMBTEST/ReadOnlyTest.txt


The file is received by samba as a read-only file but during the 
'renaming' from prf305.tmp to ReadOnlyTest.txt, this info is somehow lost.
So is anyone else experiencing issues such as this and if solved how.
This is really messing up sourcesafe usage as all the files are
read-write and so no-one code is getting lost!!
Here is a copy of my complete smb.conf:

# Samba config file created using SWAT
# from localhost (127.0.0.1)
# Date: 2004/02/23 23:27:46

# Global parameters
[global]
    workgroup = DOMINATION
    encrypt passwords = Yes
    map to guest = Bad User
    syslog = 0
    time server = Yes
    unix extensions = Yes
    deadtime = 15
    socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY
    printcap name = lpstat
    add user script = /usr/sbin/useradd -g machines -c "NT Machine
Account" -d /dev/null -s /bin/false %m\$
    logon path = \\%N\profile\%U\profile
    logon drive = z:
    logon home = \\%N\profile\%U\profile
    domain logons = Yes
    os level = 65
    preferred master = Yes
    domain master = Yes
    printing = lprng
    hide dot files = No
    veto files = /*.eml/*.nws/riched20.dll/*.{*}/

[homes]
    comment = Home Directories
    read only = No
    directory mask = 0700

[printers]
    comment = All Printers
    path = /var/tmp
    create mask = 0600
    guest ok = Yes
    printable = Yes
    use client driver = Yes
    browseable = No

[print$]
    comment = Printer Drivers
    path = /var/lib/samba/drivers
    write list = @ntadmin root
    force group = ntadmin
    create mask = 0664
    directory mask = 0775

[shares_vol1]
    comment = Shares Volume 1
    path = /shares/vol1
    read only = No
    create mask = 0774
    directory mask = 0775
    guest ok = Yes

[netlogon]
    comment = netlogon
    path = /usr/local/samba/lib/netlogon

[profile]
    path = /shares/profiles
    read only = No
    directory mask = 0700
    profile acls = Yes

[shares_vol2]
    comment = Shares Volume 2
    path = /shares/vol2
    read only = No
    create mask = 0774
    directory mask = 0775
    guest ok = Yes

[shares_freespace]
    comment = Shares freespace
    path = /shares/freespace
    read only = No
    create mask = 0777
    directory mask = 0777
    guest ok = Yes


Clifford





More information about the samba mailing list