LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-06-2006, 08:47 AM   #1
Gunbunny
LQ Newbie
 
Registered: Aug 2005
Distribution: Whitebox Linux
Posts: 7

Rep: Reputation: 0
Owner of file in shared directory changing


Hello,

I'm running Mandrake 9.2 as a file server. I have two users who belong to the same group who access a file on the file server. The document (.xls spreadsheet) is set up so that both the owner and the group have full rights (read/write/execute), while others can just read it. Each time one of the owners goes into edit this .xls file, it changes the owner of the document to whomever opened it last, and makes it read-only for the other person. What's going on here?

Thanks in Advance!

Gunbunny
 
Old 01-07-2006, 02:44 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
It sounds like you need to set the group sticky bit on the directory with:

Code:
chmod g+s dirname
That causes files to keep their group ownership when changed. This is different to setting the bit on the files in that directory. Have a look at http://rute.2038bug.com/node17.html.gz for more info on this. As an example, in my CVS repository I have several developers checking code into each directory. To keep things simple, I gave them group membership depending on the directories (corresponding to projects) I wanted them to have access to. A typical directory looks like:

Code:
drwxrwsr-x  8 cvs cvs_java 4096 2005-07-02 07:05 /usr/local/cvsrepos/java
But a file in that directory does not have the group sticky bit set, eg:

Code:
-r--r--r--  1 cvs cvs_java  300 2002-08-12 05:31 readme.txt,v
 
Old 01-09-2006, 08:06 AM   #3
Gunbunny
LQ Newbie
 
Registered: Aug 2005
Distribution: Whitebox Linux
Posts: 7

Original Poster
Rep: Reputation: 0
Just to make sure...group ownership doesn't change. It's the actual owner that changes. When one guy uses it, it has his name. When another uses it, it changes ownership to him, and then becomes read-only for the original guy. Original guy comes to me and tells me that it's read only again. Surely there must be a way for two people to share a file, having full access to it. They are members of the same group.
 
Old 01-09-2006, 12:43 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
Both users are logging in directly aren't they? In other words they're not using samba to access the files. If they're using samba you can set create permissions for files and directories in /etc/samba/smb.conf.

If they are logging in directly, have a look at their umask and make sure that the group writable flag will be set. Usually the umask is 0022 which means directories get created 0755 and files get created 0644 - neither of which are group writable.

If the umask is 0002, setting g+s (lower case s) on a directory will force group ownership of created files to be the same as that of the directory.

You may have to run chgrp on the files in that directory once more, but that should (love that word) be everything.
 
Old 01-13-2006, 07:00 PM   #5
Gunbunny
LQ Newbie
 
Registered: Aug 2005
Distribution: Whitebox Linux
Posts: 7

Original Poster
Rep: Reputation: 0
Both users are actually connecting via Samba. I'll check the permissions in smb.conf, and get back to you. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
libtermcap.so.2: cannot open shared object file: No such file or directory tcma Linux - Software 11 02-24-2012 03:00 AM
Changing owner and group of file surfbass Linux - General 2 12-12-2005 02:25 PM
Changing or converting a file to a directory. simjii Linux - General 1 06-04-2005 10:12 PM
Changing owner of a directory recursively? fturcic Linux - General 2 02-01-2005 07:13 AM
libawt.so: libXp.so.6: cannot open shared object file: No such file or directory man26 *BSD 0 09-10-2004 08:34 AM


All times are GMT -5. The time now is 12:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration