From dde9a226d5f831c773539ee8c58f861148fd7c5e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 26 Dec 2009 21:04:23 +0100 Subject: Use stat instead of access to check for file existence --- utils/start-stop-daemon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'utils') 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); } -- cgit v1.2.3