LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 03-25-2005, 04:41 PM   #1
boing
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
I can setuid binaries, but it doesn't work! Help.


Hi..

Ok, I have a C program, 'prog.c' that does system('ls /root');

1. Its compiled(gcc -o prog prog.c), and runs fine, under root.
Root owns this file.
I want anyone else to be able to view /root, so I do:

chmod 4755 prog
ls -l prog

-rwsr-xr-x 1 root root 11221 2005-03-25 21:34 prog

So prog is now setuid...to run under root from any user.


2. But I keep getting permission denied when ran by any user except root.

WHY?? It's really wrecking my head.

Note: I have tried the same idea between two different normal users, just in case there was some protection against setuiding root files. I'm using slackware 10.1, and havn't messed around with kernel settings. I know linux disabled setuid for scripts, bit this file 'prog' is a binary. Please help.



ps. I know prog.c is a stupid program, I'm just using it as an example.

Thanks!
boing
 
Old 03-25-2005, 04:54 PM   #2
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
What about chmod 6755 prog? That usually works for me... (shouldn't really be any different tho)
 
Old 03-25-2005, 05:58 PM   #3
boing
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Yeah I tried that too...
Thanks tho!

boing
 
Old 03-25-2005, 09:14 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,133

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Is the partition you're running it on mounted nosetuid? If that's the case, setuid binaries won't work on it. You can check this in /etc/mtab.
 
Old 03-26-2005, 12:18 PM   #5
boing
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Hi...
Nope, i checked that also...That's why I've no idea why this isn't working


Does slackware 10.1 somehow block setuit?
 
  


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
why setuid didn't work for my script? hueofwind Linux - General 3 11-23-2005 11:07 PM
firefox 1.05 binaries won't work when extracted MidniteHex Linux - Newbie 8 07-19-2005 01:50 AM
Why different binaries do not work across distros? jasmith Linux - Software 1 02-25-2005 06:33 PM
setuid Help devinWhalen Linux - General 2 12-03-2003 09:57 AM
Setuid SirTurbo Linux - General 1 03-26-2003 06:57 PM


All times are GMT -5. The time now is 11:09 AM.

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