summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-16 12:34:54 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-16 12:34:54 +0200
commitd05c5031ad4c528fe6bbfed289519edb9f13180a (patch)
tree6b71a2bab0120c86da640693474beb4931043b0c /src/shared/util.c
parentb2896c905bef7be7ed9a760d9d61aa6ad0f614a3 (diff)
unit: introduce %s specifier for the user shell
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index a0755efb14..43ec62eac6 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -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;
}