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
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:58:48 +0200
commite3678f8d2690df74f7599d438371cd0c20156b4a (patch)
treef6a3c9457b3927b516fd130357dbb7add885f19a /src/basic/user-util.h
parentfa454203ef5f60bca221ab6372d4e4f2318c7150 (diff)
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 6b2f1af52..2bd1ee9a7 100644
--- a/src/basic/user-util.h
+++ b/src/basic/user-util.h
@@ -108,6 +108,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);