Author: jra
Date: 2007-03-07 19:45:22 +0000 (Wed, 07 Mar 2007)
New Revision: 21750

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21750

Log:
Sync up with SAMBA_3_0_25. Only client changes are in libsmbclient
right now.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/client/client.c
   branches/SAMBA_3_0/source/libsmb/clifile.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/client.c
===================================================================
--- branches/SAMBA_3_0/source/client/client.c   2007-03-07 19:43:00 UTC (rev 
21749)
+++ branches/SAMBA_3_0/source/client/client.c   2007-03-07 19:45:22 UTC (rev 
21750)
@@ -1714,8 +1714,39 @@
 }
 
 /****************************************************************************
+ Wildcard delete some files.
 ****************************************************************************/
 
+static int cmd_wdel(void)
+{
+       pstring mask;
+       pstring buf;
+       uint16 attribute;
+
+       if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
+               d_printf("wdel 0x<attrib> <wcard>\n");
+               return 1;
+       }
+
+       attribute = (uint16)strtol(buf, (char **)NULL, 16);
+
+       if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
+               d_printf("wdel 0x<attrib> <wcard>\n");
+               return 1;
+       }
+
+       pstrcpy(mask,cur_dir);
+       pstrcat(mask,buf);
+
+       if (!cli_unlink_full(cli, mask, attribute)) {
+               d_printf("%s deleting remote files %s\n",cli_errstr(cli),mask);
+       }
+       return 0;
+}
+
+/****************************************************************************
+****************************************************************************/
+
 static int cmd_open(void)
 {
        pstring mask;
@@ -3211,6 +3242,7 @@
   {"unlock",cmd_unlock,"unlock <fnum> <hex-start> <hex-len> : remove a POSIX 
lock",{COMPL_REMOTE,COMPL_REMOTE}},
   {"volume",cmd_volume,"print the volume name",{COMPL_NONE,COMPL_NONE}},
   {"vuid",cmd_vuid,"change current vuid",{COMPL_NONE,COMPL_NONE}},
+  {"wdel",cmd_wdel,"<attrib> <mask> wildcard delete all matching 
files",{COMPL_REMOTE,COMPL_NONE}},
   {"logon",cmd_logon,"establish new logon",{COMPL_NONE,COMPL_NONE}},
   {"listconnect",cmd_list_connect,"list open 
connections",{COMPL_NONE,COMPL_NONE}},
   {"showconnect",cmd_show_connect,"display the current active 
connection",{COMPL_NONE,COMPL_NONE}},

Modified: branches/SAMBA_3_0/source/libsmb/clifile.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clifile.c  2007-03-07 19:43:00 UTC (rev 
21749)
+++ branches/SAMBA_3_0/source/libsmb/clifile.c  2007-03-07 19:45:22 UTC (rev 
21750)
@@ -496,7 +496,7 @@
  Delete a file.
 ****************************************************************************/
 
-BOOL cli_unlink(struct cli_state *cli, const char *fname)
+BOOL cli_unlink_full(struct cli_state *cli, const char *fname, uint16 attrs)
 {
        char *p;
 
@@ -509,7 +509,7 @@
        SSVAL(cli->outbuf,smb_tid,cli->cnum);
        cli_setup_packet(cli);
 
-       SSVAL(cli->outbuf,smb_vwv0,aSYSTEM | aHIDDEN);
+       SSVAL(cli->outbuf,smb_vwv0, attrs);
   
        p = smb_buf(cli->outbuf);
        *p++ = 4;      
@@ -529,6 +529,15 @@
 }
 
 /****************************************************************************
+ Delete a file.
+****************************************************************************/
+
+BOOL cli_unlink(struct cli_state *cli, const char *fname)
+{
+       return cli_unlink_full(cli, fname, aSYSTEM | aHIDDEN);
+}
+
+/****************************************************************************
  Create a directory.
 ****************************************************************************/
 

Reply via email to