Bug 15229 - Regression: smbclient tar 'r' option excludes broken
Summary: Regression: smbclient tar 'r' option excludes broken
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.17.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2022-11-08 10:02 UTC by main.haarp
Modified: 2022-11-08 10:02 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description main.haarp 2022-11-08 10:02:01 UTC

after upgrading my distro I notice that smbclient excludes have broken. The issue was traced to the tar 'r' option. It broke somewhere between 4.9.5 and 4.13.13. While the manpage considers the option deprecated:

> r - Use wildcard matching to include or exclude. Deprecated.

It is still present and actively used by other software, such as BackupPC. See https://github.com/backuppc/backuppc/issues/252

The results of using the 'r' option are unusual. Most excludes without wildcards do not work. Excludes for files on the root dir anchored with `//` or `\\` do work. Excludes with wildcards in them mostly do work, but only if anchored with `//` or `\\`. In short: things are inconsistent and broken.

Bisecting samba reveals https://gitlab.com/samba-team/samba/-/commit/d2d5007936ba4f48edad61c7613bed07c31da463 to be the culprit (related: bug 11642). I'm CCing the author.

Some test cases:

Doesn't work: smbclient '\\wsfoo\C' -U user%pw -E -d 1 -c 'tarmode full' -mSMB3 -TcrX - //foo
Does work: smbclient '\\wsfoo\C' -U user%pw -E -d 1 -c 'tarmode full' -mSMB3 -TcrX - //foo/*
Does work if foo is a file: smbclient '\\wsfoo\C' -U user%pw -E -d 1 -c 'tarmode full' -mSMB3 -TcrX - //foo
Doesn't work: smbclient '\\wsfoo\C' -U user%pw -E -d 1 -c 'tarmode full' -mSMB3 -TcrX - */foo