summaryrefslogtreecommitdiff
path: root/src/basic/user-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-01-30 14:28:10 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-02 10:35:30 +0100
commit7b1aaf6633cad80c1e59eeedaf60595a3ec1efc5 (patch)
tree336ef1589bf1329e9665597aa380e40f9325feb0 /src/basic/user-util.h
parent1b600bd522d2c01c493729cdda4bcc2e01203e98 (diff)
downloadsystemd-7b1aaf6633cad80c1e59eeedaf60595a3ec1efc5.tar.gz
sysusers: allow the shell to be specified
This is necessary for some system users where the "login shell" is set to a specific binary.
Diffstat (limited to 'src/basic/user-util.h')
-rw-r--r--src/basic/user-util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/basic/user-util.h b/src/basic/user-util.h
index 290d17a0c6..e1259a1582 100644
--- a/src/basic/user-util.h
+++ b/src/basic/user-util.h
@@ -98,6 +98,15 @@ bool valid_user_group_name_or_id(const char *u);
bool valid_gecos(const char *d);
bool valid_home(const char *p);
+static inline bool valid_shell(const char *p) {
+ /* We have the same requirements, so just piggy-back on the home check.
+ *
+ * Let's ignore /etc/shells because this is only applicable to real and
+ * not system users. It is also incompatible with the idea of empty /etc.
+ */
+ return valid_home(p);
+}
+
int maybe_setgroups(size_t size, const gid_t *list);
bool synthesize_nobody(void);