From 2303f8c4c3eb7635db3598c531532ffcf88c31fc Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 5 Apr 2010 00:57:47 +0200 Subject: [PATCH 1/1] para_client: Fix --user. In case the user was given in the config file but not at the command line, the logname was used. --key_file had a similar problem. Fix this by moving the initialization of these two variables down, after the config file has been read. --- client_common.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client_common.c b/client_common.c index 197f031c..ccb17176 100644 --- a/client_common.c +++ b/client_common.c @@ -366,12 +366,6 @@ int client_open(int argc, char *argv[], struct client_task **ct_ptr, ret = -E_CLIENT_SYNTAX; if (!ct->conf.inputs_num) goto out; - ct->user = ct->conf.user_given? - para_strdup(ct->conf.user_arg) : para_logname(); - - ct->key_file = ct->conf.key_file_given? - para_strdup(ct->conf.key_file_arg) : - make_message("%s/.paraslash/key.%s", home, ct->user); ct->config_file = ct->conf.config_file_given? para_strdup(ct->conf.config_file_arg) : @@ -394,6 +388,13 @@ int client_open(int argc, char *argv[], struct client_task **ct_ptr, &ct->conf, ¶ms)) goto out; } + ct->user = ct->conf.user_given? + para_strdup(ct->conf.user_arg) : para_logname(); + + ct->key_file = ct->conf.key_file_given? + para_strdup(ct->conf.key_file_arg) : + make_message("%s/.paraslash/key.%s", home, ct->user); + if (loglevel) *loglevel = get_loglevel_by_name(ct->conf.loglevel_arg); PARA_INFO_LOG("loglevel: %s\n", ct->conf.loglevel_arg); -- 2.39.2