summaryrefslogtreecommitdiffstats
path: root/utils/statd/start-statd
Commit message (Collapse)AuthorAgeFilesLines
* start-statd: Use bash as -p is no POSIXLuk Claes2011-08-291-2/+2
| | | | | | | | sh -p is not guaranteed to be provided by POSIX shells. dash for instance does not provide this, so use bash explicitly. Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Ensure statd gets started if required when non-rootNeil Brown2008-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | user mounts an NFS filesystem. The first time an NFS filesystem is mounted, we start statd from /sbin/mount.nfs. If this first time is a non-root user doing the mount, (thanks to e.g. the 'users' option in /etc/fstab) then we need to be sure that the 'setuid' status from mount.nfs is inherited through to rpc.statd so that it runs as root. There are two places where we loose our setuid status due to the shell (/bin/sh) discarding. 1/ mount.nfs uses "system" to run /usr/sbin/start-statd. This runs a shell which is likely to drop privileges. So change that code to use 'fork' and 'execl' explicitly. 2/ start-statd is a shell script. To convince the shell to allow the program to run in privileged mode, we need to add a "-p" flag. We could just call setuid(getuid()) at some appropriate time, and it might be worth doing that as well, however I think that getting rid of 'system()' is a good idea and once that is done, the adding of '-p' is trivial and sufficient. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add start-statd script.Neil Brown2007-03-291-0/+9
This script is used by mount.nfs to run statd if needed. It can be locally modified to change arguements if required.