Actually a smbclient bug, not a libsmbclient bug. We're missing calls to clean_name() after assembling paths.
Found by Andreas by doing: rename FILE ..\newdir\FILE over SMB2. We got away with it in SMB1 as in SMB1 the server will canonicalize these paths (and smbd does it for SMB2 also).
That's smbclient rename command I mean.
Created attachment 13709 [details] git-am fix for master Prototype fix for master. Will need back-ports for 4.7.x and 4.6.x.
Created attachment 13710 [details] Updated git-am fix for master. Fixes the get_cur_dir() uses in clitar.c as well.
Created attachment 13711 [details] Updated git-am fix for master. Sigh. Third time lucky :-). Cope correctly with pathname canonicalization for UNIX extensions paths (which should *NOT* remove \..\ components, as they can be a valid part of the filename).
Created attachment 13718 [details] Updated git-am fix for master. Updated with regression test. Andreas, if you're happy let me know and I'll push to master and then do the back-ports for 4.7.next, 4.6.next.
Comment on attachment 13718 [details] Updated git-am fix for master. Looks like you like doing the work twice. I already sent you a test last Friday via mail :-) RB+ and pushed to master.
Oh, sorry I think I lost that email. Never mind :-).
Created attachment 13719 [details] git-am backport for 4.7.next Based on cherry-pick from master.
Created attachment 13720 [details] git-am fix for 4.6.next. Back-port from master.
Karolin, please add the patches to the relevant branches! Thanks.
(In reply to Andreas Schneider from comment #11) Pushed to autobuild-v4-{7,6}-test.
Looks like "s3: smbclient: Test we can rename with a name containing." breaks the build as the deltree command is not available in v4-6-test. Remove the test? Backport the deltree patch?
(In reply to Karolin Seeger from comment #13) Breaks the test, not the build, sorry! :-)
(In reply to Karolin Seeger from comment #14) NT_STATUS_OBJECT_NAME_COLLISION making remote directory \dotdot_test\dir2 smb: \dotdot_test\> cd dir1 smb: \dotdot_test\dir1\> put /memdisk/kseeger/a46/b3014032/samba/bin/smbclie <t /memdisk/kseeger/a46/b3014032/samba/bin/smbclien t README putting file /memdisk/kseeger/a46/b3014032/samba/bin/smbclient as \dotdot_test\dir1\README (64471.1 kb/s) (average 64472.7 kb/s) smb: \dotdot_test\dir1\> rename README ..\dir2\README NT_STATUS_OBJECT_NAME_COLLISION renaming files \dotdot_test\dir1\README -> \dotdot_test\dir2\README smb: \dotdot_test\dir1\> cd .. smb: \dotdot_test\> cd dir2 smb: \dotdot_test\dir2\> allinfo README altname: README create_time: Thu Nov 2 10:25:11 AM 2017 CET access_time: Thu Nov 2 10:25:11 AM 2017 CET write_time: Thu Nov 2 10:25:11 AM 2017 CET change_time: Thu Nov 2 10:25:11 AM 2017 CET attributes: A (20) stream: [::$DATA], 264080 bytes smb: \dotdot_test\dir2\> cd \ smb: \> deltree dotdot_test deltree: command not found smb: \> quit
I think we can just remove the test for 4.6.next. Do you want me to submit a modified patch, or do you just want to push the rb+ patch and remove the test at the end ? Jeremy.
(In reply to Jeremy Allison from comment #16) Pushed to v4-6-test without test.
Fixed as 7abe56ccfa4aba75c5e166a7bd0bb8141c3f258b for 4.8.0 Also fixed in 4.7.1 and 4.6.10