diff options
author | Andrej.Gantvorg@wago.com <Andrej.Gantvorg@wago.com> | 2018-10-26 14:05:01 +0000 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-29 09:02:44 +0100 |
commit | da169984e95eb41cdd579ace5af06b9d164acc20 (patch) | |
tree | 18a20d0f23745b9c5e645c2da7b14933522365cc /scripts | |
parent | 0f2f190cbed88534b5085484b1fdfa05e766c08e (diff) | |
download | ptxdist-da169984e95eb41cdd579ace5af06b9d164acc20.tar.gz ptxdist-da169984e95eb41cdd579ace5af06b9d164acc20.tar.xz |
ptxd_install_resolve_usr_grp: skip empty params
Empty parameters may be passed to ptxd_install_resolve_usr_grp i.e. when
calling install_archive with UID/GID set to '-'. According to
documentation this should preserve the owner/group stored in the
archive. Without this patch, empty strings are mapped to the first entry
in /etc/{passwd,group} (usually 0) instead, thus breaking the documented
behaviour.
Signed-off-by: Andrej Gantvorg <andrej.gantvorg@wago.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index de0db4b0e..62fb302c6 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -79,12 +79,12 @@ export -f ptxd_install_getent_id # convert usr/grp that contain names into numeric values # ptxd_install_resolve_usr_grp() { - if ! [ 0 -le $usr ] 2>/dev/null; then + if [ -n "$usr" ] && ! [ 0 -le "$usr" ] 2>/dev/null; then ptxd_install_getent_id usr || return else unset usr_name fi - if ! [ 0 -le $grp ] 2>/dev/null; then + if [ -n "$grp" ] && ! [ 0 -le "$grp" ] 2>/dev/null; then ptxd_install_getent_id grp || return else unset grp_name |