diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-22 05:15:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:59 -0500 |
commit | 2f377d5101783ed4d8c96a46aaec61895cc7b6ad (patch) | |
tree | 8a397e786d9395c1bfb90469e52940847d18a151 /source4/client | |
parent | 2e55ba2018a25aac33cec76ee16c2e9754421448 (diff) | |
download | samba-2f377d5101783ed4d8c96a46aaec61895cc7b6ad.tar.gz samba-2f377d5101783ed4d8c96a46aaec61895cc7b6ad.tar.bz2 samba-2f377d5101783ed4d8c96a46aaec61895cc7b6ad.zip |
r2499: - use more efficient wildcard delete in smbclient
- use "*.*" instead of "*" when connected to ancient servers
(This used to be commit e28f2027580f31b392ecc9e115ee2eb5fc80f933)
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/client.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index 45aac0444b..68b30acc67 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -624,7 +624,12 @@ static int cmd_dir(const char **cmd_ptr) pstrcat(mask,p); } else { - pstrcat(mask,"*"); + if (cli->tree->session->transport->negotiate.protocol <= + PROTOCOL_LANMAN1) { + pstrcat(mask,"*.*"); + } else { + pstrcat(mask,"*"); + } } do_list(mask, attribute, display_finfo, recurse, True); @@ -1528,24 +1533,6 @@ static int cmd_queue(const char **cmd_ptr) /**************************************************************************** delete some files ****************************************************************************/ -static void do_del(file_info *finfo) -{ - pstring mask; - - pstrcpy(mask,cur_dir); - pstrcat(mask,finfo->name); - - if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) - return; - - if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, mask))) { - d_printf("%s deleting remote file %s\n",smbcli_errstr(cli->tree),mask); - } -} - -/**************************************************************************** -delete some files -****************************************************************************/ static int cmd_del(const char **cmd_ptr) { pstring mask; @@ -1563,7 +1550,9 @@ static int cmd_del(const char **cmd_ptr) } pstrcat(mask,buf); - do_list(mask, attribute,do_del,False,False); + if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, mask))) { + d_printf("%s deleting remote file %s\n",smbcli_errstr(cli->tree),mask); + } return 0; } |