Can not delete files on CIFS Share

Status
Not open for further replies.

Tom7320

Explorer
Joined
Aug 7, 2013
Messages
52
Hello!

I have a very strange problem with a cifs share which is being used by Windows and Linux users alike. The problem is, that I cannot delete certain files from Linux that are created by a windows machine even though the permissions are just fine an the CIFS credentials are the same on ether machine:

Code:
ts@vm-ubuntuserver:~$ uname -a
Linux vm-ubuntuserver 3.2.0-70-generic #105-Ubuntu SMP Wed Sep 24 19:49:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ts@vm-ubuntuserver:~$ cat /etc/fstab
[...]
//192.168.0.10/Backup /media/backup cifs noauto,user,credentials=/home/ts/.smbcred 0 0
ts@vm-ubuntuserver:~$ mount /media/backup
ts@vm-ubuntuserver:~$ mount
[...]
//192.168.0.10/Backup on /media/backup type cifs (rw,nosuid,nodev,user=ts)
ts@vm-ubuntuserver:~$ ls -l /media/backup/Thumbs.db
-rw-rw-rw- 1 ts ts 11776 Okt 19 15:16 /media/backup/Thumbs.db
ts@vm-ubuntuserver:~$ rm /media/backup/Thumbs.db
^C


There is no error message on the Linux side. rm has to be interrupted by pressing CTRL-C.

On the FreeNAS side there are lots of these messages:

Code:
Oct 19 15:20:50 freenas kernel: pid 44563 (smbd), uid 65534: exited on signal 11


I really need to solve this problem since it prevents some maintenance scripts to work properly on my network! Thus help would be much appreciated!

Regards,

Thorsten

PS: This is my smb4.conf file:

Code:
[global]
    server max protocol = SMB3
    encrypt passwords = yes
    dns proxy = no
    strict locking = no
    oplocks = yes
    deadtime = 15
    max log size = 51200
    max open files = 11070
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes
    getwd cache = yes
    guest account = nobody
    map to guest = Bad User
    obey pam restrictions = Yes
    directory name cache size = 0
    kernel change notify = no
    panic action = /usr/local/libexec/samba/samba-backtrace
    ea support = yes
    store dos attributes = yes
    hostname lookups = yes
    time server = yes
    acl allow execute always = true
    local master = yes
    idmap config *:backend = tdb
    idmap config *:range = 90000000-100000000
    server role = standalone
    netbios name = FREENAS-CIFS
    workgroup = WORKGROUP
    security = user
    pid directory = /var/run/samba
    smb passwd file = /var/etc/private/smbpasswd
    private dir = /var/etc/private
    create mask = 0666
    directory mask = 0777
    client ntlmv2 auth = yes
    dos charset = CP437
    unix charset = UTF-8
    log level = 1
    #force create mode = 0777
    #force directory mode = 0777
    #force security mode = 0777
    #force directory security mode = 0777
   
[Backup]
    path = /mnt/vol1/Backup
    printable = no
    veto files = /.snap/.windows/.zfs/
    comment = Backup files
    writeable = yes
    browseable = yes
    recycle:repository = .recycle/%U
    recycle:keeptree = yes
    recycle:versions = yes
    recycle:touch = yes
    recycle:directory_mode = 0777
    recycle:subdir_mode = 0700
    vfs objects = zfsacl streams_xattr aio_pthread
    hide dot files = yes
    guest ok = no
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = yes
    zfsacl:acesort = dontcare
    valid users = ts
    
 
Last edited:

Tom7320

Explorer
Joined
Aug 7, 2013
Messages
52
Code:
[root@freenas] ~# zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
vol1  7.25T  3.53T  3.72T    48%  1.00x  ONLINE  /mnt
[root@freenas] ~# getfacl /mnt/vol1/Backup/
# file: /mnt/vol1/Backup/
# owner: root
# group: wheel
            owner@:rwxp--aARWcCos:------:allow
            group@:rwxp--a-R-c--s:------:allow
         everyone@:rwxp--a-R-c--s:------:allow
[root@freenas] ~# getfacl /mnt/vol1/Backup/billroth.de/
# file: /mnt/vol1/Backup/billroth.de/
# owner: ts
# group: wheel
            owner@:rwxp--aARWcCos:------:allow
            group@:rwxp--a-R-c--s:------:allow
         everyone@:r-x---a-R-c--s:------:allow
[root@freenas] ~#
 

Tom7320

