aboutsummaryrefslogtreecommitdiffstats
path: root/scd/scdaemon.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-07-25 10:24:01 +0000
committerWerner Koch <[email protected]>2017-07-25 10:43:37 +0000
commit226f143ca01cf335c7c4e3e94c96fb9d271eccc9 (patch)
treebf998fd0bb8459a74fe5ca339c4fa114fcd79f36 /scd/scdaemon.c
parentRevert "w32: Change directory on daemon startup." (diff)
downloadgnupg-226f143ca01cf335c7c4e3e94c96fb9d271eccc9.tar.gz
gnupg-226f143ca01cf335c7c4e3e94c96fb9d271eccc9.zip
common: New functions gnupg_daemon_rootdir and gnupg_chdir.
* common/sysutils.c (gnupg_chdir): New. * common/homedir.c (gnupg_daemon_rootdir): New. * agent/gpg-agent.c (main): Use these functions instead chdir("/"). * dirmngr/dirmngr.c (main): Ditto. * scd/scdaemon.c (main): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--scd/scdaemon.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 26e89dd8d..bf3f42a0e 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -908,9 +908,10 @@ main (int argc, char **argv )
sigaction (SIGPIPE, &sa, NULL);
}
- if (chdir("/"))
+ if (gnupg_chdir (gnupg_daemon_rootdir ()))
{
- log_error ("chdir to / failed: %s\n", strerror (errno));
+ log_error ("chdir to '%s' failed: %s\n",
+ gnupg_daemon_rootdir (), strerror (errno));
exit (1);
}