rear/SOURCES/rear-bz1692575.patch
2021-09-10 03:49:11 +00:00

34 lines
2.1 KiB
Diff

diff -up rear-2.4/usr/share/rear/conf/GNU/Linux.conf.empty rear-2.4/usr/share/rear/conf/GNU/Linux.conf
--- rear-2.4/usr/share/rear/conf/GNU/Linux.conf.empty 2019-09-10 09:45:50.381285069 +0200
+++ rear-2.4/usr/share/rear/conf/GNU/Linux.conf 2019-09-10 09:45:50.421284309 +0200
@@ -276,6 +276,6 @@ COPY_AS_IS_EXCLUDE=( "${COPY_AS_IS_EXCLU
# some stuff for the Linux command line
KERNEL_CMDLINE="$KERNEL_CMDLINE selinux=0"
# common users and groups
-CLONE_USERS=( "${CLONE_USERS[@]:-}" daemon rpc usbmuxd usbmux vcsa nobody dbus )
-CLONE_GROUPS=( "${CLONE_GROUPS[@]:-}" tty usbmuxd usbmux fuse kvm oinstall dbus )
+CLONE_USERS+=( daemon rpc usbmuxd usbmux vcsa nobody dbus )
+CLONE_GROUPS+=( tty usbmuxd usbmux fuse kvm oinstall dbus )
diff -up rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh.empty rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh
--- rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh.empty 2018-06-21 10:40:53.000000000 +0200
+++ rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh 2019-09-10 09:45:50.421284309 +0200
@@ -40,6 +40,8 @@ local group=""
# because it should succeed when there is any non-empty array member, not necessarily the first one:
test "${CLONE_USERS[*]}" && Log "Cloning users: ${CLONE_USERS[@]}"
for user in "${CLONE_USERS[@]}" ; do
+ # Skip empty user values, cf. https://github.com/rear/rear/issues/2220
+ test $user || continue
# Skip if the user exists already in the ReaR recovery system:
grep -q "^$user:" $ROOTFS_DIR/etc/passwd && continue
# Skip if the user does not exist in the current system:
@@ -78,6 +80,8 @@ done
# because it should succeed when there is any non-empty array member, not necessarily the first one:
test "${CLONE_GROUPS[*]}" && Log "Cloning groups: ${CLONE_GROUPS[@]}"
for group in "${CLONE_GROUPS[@]}" ; do
+ # Skip empty group values, cf. https://github.com/rear/rear/issues/2220
+ test $group || continue
# Skip if the group exists already in the ReaR recovery system:
grep -q "^$group:" $ROOTFS_DIR/etc/group && continue
# Skip if the group does not exist in the current system: