bug in smbclient: archive and mget

Korey Renner korey at fidnet.com
Mon May 15 03:00:55 GMT 2000


Samba 2.0.7, x86 Redhat 6.1

I have been attempting to use samba to mirror files from windows
workstations to a Linux server.

I have set up a script which calls smbclient to retrieve the files from
the workstations, using the archive bit to keep track of updated files.

Inside smbclient, typing 'help archive' shows this:

    0=ignore archive bit
    1=only get archive files
    2=only get archive files and reset archive bit
    3=get all files and reset archive bit

I have been setting 'archive 2' or 'archive 3' depending on whether I
want a full backup or a partial backup.  But these modes do not seem to
reset the archive bit as they should.

After a bit of debugging, the following patch seems to fix smbclient,
but I'm sure someone who understands the code better than I do would
have a more elegant solution.


*** client.c Wed May 10 18:11:04 2000
--- client.c.orig Wed May 10 18:08:24 2000
***************
*** 721,728 ****
   if (newhandle) {
    close(handle);
   }
   if (archive_level >= 2 && (attr & aARCH)) {
!   cli_setatr(cli, rname, attr & ~(uint16)aARCH & 63, 0);
   }

   {
--- 721,729 ----
   if (newhandle) {
    close(handle);
   }
+
   if (archive_level >= 2 && (attr & aARCH)) {
!   cli_setatr(cli, rname, attr & ~(uint16)aARCH, 0);
   }

   {




More information about the samba mailing list