summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2014-10-21 11:26:36 -0300
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-22 21:39:12 +0200
commit2ff8f54e7930b029ea6cdf6037af7437f2cc1919 (patch)
tree2ba3f9e076236f7bd0e6076272bbe26c1ed0289c
parent9f13ddf3bab51ae762b82ce9f767ac1abcdb7b2e (diff)
scripts/mkusers: allow the creation of groups alone
Let mkusers create groups alone, useful for supplementary permissions in udev/systemd for example where users can be added to later at runtime. Use a magic string "-" to signal that user creation should be skipped. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rwxr-xr-xsupport/scripts/mkusers2
1 files changed, 2 insertions, 0 deletions
diff --git a/support/scripts/mkusers b/support/scripts/mkusers
index ffd192dba..5e5a5d958 100755
--- a/support/scripts/mkusers
+++ b/support/scripts/mkusers
@@ -397,6 +397,7 @@ main() {
# Now, add users whose uid is *not* automatic
while read username uid group gid passwd home shell groups comment; do
[ -n "${username}" ] || continue # Package with no user
+ [ "${username}" != "-" ] || continue # Magic string to skip user creation
[ ${uid} -ge 0 ] || continue # Automatic uid
add_one_user "${username}" "${uid}" "${group}" "${gid}" "${passwd}" \
"${home}" "${shell}" "${groups}" "${comment}"
@@ -405,6 +406,7 @@ main() {
# Finally, add users whose uid *is* automatic
while read username uid group gid passwd home shell groups comment; do
[ -n "${username}" ] || continue # Package with no user
+ [ "${username}" != "-" ] || continue # Magic string to skip user creation
[ ${uid} -eq -1 ] || continue # Non-automatic uid
add_one_user "${username}" "${uid}" "${group}" "${gid}" "${passwd}" \
"${home}" "${shell}" "${groups}" "${comment}"