setuid program owned by non-root user
问题 I have a setuid program (getpwd) that runs as expected only when owned by root. -rwsr-xr-x 1 root root 7981 2011-11-17 18:28 getpwd* In other words when my program is executed on the command line by user "alice" all works fine The program opens a file in directory /home/secure and print the contents to screen. alice@devbox:/home/alice/tmp$ ./getpwd setuid is working However when I change the ownership and set setuid of the file: chown secure:users getpwd chmod 4755 getpwd -rwsr-xr-x 1 secure