Suid root seems not to work - Getting SUIDcidal ;-)
Greetings!
As I'm using Kanotix (which doesn't seem to have such an extensive forum) and it's based on Knoppix, I figure I'll post this question here.
For a program which will use the parallel port for digital I/O, I'm trying to get access to the port WITHOUT being root (no sudo, either). For this, I've compiled a simple program in C, but it keeps complaining it has no permissions to access the port (/dev/parport0). Port permissions are as follows:
Code:
crw-rw-rw- 1 root root 99, 0 Feb 9 19:40 /dev/parport0
The program has been compiled using gcc -O1 -o test test.c, after which I've issued (as root):
Code:
chown root:users test
chmod u+s test
I figured it should work now, but it doesn't. Keeps complaining about permissions.
Furthermore I've tried creating a file foo.txt and done chmod 600 foo.txt. Then made an executable script bar.sh, which just cat's foo.txt. Then:
Code:
chown root:users bar.sh
chmod u+s bar.sh
Executing bar.sh also gives permission errors. So in other words: what gives? I'm stumped, but I've probably misunderstood how suid root works. Any help would be greatly appreciated.
Thanks in advance,
Marc.