[Fwd: [Samba] Problem with setting Normal attribute for a file owned by another user]

Oleg Starshinov olegstarshinov at ameritech.net
Fri Dec 2 16:48:39 GMT 2005

Hi Everyone,
I thought I'd ask again and maybe someone knows the answer..
How come I can read/write to files on a share with any user, but the 
"Normal" attribute can only be set by the owner of the file.
Is this by design or am I not setting the right configuration? How is 
the "Normal" attribute being handled in Samba?

-------- Original Message --------
Subject: 	[Samba] Problem with setting Normal attribute for a file owned 
by another user
Date: 	Wed, 30 Nov 2005 13:16:07 -0600
From: 	Oleg Starshinov <olegstarshinov at ameritech.net>
To: 	samba at lists.samba.org

Hi Everyone,
We have a Samba 3.0.20b server running in a multi-user environment.
There is a "serveruser" username that does batch processing on the files 
using VB.NET code.
There are many other regular users: "user1", "user2", etc...
They are all part of the "users" group
If "user1" opens up a file in Excel, it changes the ownership on the 
file and permissions to:
   User - rwe
   Group - rw-
   Other - ---

The default setting is:
   User - rwe
   Group - rwe
   Other - ---

I can live with the change of the permissions, but it also changes the 
ownership from "serveruser" to "user1".

As part of my code, the server applies a "Normal" attribute to the files 
once it is done copying them.
It works fine when the "serveruser" is the owner of the file, but when 
someone else owns the file an exception is raised.
This is the line of code: File.SetAttributes(myFile.FullName, 
I can open and save the files with any user name, but the setting of the 
attribute is only allowed if I own the file.
Is this by design or am I missing something?

As a workaround I included this line in the conf file:
force user = serveruser
I would rather have the last user that saved the file to be registered 
as the owner.

Here is the conf file relating to that share:
   writeable = yes
   path = /data
   force user = serveruser
   write list = @users
   force directory mode = 2775
   force group = users
   valid users = user1,user2,serveruser, at users
   create mode = 0771
   directory mode = 2775

To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

More information about the samba mailing list