LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-06-2011, 04:04 AM   #1
markdibley
LQ Newbie
 
Registered: Apr 2010
Posts: 13

Rep: Reputation: 0
Problem with groups


Hello

This is just a quick question. I am having problems with groups and file permissions.

I have a file owned by myself

Code:
-rw-rw-r-- 1 diblemar users 2.1K Jun  3 06:02 /cluster/shared/Injects/1404_1405_1000033606_79964.return.xml
I want to modify the file using a cgi script running on an apache server (on the same machine). Both diblemar and apache are in the same group


Code:
apache:x:48:diblemar
However, I receive a file permissions error when I try to modify the file. I assumed that with the permission settings above apache would be able to modify a file owned by someone else in the apache group.

Am I missing something?

Thanks

Mark
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-06-2011, 04:15 AM   #2
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
the only problem i can think of is that PROBABLY the script is executed as another user?
Try to find out which user is being used for executing files

normally this should work, place in your script the following code
Code:
echo `whoami`
if you know which user is executing the file, let us know
 
Old 06-06-2011, 04:28 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
A user belonging to a group does not have rights to other user's files even if they are in same group.
So, the way I understand you, for that file "diblemar" is owner and has permissions "rw", group is "users" and has permissions "rw" so anybody in group "users" also has read/write access to the file.
Members of group "apache" has only read-access.
 
2 members found this post helpful.
Old 06-06-2011, 05:20 AM   #4
markdibley
LQ Newbie
 
Registered: Apr 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks! Looking at the files again the logic of it is pretty clear. By adding diblemar to the apache group has allowed me to modify apache files, but in order for apache to modify diblemar files I have to either
  1. Add apache to the users group
  2. make "apach"e the primary group of the user "diblemar"

Thanks again
 
Old 06-06-2011, 05:25 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
I'm glad you found your answer

Also mark this thread as solved, if you are satisfied with your answer
 
Old 06-08-2011, 02:04 PM   #6
markdibley
LQ Newbie
 
Registered: Apr 2010
Posts: 13

Original Poster
Rep: Reputation: 0
I was still having problems with this. I had a file as follows

Code:
-rw-rw-r-- 1 diblemar users 0 Jun  8 12:58 /research/cluster/Injects/error.log
I had added apache to the users group and confirmed it with

Code:
$ groups apache
apache : apache users
However, I was still getting permission denied errors when my cgi script attempted to open this file for amending.

The fix was restarting apache so that the group changes (and some umask changes I had made) were applied.

Thanks for everyone's help.

Mark
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LFS /tools/bin/groups not displaying supplementary groups grail Linux - Newbie 8 06-09-2010 10:57 PM
groups +w problem yull Linux - Security 12 09-04-2009 04:43 AM
Micro$oft AD Groups to Debian Lenny Groups.- Mindblower Linux - Desktop 0 04-22-2009 10:28 AM
Map Windows NT Groups to UNIX Groups - why? kenji1903 Linux - Networking 4 10-16-2007 12:52 PM
winbind: wbinfo -g only lists global groups from PDC and not local groups saradiya Linux - Networking 0 12-01-2003 03:58 AM


All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration