🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #2473

Bug#1152351: backupninja: rsync fakesuper option ineffective due to unquoted expansion of ${rsync_options[@]}

#2473
From: Daniel Gröber
Date: Wed, 28 Oct 2026 12:30
110 lines
4678 bytes
Package: backupninja
Version: 1.2.2-1
Severity: normal
X-Debbugs-Cc: dxld@debian.org

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
Technical Details
Message-ID: <NTaWZ-8qja-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Daniel Gröber <dxld@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1152351: backupninja: rsync fakesuper option ineffective due to unquoted expansion of ${rsync_options[@]}
Date: Wed, 28 Oct 2026 13:30:01 +0100
Message-ID: <NTaWZ-8qja-1@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Oct 28 12:21:10 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Daniel Gröber <dxld@debian.org>, 1152351@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: dxld@debian.org, pkg-backupninja@lists.riseup.net
X-Debian-Pr-Message: report 1152351
X-Debian-Pr-Package: backupninja
X-Debian-Pr-Source: backupninja
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
X-Greylist: delayed 311 seconds by postgrey-1.37 at buxtehude; Wed, 28 Oct 2026 12:20:02 UTC
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1999354
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 110
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 28 Oct 2026 13:14:39 +0100
X-Original-Message-ID: <zeeyprs3csaef5bplcpo7fwr4gvg673dmovrp5hbsejtkjp7xp@hi2viyyr3cyq>