'smbclient' fails sometimes to return a proper return code: | $ smbclient -k //cricetus/test3 -c 'put /tmp/osl /x' ; echo $? | cli_push returned NT_STATUS_DISK_FULL | putting file /tmp/osl as \/x (11963,8 kb/s) (average 11963,8 kb/s) | 0 This is very problematic when used in scripts Seen with samba-client-3.0.33-3.28.el5 samba-client-3.5.4-62.fc13.x86_64
Created attachment 5845 [details] Fix for 3.5.x. This should fix your use case. Can you test and get back to me please ? Jeremy.
I experienced the same problem and tested the fix. Testing with samba-3.5.3 (as client) with the fix applied: Before the fix: $ smbclient '\\server\share -U 'user%pass' -c 'put /tmp/foo.tt "\dir\test"' ; echo $? Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28a] cli_push returned NT_STATUS_DISK_FULL putting file /tmp/foo.tt as \dir\test (38768.4 kb/s) (average 38768.4 kb/s) 0 After the fix: $ smbclient '\\server\share -U 'user%pass' -c 'put /tmp/foo.tt "\dir\test"' ; echo $? Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28a] cli_push returned NT_STATUS_DISK_FULL putting file /tmp/foo.tt as \dir\test (66523.7 kb/s) (average 66523.8 kb/s) 1 But it is still broken when 'put - ' is used: $ cat /tmp/foo.tt | smbclient '\\server\share -U 'user%pass' -c 'put - "\dir\test"' ; echo $? Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28a] cli_push returned NT_STATUS_DISK_FULL putting file - as \dir\test (72258.5 kb/s) (average 72258.6 kb/s) 0 => Exit status 0 instead of 1. Attached is a patch (against git-master) that should fix this. After my change: $ cat /tmp/foo.tt | smbclient '\\server\share' -U 'user%pass' -c 'put - "\dir\test"' ; echo $? Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.28a] cli_push returned NT_STATUS_DISK_FULL putting file - as \dir\test (57410.9 kb/s) (average 57411.0 kb/s) 1
Created attachment 6962 [details] Exit with the return code of cli_push
I've applied the second patch to master - looks good. I'll update for 3.6.1 once the autobuild completes. Karolin, both these patches are good for 3.5.next, the second one is also needed for 3.6.1. Jeremy.
Created attachment 6971 [details] git-am fix for 3.6.1. git-am fix that got pushed to master. Should apply to 3.6.1 and 3.5.next. Jeremy.
Comment on attachment 6971 [details] git-am fix for 3.6.1. Looks ok
Pushed both patches to v3-5-test and the second one to v3-6-test. Closing out bug report. Thanks!