aboutsummaryrefslogtreecommitdiffstats
path: root/util/mount.fuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/mount.fuse.c')
-rw-r--r--util/mount.fuse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/mount.fuse.c b/util/mount.fuse.c
index dc59c9d..1fc98f1 100644
--- a/util/mount.fuse.c
+++ b/util/mount.fuse.c
@@ -398,7 +398,7 @@ int main(int argc, char *argv[])
#endif
struct passwd *pwd = getpwnam(setuid_name);
- if (setgid(pwd->pw_gid) == -1 || setuid(pwd->pw_uid) == -1) {
+ if (!pwd || setgid(pwd->pw_gid) == -1 || setuid(pwd->pw_uid) == -1) {
fprintf(stderr, "%s: Failed to setuid to %s: %s\n",
progname, setuid_name, strerror(errno));
exit(1);