Oleg Starshinov
2005-Dec-03 14:15 UTC
[Fwd: [Samba] Problem with setting Normal attribute for a file owned by another user]
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? Thanks, Oleg. -------- 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@ameritech.net> To: samba@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, FileAttributes.Normal) 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,@users create mode = 0771 directory mode = 2775 Thanks, Oleg. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba