LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 02-10-2009, 04:27 AM   #1
sathishpy
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Rep: Reputation: 0
can't write to a file as non root having setuid


On RHEL 5 upadte 3, I am seeing the following issue

#mkdir /newdir
#touch /newdir/file1
#chmod 06777 /newdir/file1

#su newuser
$dd if=/dev/null of=/newdr/file1
dd: opening '/newdir/file1': Operation not permitted

The result is same even with selinux disabled. This used to work on older releases clearing the setuid/setgid after the write. wondering whether it is an intended change or a bug.
 
Old 02-10-2009, 07:08 AM   #2
skuzye
Member
 
Registered: Jul 2008
Location: São Paulo - Brazil
Distribution: Fedora 17
Posts: 97

Rep: Reputation: 15
First, do a ls -l (lowercase "L") and see if the permissions are correct.

Skuzye
 
Old 02-10-2009, 07:30 AM   #3
sathishpy
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
The permissions are correct and it is -rwsrwsrwx. As I mentioned the same steps works fine with rhel5 update 2, the issue is only with update 3.
 
Old 02-10-2009, 07:34 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
06777 doesn't exist. 0677 is OK, and 6777 too; I suppose the latter is your actual intent.

Yves.
 
Old 02-10-2009, 08:44 AM   #5
sathishpy
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
both 06777 and 6777 works the same for chmod.

# chmod 06777 /newdir/file1
# ls -l /newdir/file2
-rwsrwsrwx 1 6777 root 0 Feb 10 09:30 /newdir/file1
 
Old 02-10-2009, 02:36 PM   #6
camh
Member
 
Registered: Feb 2005
Distribution: Slack/Debian
Posts: 163
Blog Entries: 2

Rep: Reputation: 33
Perhaps a silly question, but does newuser have access to the /newdir directory itself? What are the permissions for /newdir?
 
Old 02-11-2009, 05:44 AM   #7
sathishpy
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Yes.

# ls -ld /newdir/
drwxrwxrwx 2 root root 4096 Feb 10 09:30 /newdir/
# ls -l /newdir/file1
-rwsrwsrwx 1 6777 root 0 Feb 10 05:16 /newdir/file1
 
Old 02-23-2009, 08:48 AM   #8
sathishpy
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
This issue is due to RHEL5.3 patch BZ#463687 [kernel: open() call allows setgid bit when user is not in new file's group].
 
  


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
need root to setuid bit? allasso Linux - General 5 12-03-2008 02:51 AM
Sorry, sudo must be setuid root kurtdriver Fedora 6 10-22-2008 08:47 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 06:15 PM
How to setuid root abridge Linux - Newbie 4 04-06-2005 04:59 PM
Userhelper must be setuid root leroux Linux - Newbie 9 03-10-2005 02:42 AM


All times are GMT -5. The time now is 06:06 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration