LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 03: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, 06: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, 06: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, 06:34 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

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

Yves.
 
Old 02-10-2009, 07: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, 01: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, 04: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, 07: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



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 01:51 AM
Sorry, sudo must be setuid root kurtdriver Fedora 6 10-22-2008 07: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 05:15 PM
How to setuid root abridge Linux - Newbie 4 04-06-2005 03:59 PM
Userhelper must be setuid root leroux Linux - Newbie 9 03-10-2005 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:11 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