diff options
author | Guillem Jover <guillem@debian.org> | 2009-12-26 21:04:23 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2009-12-31 20:51:51 +0100 |
commit | dde9a226d5f831c773539ee8c58f861148fd7c5e (patch) | |
tree | a462d663faf30d25ccb2d9096d3628ea93aad8d8 /utils | |
parent | 863943468eb0c3e1431c7223325a469e223dcd72 (diff) | |
download | dpkg-dde9a226d5f831c773539ee8c58f861148fd7c5e.tar.gz |
Use stat instead of access to check for file existence
Diffstat (limited to 'utils')
-rw-r--r-- | utils/start-stop-daemon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 2cb45199f..8126b2e8d 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -1494,6 +1494,7 @@ main(int argc, char **argv) } if (changeuser) { struct passwd *pw; + struct stat st; if (sscanf(changeuser, "%d", &runas_uid) == 1) pw = getpwuid(runas_uid); @@ -1507,7 +1508,7 @@ main(int argc, char **argv) changegroup = ""; /* Just empty. */ runas_gid = pw->pw_gid; } - if (access(pw->pw_dir, F_OK) == 0) + if (stat(pw->pw_dir, &st) == 0) setenv("HOME", pw->pw_dir, 1); } |