X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.c;h=2e7ae63db2e50253d4a50ad42b2243bab13dd98d;hb=ac6a4abed3e69daf6795e02fa4be1719ae6ae6ab;hp=a0755efb147593a2046e0feaf386986b047b4664;hpb=7c5f152acafcf0964db2f3a111195b3b2f36176f;p=elogind.git diff --git a/src/shared/util.c b/src/shared/util.c index a0755efb1..2e7ae63db 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -909,7 +909,7 @@ int load_env_file( continue; if (!(u = normalize_env_assignment(p))) { - log_error("Out of memory"); + log_error("Out of memory."); r = -ENOMEM; goto finish; } @@ -918,7 +918,7 @@ int load_env_file( free(u); if (!t) { - log_error("Out of memory"); + log_error("Out of memory."); r = -ENOMEM; goto finish; } @@ -4278,7 +4278,7 @@ void execute_directory(const char *directory, DIR *d, char *argv[]) { continue; if (asprintf(&path, "%s/%s", directory, de->d_name) < 0) { - log_error("Out of memory"); + log_error("Out of memory."); continue; } @@ -4905,7 +4905,12 @@ int socket_from_display(const char *display, char **path) { return 0; } -int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home) { +int get_user_creds( + const char **username, + uid_t *uid, gid_t *gid, + const char **home, + const char **shell) { + struct passwd *p; uid_t u; @@ -4926,6 +4931,10 @@ int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **h if (home) *home = "/root"; + + if (shell) + *shell = "/bin/sh"; + return 0; } @@ -4957,6 +4966,9 @@ int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **h if (home) *home = p->pw_dir; + if (shell) + *shell = p->pw_shell; + return 0; }