Package: backupninja
Version: 1.2.2-1
Severity: normal
X-Debbugs-Cc: [email protected]

Dear Maintainer,

When using an rsync action with fakesuper=yes to save source uid/gid and
special files as xattr to a non-root destination the rsync action script
doesn't correctly pass the --fake-super option to the remote rsync process
due to (what amounts to an) unquoted concatenation of multiple arguments in
$remote_options:


    if [ "$fakesuper" == "yes" ]; then
      remote_rsync="$remote_rsync --fake-super"
    fi

    ...

    rsync_options=($rsync_options --rsync-path="$remote_rsync")

    ...

    info "Syncing $SECTION on $dest_path..."
    command="$rsync ${rsync_options[@]} --delete-excluded $filelist_flag 
$excludes $batch_option $orig $dest_path"
   $nice su -c "$command" | tee -a $log

The assignment command="... ${rsync_options[@]} ..." behaves as space
separating ${rsync_options[*]} here since no array assignment is used.


Suggested fix: Refactor to use the native rsync option
--remote-option=--fake-super instead of passing --fake-super through
--rsync-path.

For testing I suggest

    mkdir /tmp/test; mknod -m 0 /tmp/test/device-node c 0 0

as those files show up as rsync warnings "skipping non-regular file" if
--fake-root at the receiving end isn't working.

Thanks!
--Daniel

-- Example Config /etc/backup.d/80.rsync:
[general]
mountpoint = /tmp/test-backup
backupdir = Hostname
format = short
days = 14

[source]
from = local
include = /tmp/test
#^ Any dir for testing really :-)

[dest]
dest = remote
protocol = ssh
host = localhost
port = 22
user = username
id_file = /root/.ssh/id_ed25519


-- System Information:
Debian Release: 13.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 7.2.6+deb13-amd64 (SMP w/22 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages backupninja depends on:
ii  bash    5.2.37-2+b10
ii  dialog  1.3-20250116-1
ii  gawk    1:5.2.1-2+b1
ii  mawk    1.3.4.20250131-1

Versions of packages backupninja recommends:
ii  mailutils [mailx]  1:3.19-1

Versions of packages backupninja suggests:
pn  borgbackup     <none>
ii  bzip2          1.0.8-6
ii  debconf-utils  1.5.91
pn  duplicity      <none>
ii  fdisk          2.41.5-0+deb13u1
ii  genisoimage    9:1.1.11-4
ii  hwinfo         21.82-1.1+b2
ii  mdadm          4.4-11
pn  rdiff-backup   <none>
ii  restic         0.18.0-1+b4
ii  rsync          3.5.0+ds1-0+deb13u1
ii  subversion     1.14.5-3
pn  trickle        <none>
ii  util-linux     2.41.5-0+deb13u1
pn  wodim          <none>

-- Configuration Files:
/etc/backupninja.conf changed [not included]

-- no debconf information

Reply via email to