From a3c11d5022f2303768cd718f60894e69d0335649 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 7 Apr 2014 19:57:30 +0200 Subject: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/login.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/login.c') diff --git a/src/login.c b/src/login.c index 8bc5e05..9e84f45 100644 --- a/src/login.c +++ b/src/login.c @@ -70,7 +70,7 @@ void chdir_home(struct passwd* entry) sleep(ERROR_SLEEP); _exit(1); } - entry->pw_dir = DEFAULT_HOME; + entry->pw_dir = strdup(DEFAULT_HOME); } } @@ -83,7 +83,7 @@ void chdir_home(struct passwd* entry) void ensure_shell(struct passwd* entry) { if ((entry->pw_shell && *(entry->pw_shell)) == 0) - entry->pw_shell = DEFAULT_SHELL; + entry->pw_shell = strdup(DEFAULT_SHELL); } @@ -167,9 +167,9 @@ void exec_shell(struct passwd* entry) strcpy(login_sh, "exec "); *(login_sh + n) = 0; - *(child_argv + child_argc++) = DEFAULT_SHELL; - *(child_argv + child_argc++) = "-" DEFAULT_SH; - *(child_argv + child_argc++) = "-c"; + *(child_argv + child_argc++) = strdup(DEFAULT_SHELL); + *(child_argv + child_argc++) = strdup("-" DEFAULT_SH); + *(child_argv + child_argc++) = strdup("-c"); *(child_argv + child_argc++) = login_sh - 5; } else -- cgit v1.2.3-70-g09d2