From 73d3e7c0eb60cd19bc445df47067397436c5613affcd54fc04bd0d002527bade Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Tue, 22 Sep 2020 08:24:31 +0000 Subject: [PATCH] Accepting request 835782 from home:favogt:fixnobody - Avoid useless use of cat - Simplify %sysusers_requires - Drop shebang, rpm passes it to /bin/sh itself OBS-URL: https://build.opensuse.org/request/show/835782 OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=30 --- macros.sysusers | 3 +-- sysuser-tools.changes | 7 +++++++ sysusers-generate-pre | 4 +--- sysusers2shadow.sh | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/macros.sysusers b/macros.sysusers index 6137da9..12c3e86 100644 --- a/macros.sysusers +++ b/macros.sysusers @@ -13,8 +13,7 @@ # ### -# This is for useradd/usermod/groupadd -%sysusers_requires Requires(pre): useradd_or_adduser_dep sysuser-shadow /usr/bin/cat \ +%sysusers_requires Requires(pre): sysuser-shadow \ Suggests: shadow %sysusers_generate_pre() \ diff --git a/sysuser-tools.changes b/sysuser-tools.changes index bc020b3..65c1050 100644 --- a/sysuser-tools.changes +++ b/sysuser-tools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Sep 18 10:32:53 UTC 2020 - Fabian Vogt + +- Avoid useless use of cat +- Simplify %sysusers_requires +- Drop shebang, rpm passes it to /bin/sh itself + ------------------------------------------------------------------- Fri Aug 21 15:09:13 UTC 2020 - Thorsten Kukuk diff --git a/sysusers-generate-pre b/sysusers-generate-pre index 3a37819..4cc2620 100644 --- a/sysusers-generate-pre +++ b/sysusers-generate-pre @@ -1,8 +1,6 @@ #!/bin/sh # pass systemd sysusers config paths as argument to this script. -echo '#!/bin/sh' -echo 'cat <<"EOF" |' +echo '/usr/sbin/sysusers2shadow <<"EOF" || [ -f /.buildenv ]' grep -he '^[ugmr]' "$@" echo 'EOF' -echo '/usr/sbin/sysusers2shadow || [ -f /.buildenv ]' diff --git a/sysusers2shadow.sh b/sysusers2shadow.sh index 33db91c..6440475 100644 --- a/sysusers2shadow.sh +++ b/sysusers2shadow.sh @@ -13,6 +13,7 @@ for i in /bin/busybox /usr/bin/busybox; do [ -x "$i" ] && busybox=$i; done while read LINE do + # "eval set" to do proper splitting while respecting quotes eval set -- $LINE case "${1-}" in \#*|"")