[PATCH] smbget : enable update and various cleanup

neologix at free.fr neologix at free.fr
Mon Feb 25 19:58:22 GMT 2008


Alright. Round 2 :-)
You'll find 2 patches.
The first one is cleanup: I made static some variables that were unnecessarily
glocal, wrote a header, prototypes, corrected indentation, etc.
The other one is more interesting: it introduces an "update" mode, where we
download a file only if it is newer than its local copy or if there is no local
copy. The reason I hacked this is because I use smbget to do a backup of all my
samba shares, and it's much better if you download only the new files (resume
option doesn't check modification dates, and refuses to overwrite an already
existing file). The second thing is really a detail: when using guest mode, it
now uses "guest" rather than empty username. The reason for that is that empty
wouldn't work for my vista machine, but "guest" does. And it still works for my
xp machine, so it shouldn't be a regression. Also, it's a little bit faster than
before, because for a download without the resume option, we don't have to go
through the whole block.

Please note that I didn't update the Makefile.in (for the new header) nor the
man page.

Cheers,

Charles


Selon neologix at free.fr:

>
> Hi.
> Here's a patch that adds an --update option to smbget, so that it will only
> download files if the source is newer than the local copy, or if the file is
> missing. I've added this because it allows me to do backups of all my samba
> shares very simply, without having to re-download every file.
> Also, in the case of guest login, instead of using a void username, it now
> uses
> "guest", since void didn't work with vista but "guest" does. I also tried
> with
> windows < vista, and it seems to work.
> Finally, I made a lot of cleanups: I wrote a separate header, removed some
> unnecessary global variables, etc.
> If this patch is accepted, it would be nice if someone could update the
> manpage
> for the --update option and the Makefile for the new header.
>
> Cheers,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smbget_cleanup.patch
Type: text/x-diff
Size: 20522 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080225/c2e7c260/smbget_cleanup.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smbget_update_guest.patch
Type: text/x-diff
Size: 2987 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080225/c2e7c260/smbget_update_guest.bin


More information about the samba-technical mailing list