Hello, 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 Thanks!
Hey Samba team, any news on this? Upon further testing, I think I figured out when excludes work if wildcards are enabled. (note: I'm using forward slashes throughout) - The exclude needs to start with `//`, unless it starts with a wildcard - The exclude must not end with a trailing slash - The exclude must not end with a directory - except when the directory name *ends* with a wildcard! So these work: - //haarp/Downloads/* - //haarp/Down* - //h*/Downloads/* - //*/*loads/* - *aarp/*loads/* - */*loads/* These do not work: - haarp/Downloads/* - h*/Downloads/* - //haarp/Downloads/ - //haarp/Downloads - //haarp/Down*/ - //haarp/*loads/
Forgot to mention: This was now tested on smbclient Version 4.22.4-Debian-4.22.4+dfsg-1~deb13u1.