Bug 11593 - Scannedonly VFS makes directories listed as unknown files
Scannedonly VFS makes directories listed as unknown files
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
4.1.6
All Linux
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-09 10:42 UTC by EOLE Team
Modified: 2015-11-09 11:02 UTC (History)
1 user (show)

See Also:


Attachments
Debug level10 of wrong display of “test” directory (175.09 KB, application/x-xz)
2015-11-09 11:02 UTC, EOLE Team
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description EOLE Team 2015-11-09 10:42:02 UTC
Hello,

This bug report follow a mail on the mailing-list[1].

We have some directories displayed as “unknown files” under windows when we use the scannedonly VFS.

Here are the steps to reproduce:

* Install Ubuntu Trusty Thar server, normal user called “ubuntu”


* Install “samba”

root@ubuntu:~# apt-get install samba samba-vfs-modules


* Install clamav

root@ubuntu:~# apt-get install clamav


* Download clamav database

root@ubuntu:~# freshclam


* Install a precompiled scannedonly package

root@ubuntu:~# wget http://eole.ac-dijon.fr/eole/pool/main/s/scannedonly/scannedonly_0.21-1_amd64.deb

root@ubuntu:~# dpkg -i scannedonly_0.21-1_amd64.deb


* Edit samba configuration to add

root@ubuntu:~# cat > /etc/samba/smb.conf <<EOF
[global]
    netbios name = srvtest
    workgroup = domtest
        server string = srvtest
        wins support = yes
        dns proxy = no
        domain master = no
        os level = 99
        unix extensions = no
        nt acl support = yes
        wide links = yes
        oplocks = no
        level2 oplocks = no
        vfs objects = scannedonly
        scannedonly:allow_nonscanned_files=True
        store dos attributes = no
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog = 0
        panic action = /usr/share/samba/panic-action %d
        server role = standalone server
        passdb backend = tdbsam
        obey pam restrictions = yes
        unix password sync = yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        pam password change = yes
        map to guest = bad user
        usershare allow guests = yes
[printers]
        comment = All Printers
        browseable = no
        path = /var/spool/samba
        printable = yes
        guest ok = no
        read only = yes
        create mask = 0700
[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
        browseable = yes
        read only = yes
        guest ok = no
[share]
        path = /home/share
        browseable = yes
        writeable = yes
EOF


* Prepare directories

root@ubuntu:~# mkdir -p /home/share/test
root@ubuntu:~# chown -R ubuntu:ubuntu /home/share


* Restart services

root@ubuntu:~# service nmbd restart; service smbd restart


* Add “ubuntu” user to samba

smbpasswd -a ubuntu


* Explore “\\srvtest\share” on a windows machine (tested with windows 7) => “test” is a directory


* Run the following command to make thing buggy

root@ubuntu:~# for letter in {a..z}; do head -c 5000 /dev/urandom > /home/share/${letter}.exe; done


* Refresh the Explorer window => “test” is an unknown file


* Delete all “.exe” files

root@ubuntu:~# rm -f /home/share/*.exe


* Refresh the explorer => “test” is an unknown file


* Delete all “.scanned” files

root@ubuntu:~# rm -f /home/share/.scanned*


* Refresh the explorer => “test” is a directory

Regards.

[1] https://lists.samba.org/archive/samba/2015-October/195035.html
Comment 1 EOLE Team 2015-11-09 11:02:20 UTC
Created attachment 11589 [details]
Debug level10 of wrong display of “test” directory

This log file capture was started before the refresh where the “test” directory is displayed as “unknown file”.