I have a script running under my own user account that takes care of all sorts of wireless interfaces. It (more or less) intelligently switches wireless LAN off and on and so forth. However, it does so by calling on tools such as
hciconfig to bring the devices up and down. But since these require super user privileges I decided to create a copy of these binaries in my personal script folder and set the suid flag (I am the only one who can read and execute that directory). So the permissions on these binaries look like
-rwsr-x--- and they belong to
root and my own primary group.
However, the suid bit appears to be completely ignored because I get the following result when executing that binary:
me@host:~/scripts/suid$ stat iwconfig File: `iwconfig' Size: 26968 Blocks: 72 IO Block: 4096 regular file Device: 15h/21d Inode: 4194732 Links: 1 Access: (4750/-rwsr-x---) Uid: ( 0/ root) Gid: ( 1000/ me) Access: 2011-08-24 04:15:39.008148182 +0200 Modify: 2013-02-09 21:25:47.777488386 +0100 Change: 2013-03-12 15:55:20.765681857 +0100 Birth: - me@host:~/scripts/suid$ ./iwconfig wlan0 txpower off Error for wireless request "Set Tx Power" (8B26) : SET failed on device wlan0 ; Operation not permitted.
I also tried setting the group to root, the guid bit and making the binaries world executable and readable. With the same outcome.
So, why is that and how can I fix it?