chmod(2) / DOS Archive semantics

B.V.Dean B.V.Dean at ukc.ac.uk
Fri Aug 25 09:05:07 GMT 2000


I have run up against a problem with "DOS Archive Bit" semantics in SAMBA 2.0.7.

We have directories that groups write to. If you have a group bedrock, with
users fred and barney you may have files thus:

-rwxrw-r--   1 fred     bedrock     1383 Aug 23 15:15 fred.html
-rwxrw-r--   1 barney   bedrock     1437 Aug 23 14:18 barney.html

If fred tries to change DOS archive (owner x on Unix) on fred.html,
fine.

BUT if fred tries to change DOS archive on barney.html it fails, of
course - from the manpage chmod(2):

> The effective user ID of the process must match the owner of
> the  file or the process must have the appropriate privilege
> to change the mode of a file. 

Samba is running as fred at this point, so it fails.

Looking at the source of SAMBA, it looks like a config command, much
like "dos filetimes" (that gets round a similar problem with utime(2)),
could be added and the source changed to say:

	if ( dos_archive_semantics )
		become root
		chmod file
		return to user ID
	else
		chmod file

I don't feel confident enough to make this change at the moment as I do
not know my way round the source code.

Is anyone working on this?

This causes me a problem as I have nearly 400 web authors publishing
pages to my samba shares. They have been told to use Dreamweaver, which
tries to do this when publishing a file:

1	set DOS archive on
2	truncate file to 0 bytes
3	write new file contents
4	set time on destination file to same as source file
5	set DOS archive off

Steps 1, 4 and 5 fail if you do not own the file, but do have write
access. Although "dos filetimes" fixes step 4.

I need a fix for steps 1 and 5!



Barry Dean
Senior Computing Officer
http://www.ukc.ac.uk/php/bvd/






More information about the samba-technical mailing list