Bug 5247 - Wildcard expansion in mget is broken
Wildcard expansion in mget is broken
Status: NEW
Product: Samba 3.0
Classification: Unclassified
Component: smbclient
3.0.28
x86 Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-07 12:32 UTC by Grigory Trenin
Modified: 2008-02-08 18:04 UTC (History)
1 user (show)

See Also:


Attachments
do_cd: always append a slash to the end of the directory (520 bytes, patch)
2008-02-08 14:31 UTC, Grigory Trenin
no flags Details
Patch (3.08 KB, patch)
2008-02-08 18:04 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grigory Trenin 2008-02-07 12:32:24 UTC
Hello,

I'm using samba-client-3.0.28-0.1.95.i586.rpm binary downloaded from samba.org
'mget' command doesn't expand wildcards properly: it doesn't insert a backslash between a directory name and a file name.
So it's impossible to download files using 'mget' command.

A previous version (3.0.20b-3.4-SUSE) that comes with SLES 9.3 is free from that bug.

$ smbclient '//servername/inform$' -U domain/username
Password: 
Domain=[domain] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows Server 2003 5.2]
smb: \> cd \bic\sprav.mfo\spr_base
smb: \bic\sprav.mfo\spr_base> ls *.dbf
  BNKDEL.DBF                          A  4164271  Tue Feb  5 11:28:43 2008
  BNKSEEK.DBF                         A  1383187  Tue Feb  5 11:28:43 2008
  KEYBASEB.DBF                        A   199694  Tue Feb  5 11:28:44 2008
  KEYBASEF.DBF                        A   225897  Tue Feb  5 11:28:44 2008
  KGUR.DBF                            A     1856  Tue May 15 12:31:24 2007
  OPER.DBF                            A      495  Thu Feb  7 18:07:10 2008
  PRIM.DBF                            A  1333291  Tue Feb  5 11:28:43 2008
  PZN.DBF                             A     2306  Tue May 15 12:31:23 2007
  RAYON.DBF                           A     5390  Tue Jan 29 11:38:46 2008
  RCLOSE.DBF                          A      480  Tue May 15 12:31:24 2007
  REAL.DBF                            A      889  Tue Jul  3 12:01:39 2007
  REG.DBF                             A     9509  Fri Sep  7 12:58:08 2007
  TNP.DBF                             A      407  Tue May 15 12:31:24 2007
  UER.DBF                             A      574  Tue Jul  3 12:01:39 2007
  UERKO.DBF                           A      500  Tue Jul  3 12:01:39 2007

                40676 blocks of size 4194304. 24850 blocks available
smb: \bic\sprav.mfo\spr_base> prompt off
smb: \bic\sprav.mfo\spr_base> mget *.dbf
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseBNKDEL.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseBNKSEEK.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseKEYBASEB.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseKEYBASEF.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseKGUR.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseOPER.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_basePRIM.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_basePZN.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseRAYON.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseRCLOSE.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseREAL.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseREG.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseTNP.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseUER.DBF
NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \bic\sprav.mfo\spr_baseUERKO.DBF
smb: \bic\sprav.mfo\spr_base>
Comment 1 Jeremy Allison 2008-02-07 13:59:34 UTC
Can't reproduce with the code in the git v3-0-test branch which will become 3.0.28a so I think this is fixed. Any chance you can test this ?
Jeremy.
Comment 2 Grigory Trenin 2008-02-08 08:58:07 UTC
Jeremy, I've fetched v3-0-test branch from git and tried it.
To my surprise, the bug is still present there!
$ ./smbclient --version
Version 3.0.28a-GIT-086eaf2-test
Please let me know which kind of information I can provide to help you.
Comment 3 Grigory Trenin 2008-02-08 14:31:31 UTC
Created attachment 3134 [details]
do_cd: always append a slash to the end of the directory
Comment 4 Grigory Trenin 2008-02-08 14:33:10 UTC
Jeremy,

I've found a problem and made a patch for it, please see the attachment.
On 'cd <relative_path>', CLI_DIRSEP_STR is appended to the directory's end.
But on 'cd <absolute_path>', CLI_DIRSEP_STR is not appended.
My patch changes it to always append CLI_DIRSEP_STR, whenever the path is relative or absolute.

Though it solves my problem, in no way this patch is final.
It is merely to point you at the problem.
Comment 5 Jeremy Allison 2008-02-08 18:04:22 UTC
Created attachment 3135 [details]
Patch

Should fix the problem for 3.0.28a. I'll forward-port to 3.2.x
Jeremy.