When downloading files recursively, smbclient will halt if it encounters a folder to which it does not have permission to traverse. Note the mix of files with root only and root + group + other permissions on the "media share": ravel:/media/:[0]# ls -lR .: total 16 -rw-r--r-- 1 root root 7 Feb 4 18:12 others_file drwxr-xr-x 2 root root 4096 Feb 4 18:12 root_and_others drwx------ 2 root root 4096 Feb 4 14:37 root_only -rwx------ 1 root root 10 Feb 4 16:57 root_only_file ./root_and_others: total 4 -rw-r--r-- 1 root root 8 Feb 4 15:52 permissive ./root_only: total 4 -rw-r--r-- 1 root root 5 Feb 4 14:37 rooted Recursively downloading the contents of the "media" share using an smbclient master build does not pull down the files readable by the "beensee" user: ddiss@f163:~/isms/samba-pristine/tmp (bnc786350_eperm_continue)> ../bin/smbclient -s /etc/samba/smb.conf -U 'beensee' -c 'recurse;prompt;mget *' //ravel.arch.suse.de/media Enter beensee's password: Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.28.1-2860-SUSE-CODE11-x86_64] NT_STATUS_ACCESS_DENIED opening remote file \root_only_file NT_STATUS_ACCESS_DENIED listing \root_only\* NT_STATUS_ACCESS_DENIED listing \* ddiss@f163:~/isms/samba-pristine/tmp (bnc786350_eperm_continue)> ls -lR . .: total 4 drwxr-xr-x 2 ddiss users 4096 2013-02-04 18:13 root_only ./root_only: total 0 smbclient versions prior to Samba 3.6 (3.5 in this example) successfully download all readable files: ddiss@f163:~/isms/samba-pristine/tmp (bnc786350_eperm_continue)> rm -rf ~/isms/samba-pristine/tmp/* ddiss@f163:~/isms/samba-pristine/tmp (bnc786350_eperm_continue)> smbclient -s /etc/samba/smb.conf -U 'beensee' -c 'recurse;prompt;mget *' //ravel.arch.suse.de/media Enter beensee's password: Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.28.1-2860-SUSE-CODE11-x86_64] NT_STATUS_ACCESS_DENIED opening remote file \root_only_file NT_STATUS_ACCESS_DENIED listing \root_only\* getting file \root_and_others\permissive of size 8 as permissive (7.8 KiloBytes/sec) (average 7.8 KiloBytes/sec) getting file \others_file of size 7 as others_file (6.8 KiloBytes/sec) (average 7.3 KiloBytes/sec) ddiss@f163:~/isms/samba-pristine/tmp (bnc786350_eperm_continue)> ls -lR .: total 12 -rw-r--r-- 1 ddiss users 7 2013-02-04 18:28 others_file drwxr-xr-x 2 ddiss users 4096 2013-02-04 18:28 root_and_others drwxr-xr-x 2 ddiss users 4096 2013-02-04 18:28 root_only ./root_and_others: total 4 -rw-r--r-- 1 ddiss users 8 2013-02-04 18:28 permissive ./root_only: total 0
As identified by Bogdano Arendartchuk, this regression was introduced with commit: 14ff2e8de9bd8d0064762234555260f5eea643fe Fix bug #7700 - Improvement of return code of smbclient
Created attachment 8529 [details] Proposed fix for master
Does smbclient give the user a warning about what file it wasn't able to download? I don't see one in the patch.
(In reply to comment #3) > Does smbclient give the user a warning about what file it wasn't able to > download? I don't see one in the patch. An error message is printed for each file do_get() cannot open for download, and each directory do_list() is unable to recurse: Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-0.28.1-2860-SUSE-CODE11-x86_64] NT_STATUS_ACCESS_DENIED opening remote file \root_only_file NT_STATUS_ACCESS_DENIED listing \root_only\* getting file \root_and_others\permissive of size 8 as permissive (7.8 KiloBytes/sec) (average 7.8 KiloBytes/sec) getting file \others_file of size 7 as others_file (6.8 KiloBytes/sec) (average 7.3 KiloBytes/sec) The error is not currently propagated through to the exit status, this should be addressed in future.
Re-assigning to Karolin for inclusion in 4.0.next and 3.6.next (patch applies cliently to both). Jeremy.
Pushed to v3-6-test and autobuild-v4-0-test.
Pushed to v4-0-test. Closing out bug report. Thanks!