1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

r2499: - use more efficient wildcard delete in smbclient

- use "*.*" instead of "*" when connected to ancient servers
(This used to be commit e28f202758)
This commit is contained in:
Andrew Tridgell 2004-09-22 05:15:56 +00:00 committed by Gerald (Jerry) Carter
parent 2e55ba2018
commit 2f377d5101

View File

@ -624,8 +624,13 @@ static int cmd_dir(const char **cmd_ptr)
pstrcat(mask,p);
}
else {
if (cli->tree->session->transport->negotiate.protocol <=
PROTOCOL_LANMAN1) {
pstrcat(mask,"*.*");
} else {
pstrcat(mask,"*");
}
}
do_list(mask, attribute, display_finfo, recurse, True);
@ -1525,24 +1530,6 @@ static int cmd_queue(const char **cmd_ptr)
return 0;
}
/****************************************************************************
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
****************************************************************************/
@ -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;
}