Explorer
Joined
Aug 7, 2013
Messages
52
Code:
[root@freenas] ~# ls -l /mnt/vol1/Backup/
total 1407
drwxrwxrwx  19 root  wheel      26 Oct 19 18:06 ./
drwxrwxrwx  19 root  wheel      19 Mar  4  2014 ../
drwxrwxrwx   3 ts    wheel       3 Jun  6 08:42 .TemporaryItems/
-rw-rw-rw-   1 ts    wheel     292 Jun  6 08:42 .apdisk
drwxrwxrwx  11 ts    wheel      11 Feb 17  2013 Apfel_old/
drwxrwxrwx  33 ts    wheel      33 Jan  2  2011 Bart/
drwxrwxrwx  29 ts    wheel      35 Jul 29  2006 Bart_old/
drwxrwxrwx   3 ts    wheel       3 Oct 20 19:00 BigServer/
drwxrwxrwx   2 ts    wheel      10 Aug 20  2008 Debian/
drwxrwxrwx   6 ts    wheel       6 Jul 18  2006 Debian_Current/
drwxrwxrwx   4 ts    wheel       5 Jul  4 14:29 Garmin GPSmap 62s/
drwxrwxrwx   2 ts    wheel       8 Feb 13  2014 Google/
drwxrwxrwx  12 ts    wheel      12 Feb 17  2013 HELIOS/
drwxrwxrwx   3 ts    wheel       6 Oct 19 15:24 O??_Kilian/
drwxrwxrwx   2 ts    wheel       2 Mar  2  2014 PaW/
drwxrwxrwx  30 ts    wheel      42 Jan  2  2011 Pluto/
drwxrwxrwx  22 ts    wheel      26 Jan  2  2011 Sphinx/
-rw-rw-rw-   1 ts    wheel   11776 Oct 19 15:16 Thumbs.db
drwxrwxr-x   7 ts    wheel       9 Oct 19 14:03 billroth.de/
-rw-rw-rw-   1 ts    wheel   55356 Jun 14 18:46 putty-sessions.reg
drwxrwxrwx   2 ts    wheel      12 May  1  2012 seven/
drwxrwxrwx  14 ts    wheel      14 May  1  2012 seven_old/
-rwxrwxrwx   1 ts    wheel  368416 Jan 20  2014 snapshot.exe*
-rw-rw-rw-   1 ts    wheel  130575 Aug 23  2007 ts.jpg
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Can the file in question be successfully deleted from a Windows workstation?
Is FreeNAS in a VM? If not, post your FreeNAS server's hardware specs.
Post any error messages from /var/log/samba4/log.smbd
Post output of 'getfacl' for the Thumbs.db file that you tried to delete.
 

Tom7320

Explorer
Joined
Aug 7, 2013
Messages
52
  1. Yes the file can be successfully deleted from Windows.
  2. No. No VM. It's a HP Microserver N54L
  3. The only thing that happens in the log when I try to delete the file Thumbs.db is
    Code:
    [2014/10/20 19:52:29.732224,  1] ../source3/smbd/server.c:438(remove_child_pid)
      Scheduled cleanup of brl and lock database after unclean shutdown
    
  4. Code:
    [root@freenas] ~# getfacl /mnt/vol1/Backup/Thumbs.db
    # file: /mnt/vol1/Backup/Thumbs.db
    # owner: ts
    # group: wheel
                owner@:rw-p--aARWcCos:------:allow
                group@:rw-p--a-R-c--s:------:allow
             everyone@:rw-p--a-R-c--s:------:allow
    
HTH!!!

Regards,

Thorsten
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
My best guess is that you can't delete because you don't have the 'delete' permission for user 'ts' on Thumbs.db (or any files in your share).

A possible solution:
1) Create an admin group (using 'wheel' is bad form because you are granting elevated permissions where you may not want them).
2) Recursively set permissions of your "backup" dataset to ts:admin. ACL type = "windows"
3) Click on your share config and check the box "set default permission" then click ok. It may take some time for winacl to finish fixing your permissions.
4) Once (3) is done in Windows explorer, navigate to \\hostname or ip-address and right-click on "Backup" (or whatever your share is named). Then go to "properties" and click on the "security" tab. Assign "full control" to the "Admin" group and "TS" (if it is not already assigned). Apply the changes.

In your case, the setting "valid users" masked the fact that your permissions were somewhat borken.
 
Last edited:

Tom7320

Explorer
Joined
Aug 7, 2013
Messages
52
Tried to fix permission issues the whole weekend. But unfortunately it did not work... :( Windows clients create the file Thumbs.db on network shares with pictures in it. This file still can not be deleted from mounted cifs shares on Linux. When I try to delete Thumbs.db samba on FreeNAS still crashes with the "freenas kernel: pid 44563 (smbd), uid 65534: exited on signal 11" error message.

One thing I noticed is that when I look in the "security" settings of the share it looks like this:

sec.PNG


The "inknown user" is supposed to be the root user on FreeNAS I assume?! Is this normal behaviour?

I kind of fixed the problem now by using NFS Shares for Linux and CIFS Shares for Windows.

Regards,

Thorsten
 
Status
Not open for further replies.
Top