Bug 10164 - smbclient tar command missed remote directories,files
Summary: smbclient tar command missed remote directories,files
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.1.0rc3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2013-09-24 08:08 UTC by Gerben
Modified: 2020-01-07 23:02 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Gerben 2013-09-24 08:08:54 UTC
Also seen in 3.6.9, I built 4.1.0rc3 to verify on a recent version.


When trying to replicate directories on Windows 7 machines onto Ubuntu directories and files are missing. Specifically within the following set, directory Pictures is fetched for user Daniella, but not for users Gerben and Gerben2.

smbclient \\\\mssql01\\Users -U backuppc%xxxxxxxxxx -E -d1 -TcX backup3.tar ./Gerben/AppData ./Gerben2/AppData ./Daniella/AppData ./Default/AppData > log3.txt 2>&1

Checking the tarfile just does not provide the directory for either Gerben or Gerben2. The logfile does not name this directory for those users (not even with -d10).

My guess building the file list within the tar command drops items.

When browsing the share interactively (smbclient \\\\mssql01\\Users -U backuppc%xxxxxxxxxx) the directories are shown, the directories can be accessed.


Comment 1 Gerben 2013-09-24 09:08:12 UTC

Probably due to NTUSER.DAT, and the fact that users were logged on to the Windows machine. When logged on file NTUSER.DAT is opened and blocked for access by any other program. When examining the logfile I could find a message (NT_STATUS_SHARING_VIOLATION) related to this file. Any files/directories following this file (alphabetical order) is voided, the parent directory is shown with the same message as the file (NT_STATUS_SHARING_VIOLATION).

The error should not be progressed to the parent directory, the directory should be continued to process.

Extract from the logfile:

NT_STATUS_ACCESS_DENIED listing \Gerben2\My Documents\*
                directory \Gerben2\NetHood\
NT_STATUS_ACCESS_DENIED listing \Gerben2\NetHood\*
NT_STATUS_SHARING_VIOLATION opening remote file \Gerben2\NTUSER.DAT (\Gerben2\)
                directory \Public\
tar: dumped 396 files and directories


Comment 2 Amit Kumar 2018-08-28 07:15:42 UTC
Dear Gerben,

1. I created same samba-share structure as yours. Added a file inside each share as well
# find /share/

2. Accessed Daniella/AppData/file-Daniella from Windows Client

3. created tar using smclient and then looked at contents of tar.
# smbclient \\\\localhost\\myshare  -E -d1 -TcX backup3.tar ./Daniella/*
Enter WORKGROUP\root's password: 
tar:717  Total bytes received: 0
[root@<> test]# ls -ltr
total 8
-rw-r--r-- 1 root root 7168 Aug 28 12:38 backup3.tar
[root@<> test]# tar -xvf backup3.tar 
[root@<> test]# 

This is my share definition for testing.
    workgroup = WORKGROUP
    security = user
    map to guest = Bad User
    passdb backend = tdbsam
    path = /share
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0755

This means how smbclient works is:
a. When you want to create tar of all content Provide *
b. if nothing is specified, it creates tar of all content present in smb share.
Comment 3 Björn Jacke 2020-01-07 23:02:06 UTC
the smbclient tar command was not used correctly