]> git.decadent.org.uk Git - nfs-utils.git/commit - support/nsm/file.c
Statd should always 'chdir' to its state directory.
authorNeilBrown <neilb@suse.de>
Thu, 21 Jul 2011 18:23:00 +0000 (14:23 -0400)
committerLuk Claes <luk@debian.org>
Sun, 2 Oct 2011 14:16:46 +0000 (16:16 +0200)
commit72573a6376f801db5b086ebe65faf24d5c3c5d80
treefb872920886aec7873e640eff5bdcee75575aa8e
parent26f9f977dddeac3c78f446bafb6a61bbebd80664
Statd should always 'chdir' to its state directory.

s statd can be started by 'mount' which can sometimes be run by a
normal user, the current-working-directory could be anything.  In
partcular it could be in a mounted filesystem.  As 'statd' continues
running as a daemon it could keep prevent that filesystem from being
unmounted.

statd does currently 'chdir' to the state directory, but only if the
state directory is not owned by root.  This is wrong - it should check
for root after the chdir, not before.

So swap the two if statements around.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nsm/file.c