Subject: bug#667: rsync: fails to honour a tilde (~) in --log-file option

From: Dave <[email-masked]>
Date: Fri, 04 Mar 2022 17:55:52 -0500

Package: rsync
Version: 3.1.3-6
Severity: normal

Dear Maintainer,

   * What led up to the situation?
Normal rsync local system directory copying/archiving using the '--log-file' option

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

1. Executing "rsync -a --verbose --log-file=~/xx/mylog ~/xxxx ~/xx"
Resulted in:
 rsync: failed to open log-file ~/xx/mylog: No such file or directory (2)
 Ignoring "log file" setting.
 sending incremental file list
 xxxx/
 xxxx/20211230171244.mkv
...snip normal output...
 xxxx/xx/20220212123456-mask2.xcf

 sent 2,687,537 bytes  received 222 bytes  5,375,518.00 bytes/sec
 total size is 2,686,183  speedup is 1.00

Note the error output and 'Ignoring "log file" setting.' line when the --logfile option contained a tilde: '--log-file=~/xx/mylog'
Also note that the source and destination directories do contain the tilde (~).
No log file was produced anywhere on the local system. (The directory archive was successful.)

2. Executing "rsync -a --verbose --log-file=xx/mylog ~/xxxx ~/xx" (relative directory)
or with '--log-file=/home/myid/xx/mylog' (fully qualified path) resulted in the expected logging operation. 

If the tilde is honoured in the arguments, shouldn't it also be honoured in the options?

Thanx.

-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 3 (beowulf)
Release:	3
Codename:	beowulf
Architecture: x86_64

Kernel: Linux 4.19.0-14-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages rsync depends on:
ii  base-files           10.3+devuan3.5
ii  init-system-helpers  1.56+nmu1+devuan3
ii  libacl1              2.2.53-4
ii  libattr1             1:2.4.48-4
ii  libc6                2.28-10
ii  libpopt0             1.16-12
ii  lsb-base             10.2019051400

rsync recommends no packages.

Versions of packages rsync suggests:
ii  openssh-client  1:7.9p1-10+deb10u2
ii  openssh-server  1:7.9p1-10+deb10u2

-- no debconf information

---

From: Mark Hindley <[email-masked]>
Date: Sun, 6 Mar 2022 07:49:34 +0000

Dave,

>    * What exactly did you do (or not do) that was effective (or

I doubt this is an rsync issue. Tilde expansion on the command line is handled
by your shell before executing the expanded command line. See sh(1).

> 1. Executing "rsync -a --verbose --log-file=~/xx/mylog ~/xxxx ~/xx"

If you are quoting the command, that will prevent tilde expansion.

Mark

---

From: "Devuan bug Tracking System" <[email-masked]>
Date: Tue, 14 Feb 2023 08:30:05 +0000

This is an automatic notification regarding your bug report
which was filed against the rsync package:

#667: rsync: fails to honour a tilde (~) in --log-file option

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
667: https://bugs.devuan.org/cgi/bugreport.cgi?bug=667
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#667: rsync: fails to honour a tilde (~) in --log-file option
From: Mark Hindley <[email-masked]>
To: Dave <[email-masked]>, [email-masked]
Date: Tue, 14 Feb 2023 08:27:45 +0000

Closing as this is a user shell quoting issue: tilde expansion is performed by
the shell not rsync.

Mark

Subject: rsync: fails to honour a tilde (~) in --log-file option
From: Dave <[email-masked]>
To: Debian Bug Tracking System <[email-masked]>
Cc: Devuan Bug Tracking System <[email-masked]>
Date: Fri, 04 Mar 2022 17:55:52 -0500

Package: rsync
Version: 3.1.3-6
Severity: normal

Dear Maintainer,

Thanx.

-- System Information:
Distributor ID:	Devuan