following the report in https://lists.samba.org/archive/samba/2022-May/240571.html it appears that invoking smbclient with '-E' -E, --stderr Write messages to stderr instead of stdout isn't working as expected as can be seen with the following examples SAMBA v4.12.15 ---------------- PASSWD=1234 ./bin/smbclient \\\\192.168.100.15\\C\$ -UAdministrator -E -d 1 -c tarmode\ full -mSMB3 -Tc - MyShare > foo.tar tarmode is now full, system, hidden, noreset, noverbose tar: dumped 4 files and 6 directories Total bytes written: 1265943 (22.1 MiB/s) tail -3 foo.tar /Iӧ�W��.#�h./MyShare/icacls/oi_dir/000755 000000 000000 00000000000 13705601676 013447 5ustar00000000 000000 ./MyShare/icacls/oi_dir/file1.rtf000644 000000 000000 00000000007 13705601641 015151 0ustar00000000 000000 {\rtf1}./MyShare/icacls/oi_dir/nested/000755 000000 000000 00000000000 13705601741 014722 5ustar00000000 000000 ./MyShare/icacls/oi_dir/nested/file2.txt000644 000000 000000 00000000000 13705601711 016447 0ustar00000000 000000 ./MyShare/icacls/oi_dir/nested/nested_again/000755 000000 000000 00000000000 13705601752 017345 5ustar00000000 000000 ./MyShare/icacls/oi_dir/nested/nested_again/file3.txt000644 000000 000000 00000000000 13705601750 021074 0ustar00000000 000000 tar -tf foo.tar ./MyShare/ ./MyShare/icacls/ etc. etc. SAMBA v4.15.5 ---------------- ./bin/smbclient --version Version 4.15.5 ./bin/smbclient \\\\192.168.100.15\\C\$ -UAdministrator -E -d 1 -c tarmode\ full -mSMB3 -Tc - MyShare > foo.tar tail -3 foo.tar tarmode is now full, system, hidden, noreset, noverbose tar: dumped 4 files and 0 directories Total bytes written: 1265943 (20.1 MiB/s) Note the smbclient tar summary output appended to the archive tar -tf foo.tar ./MyShare/ ./MyShare/icacls/ etc. etc. Note: tar isn't really 'corrupted' it still works (due to this content coming after the end of archive marker) but presumably at other debug levels contents could be corrupted
this is since changes to migrate smbclient to new cmdline parser, treatment of '-E' was lost (commit e4474ac0a540c56548b4d15e38f2e234455e19b6)
(In reply to Noel Power from comment #0) >SAMBA v4.15.5 >---------------- [...] >./bin/smbclient \\\\192.168.100.15\\C\$ -UAdministrator -E -d 1 -c tarmode\ full -mSMB3 -Tc - MyShare > foo.tar should have read PASSWD=1234 ./bin/smbclient \\\\192.168.100.15\\C\$ -UAdministrator -E -d 1 -c tarmode\ full -mSMB3 -Tc - MyShare > foo.tar
This bug was referenced in samba master: 5b6493043fc90a2bed5aaedad3b4511621d0b9fd 56e179817123b40c3646476563d345d8f97efff9
Created attachment 17304 [details] backport for 4.16
reassign to Jule for inclusion in 4.16
Pushed to autobuild-v4-16-test. Reviewed-by tag added.
This bug was referenced in samba v4-16-test: 239e0759db3d3b52ff78b326b779635900b7551e e3de2bdb8590684dfffa9974f1b45a571845e72b
Closing out bug report. Thanks!
This bug was referenced in samba v4-16-stable (Release samba-4.16.2): 239e0759db3d3b52ff78b326b779635900b7551e e3de2bdb8590684dfffa9974f1b45a571845e72b