A much better option than suid-ing a script IMO is to use sudo to give your user exactly the capabilities he needs. For example, if you put this in your /etc/sudoers file:
And another option would be to have another program with appropriate permissions running as a separate process and do the critical jobs: this would require some form of IPC, but may even be done asyinchronously if such an option is suitable for the actual application.
For example the firewall script may add entries to a file (which may also happen to be a named pipe) and another script may process them running the necessary programs requiring root privileges.
In reply to Re^2: Perl script needs root privilegies
by blazar
in thread Perl script needs root privilegies
by ivanatora
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |