Opened 12 years ago

Last modified 3 years ago

#15 new defect

Hidden, system, readonly attributes do not work as expected on OS/2

Reported by: guest Owned by: diver
Priority: blocker Milestone: Samba Server for eCS (OS/2) 1.3.x
Component: Samba Server Version: 3.0.x
Keywords: Cc: herwig.bauernfeind@…

Description

Clients (WinXP and Netdrive) see files on the server, that have the hidden and/or system attribute set.

Clients (WinXP and Netdrive) seem to be able to change hidden, system, readonly attributes, but the attributes don't stick (it appears the server ignores these changes.

Clients (WinXP and Netdrive) can delete files on the server that have readonly attribute set.

Change History (14)

comment:1 Changed 12 years ago by psmedley

  • Status changed from new to assigned

comment:2 Changed 12 years ago by psmedley

http://smedley.info/smbdtest.zip is a first attempt at fixing this - attributes of files that preexist on the server at least are recognised with WinXP client.

comment:3 Changed 12 years ago by guest

  • Priority changed from critical to major

Sjoerd Vissers comment on ecomstation.support.networking:

This formulation does not take into account several features of samba and CIFS. I don't think they are bugs, but they are merely the result of some confusion between classic DOS attributes and the DOS attributes emulation of samba on UNIX file systems.

Samba was developed for UNIX filesystems, not for DOS, Windows and OS/2 filesystems.

UNIX filesytems do not know the DOS attributes hidden, system, readonly, so samba ignores them when it reads the filesystem of the server that can make use of it. This explains the samba behavior under (1) and (3).

Samba makes use of the the UGO user right system of UNIX filesytems and can superimpose on this extra restrictions on samba shares (like read only). Under OS/2 the UGO permissions can only be simulated with security/2.

Because Windows clients expected to see DOS attributes on their own filesystems and on their shares (Windows NT servers), the samba team emulated them on the server. The DOS attributes were laid down in the extended attributes of the server filesystem and had only meaning when used by samba.

See fi: http://lists.samba.org/archive/samba-technical/2003-July/030879.html

To make use of it you have enter in smb.conf.

[global] store dos attributes = Yes

If you don't do this (2) will apply.

But when doing this under OS/2 you must realize again that the samba DOS attributes have nothing to do with the classic DOS attributes. Making a file RO via netdrive does not change its DOS atributes on the server, but changes its extended attributes.

You can see this is if you study files made RO via samba with EABrowwser. They have a section USER.DOSATTRIB having the value of 0x12.

comment:4 Changed 12 years ago by guest

  • Summary changed from Hidden, system, readonly attributes are broken to Hidden, system, readonly attributes do not work as expected on OS/2

comment:5 Changed 11 years ago by ydario

  • Milestone set to Samba Server for OS/2 1.0

comment:6 Changed 11 years ago by ydario

  • Milestone changed from Samba Server for OS/2 1.0 to Samba Server for OS/2 1.0.1

comment:7 Changed 10 years ago by diver

  • Milestone changed from Samba Server for eCS (OS/2) 1.0.1 to Samba Server for eCS (OS/2) 1.0.2

comment:8 Changed 10 years ago by herwigb

  • Version set to 3.0.25b

comment:9 Changed 9 years ago by diver

  • Owner changed from psmedley to diver
  • Priority changed from major to critical
  • Status changed from assigned to new
  • Version changed from 3.0.25b to 3.0.x

comment:10 Changed 9 years ago by dmik

This is actually a very major problem as it prevents using the FS on both the client and the server side. One example is SVN. SVN has a control area in each directory (the .svn subdirectory) and it stores all files in R/O mode in there. When it needs to write them, it sets them temporarily to R/W and then sets back to R/W.

Now imagine that you share a SVN tree on an OS/2 machine over Samba. If you create the original tree using the local svn command, all control files will be true R/O. If you then run svn on a share from another machine, the svn commit command will fail when updating e.g. the log file because it will see that the file is R/W (as this is how it is seen through Samba even if it's actually R/O) and won't even try to remove the R/O flag (but it would fail even if it tried, for the same reason of the absence of the proper attribute synchronization).

It's quite obvious IMHO that there must be a direct correspondence between attributes seen over Samba and real file attributes that works both ways. And I actually see no reasons to not implement it (other than the usual lack of time...).

I was thinking that as long as we have kLIBC that supports Unix permission bits, a simple straightforward way of letting Samba server think it is running on a real POSIX machine would solve the problem but it will actually not, because as I found kLIBC itself lacks any support for correspondence between Unix permission bits it stores in EAs and the real DOS attributes. At least, ls -l seems to completely ignore DOS attributes and only shows what's stored in EAs (or 0666 if there is no EAs). So kLIBC itself needs to be fixed too.

BTW, I found an interesting thing. With Samba server 3.0.37 that I'm using at least. If you *clear* the ARCHIVE DOS attribute on a file on the server then the READONLY DOS attribute starts to get mapped correctly and this mapping/sync works both ways. Really strange. If we find a piece of code that does it, it may help a lot. Unfortunately, I don't have time for that right now.

comment:11 Changed 9 years ago by dmik

Note about the latter command. This behavior is only observed with store dos attributes = No (expectedly) setting which to Yes is I think completely wrong anyway -- the OS/2 server has a real place to store DOS attrs as opposed to POSIX servers, so storing them in EAs looks, hm, like one more round of mess.

comment:12 Changed 6 years ago by diver

  • Milestone changed from Samba Server for eCS (OS/2) 1.1.x to Samba Server for eCS (OS/2) 1.2.x

comment:13 Changed 3 years ago by herwigb

  • Priority changed from critical to blocker

comment:14 Changed 3 years ago by herwigb

http://msplins06.bon.at/%7Eadmin139/files/attrpack-20071027.zip Scripts provided in this package act as tools to partly work around this problem.

  • smbattrib - sets both filesystem and Samba Server attributes of a file (or files)
  • attr2smb - synchronizes Samba Server attributes according to filesystem attributes
  • smb2attr - synchronizes filesystem attributes according to Samba Server attributes
Note: See TracTickets for help on using tickets.