LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-29-2008, 03:33 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question SGID fails to set w permission for the group


I'm trying to set up a CVS repository.

I want newly created directories to be readable by the group that the repository belongs to. That's what the SGID bit is used for, right?

Well, look at this:

Code:
antoranz@somos-server:/var/cvs2$ ls -lad ./
drwxrws--- 3 root desarrollo2 4096 2008-01-29 16:51 ./
antoranz@somos-server:/var/cvs2$ ls -l
total 4
drwxrws--- 3 root desarrollo2 4096 2008-01-29 16:14 CVSROOT
antoranz@somos-server:/var/cvs2$ mkdir test
antoranz@somos-server:/var/cvs2$ ls -l
total 8
drwxrws--- 3 root     desarrollo2 4096 2008-01-29 16:14 CVSROOT
drwxr-sr-x 2 antoranz desarrollo2 4096 2008-01-29 16:56 test
See? I have set up the SUID for the repository, the group has all permissions on the repository, but when I create a new directory inside the repository, the group permission fails to set the w bit (though the group does appear to be the "sticky" one), so other people can't write on my directory. What am I doing wrong?

Thanks in advance.

PS Same thing for new files. They fail to have the w bit for the group.
 
Old 01-29-2008, 07:56 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by eantoranz View Post
I want newly created directories to be readable by the group that the repository belongs to. That's what the SGID bit is used for, right?
That's what umask is for.
 
Old 01-30-2008, 07:46 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
So I have to change the UMASK?

I had thought about that already... setting the umask to 002 is advisable on a systemwide setting (like in /etc/profile)?
 
Old 02-01-2008, 06:15 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You can force a separate umask for specific users if you think 0002 is too wide open, but indeed, /etc/profile, or /etc/profile.d/* if their shell honours it.
 
  


Reply



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
Set group id,set user id? JAKK Slackware 3 06-15-2006 10:16 PM
Mount a raid array with SGID bit set, howto? anand_kt Linux - General 4 04-01-2005 01:30 AM
How to view set-user-ID and set-group-ID Xris718 Linux - General 7 01-10-2004 01:44 PM
Group permission klod Linux - Security 2 07-03-2003 07:08 PM
[alert] (22) Invalid argument : setgid : unable to set group id to Group 4294967295 Niraj Linux - Networking 1 12-13-2001 06:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:30 AM.

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
Open Source Consulting | Domain Registration