Re: [BackupPC-users] smbclient throws NT_STATUS_ACCESS_DENIED when listing Documents folder on Windows 10

2021-09-21 Thread Michael Stowe

On 2021-09-20 18:44, Aaron Anderson wrote:

I'm using a docker image of BackupPC 4.4 which has smbclient 4.14. My 
backups have been SMB failing on a Win 10 client and I'm trying to 
figure out why.


My command line is:

/usr/bin/smbclient MACHINE\\Documents -U USER%PASSWORD -E -d 5 -c 
tarmode\ full\ nosystem\ nohidden -mSMB2 -TcX - '*My*'


The result I get is:

tar:716  do_list fail NT_STATUS_ACCESS_DENIED
tar:633  tar_process done, err = 1

In the increased debugging log, I see:

tar:923  +++ \Fax\Inbox
tar:976  get_file skip dir \Fax\Inbox
NT_STATUS_ACCESS_DENIED listing \My Music\*
NT_STATUS_ACCESS_DENIED listing \My Pictures\*
NT_STATUS_ACCESS_DENIED listing \My Videos\*
dos_clean_name [\OneNote Notebooks\.]
unix_clean_name [\OneNote Notebooks\.]

When I list the share, I can see those directories are hidden and are 
likely legacy junctions:


My MusicDHSrn0  Sun Mar 21 07:05:29 
2021
My Pictures DHSrn0  Sun Mar 21 07:05:29 
2021
My Videos   DHSrn0  Sun Mar 21 07:05:29 
2021


As you can see in my command line, I've attached to disable system and 
hidden files and even excluded anything with My in it. None of this 
seems to work.


I'm not a developer but have been around code for a while so I tried to 
look at the smbclient source code. I can see here in clitar.c [1] line 
716 the error. This comes from the do_list() function which passes the 
get_file_callback function. In that function I see that it should be 
attempting to exclude system and hidden files but my guess is the 
listing is the problem before it even calls in the callback in client.c 
[2].


Is there something else I can do to exclude these files?

Regards,

Aaron


I'm not quite sure what you're trying to do ... if I'm reading this 
right, you're trying to exclude a junction point called "My Music" (for 
example).  It's neither a system nor a hidden file, so that won't 
exclude it.


Normally, you'd just add such junction points to 
$Conf{BackupFilesExclude}.  You might want to list what you've tried 
here, the traditional path to exclude is '\\Users*DocumentsMy 
Music', and so on.


Links:
--
[1] 
https://gitlab.com/samba-team/devel/samba/-/blob/f351d72e037f90c6b3c3ee2172835da7bd2cc6c9/source3/client/clitar.c
[2] 
https://gitlab.com/samba-team/devel/samba/-/blob/f351d72e037f90c6b3c3ee2172835da7bd2cc6c9/source3/client/client.c___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


[BackupPC-users] smbclient throws NT_STATUS_ACCESS_DENIED when listing Documents folder on Windows 10

2021-09-20 Thread Aaron Anderson

I'm using a docker image of BackupPC 4.4 which has smbclient 4.14. My backups 
have been SMB failing on a Win 10 client and I'm trying to figure out why.


My command line is:

/usr/bin/smbclient MACHINE\\Documents -U USER%PASSWORD -E -d 5 -c tarmode\ 
full\ nosystem\ nohidden -mSMB2 -TcX - '*My*'


The result I get is:

tar:716  do_list fail NT_STATUS_ACCESS_DENIED
tar:633  tar_process done, err = 1


In the increased debugging log, I see:

tar:923  +++ \Fax\Inbox
tar:976  get_file skip dir \Fax\Inbox
NT_STATUS_ACCESS_DENIED listing \My Music\*
NT_STATUS_ACCESS_DENIED listing \My Pictures\*
NT_STATUS_ACCESS_DENIED listing \My Videos\*
dos_clean_name [\OneNote Notebooks\.]
unix_clean_name [\OneNote Notebooks\.]


When I list the share, I can see those directories are hidden and are likely 
legacy junctions:

  My MusicDHSrn0  Sun Mar 21 07:05:29 2021
  My Pictures DHSrn0  Sun Mar 21 07:05:29 2021
  My Videos   DHSrn0  Sun Mar 21 07:05:29 2021


As you can see in my command line, I've attached to disable system and hidden 
files and even excluded anything with My in it. None of this seems to work.

I'm not a developer but have been around code for a while so I tried to look at 
the smbclient source code. I can see here in 
clitar.c
 line 716 the error. This comes from the do_list() function which passes the 
get_file_callback function. In that function I see that it should be attempting 
to exclude system and hidden files but my guess is the listing is the problem 
before it even calls in the callback in 
client.c.


Is there something else I can do to exclude these files?


Regards,


Aaron

___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/