From 0b8d2dc7ef00bde52f5c431f249c9793631a5e38 Mon Sep 17 00:00:00 2001 From: wbaumann Date: Sat, 14 Jan 2012 19:13:05 +0000 Subject: [PATCH] Set default user secrets file in parse_config --- ChangeLog | 2 ++ src/mount_davfs.c | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6835ff..5f040bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ ChangeLog for davfs2 Store process persona in args. * mount_davfs.c, parse_config, new_args: Set default user config file in parse_config. + * mount_davfs.c, parse_config, new_args: + Set default user secrets file in parse_config. 2012-01-12 Werner Baumann (werner.baumann@onlinehome.de) * dav_coda.c, dav_fuse.c: diff --git a/src/mount_davfs.c b/src/mount_davfs.c index aa163fb..19153f2 100644 --- a/src/mount_davfs.c +++ b/src/mount_davfs.c @@ -1087,6 +1087,9 @@ parse_config(dav_args *args) args->servercert = f; } + if (!args->privileged && !args->secrets) + args->secrets = ne_concat(args->home, "/.", PACKAGE, "/", DAV_SECRETS, + NULL); if (args->secrets && *args->secrets == '~') { int p = 1; if (*(args->secrets + p) == '/') @@ -1767,11 +1770,6 @@ new_args(void) args->path = NULL; args->servercert = NULL; - if (getuid() != 0) { - args->secrets = ne_concat(user_dir, "/", DAV_SECRETS, NULL); - } else { - args->secrets = NULL; - } args->username = NULL; args->cl_username = NULL; args->password = NULL;