[Samba] permission bits clobbered

Panko, Kevin kevin.panko at pw.utc.com
Thu Jan 15 15:54:40 GMT 2004

The '>' creates a new file, but ONLY if the file did NOT exist before.  If
it does exist, the file's contents are replaced, but it still the same file.

This is the way it works on both Windows and Unix.
This command:
echo foobar > secretfile
Does not clobber the permissions (or NTFS ACLs) on Unix (or Windows).
But it does clobber them when Samba is involved.

It makes no sense to say that the act of editting a text file has any effect
on its security permissions.  (Whether it be in notepad.exe or on the
command line as I have shown.)

-----Original Message-----
From: juanjo.carel at ono.com [mailto:juanjo.carel at ono.com]
Sent: Thursday, January 15, 2004 3:40 AM

Of course '>' is very different of '>>'. '>' creates a new file so THE 
NEW secretfile is created with the 644 mask.
'>>' appends in the file. 

> A file is chmod 600.  It gets opened on Windows, and it gets 
> changed to 644.
> This happens if the user does:
> N:\> echo foobar > secretfile
> But it does stay at chmod 600 if he does (append instead of truncate):
> N:\> echo foobar >> secretfile
> The "create mask" parameter is set to 644.  I do not think this 

More information about the samba mailing list