Created attachment 9938 [details] changes to client.c clitar.c and smbclient.1 (man page) This cropped up while using smbclient with BackupPC. We found that if access to a file was denied by Windows, smbclient would issue an error and stop processing the rest of the directory. This became more apparent when Windows 8.1 started putting "swapfile.sys" at the top level, and BackupPP never reached /Users (i.e. the likely most important stuff). I looked around and could see that other people seemed to have similar problems, but did not find a fix. (adminstrator privileges did not cure busy file problems (NT_STATUS_SHARING_VIOLATION). I have made a fairly simple change for use with backup type usage where it is very likely that there will always be some legitimate denials on files. In "clitar.c" I modified the "tarmode" command to accept an "errorskip" option. I also changed function "do_atar" so that when errorskip is set and an access denial occurs, it issues a message and returns NT_STATUS_OK so that clilist() does not terminate the for loop. I'm attaching diff files for the changes I made.
Created attachment 11097 [details] Original patch rebased to Samba 4.1.6 We have the same problem with BackupPC and Samba >3.5 Attached is the original patch rebased to Samba 4.1.6 (for Samba version present in Ubuntu 14.04 LTS). We now successfully use BackupPC with the patched Samba.
Unfortunately, this code in 4.2 has been completely rewritten (again). I know it's a pain, but can you check and forward port this to 4.2.latest ? That would be much easier to include this change going forward. Thanks, Jeremy.
I compiled Samba from git (Version 4.3.0pre1-DEVELOPERBUILD) – smbclient does not need this patch. It skips files with access problems by default as it did in 3.5.x. I also checked 4.2.2 – works as it did in 3.5.x. So, this bug affects only Samba 3.6 – 4.1
Jeremy, Since Aurimas says that the problem is gone in 4.2 there does not seem to be any point in my trying to roll the rest of my change (the "errorskip" option to 4.2.
Ok, as it's already fixed in 4.2 I'm going to close this out. Thanks a lot for your help ! Jeremy.
Jeremy: shouldn't 4.1 bet patched accordingly then?
I think 4.2 got a complete clitar rewrite, which might be a bit big to backport. I'll check.
I didn't think of a backport from 4.2. I thought of the (not so big) patch that the bug reporter(s) attached here.
Yeah, but that patch is really ugly :-). I'll take a look.