I have an heterogeneous share, between Linux and Windows systems, hosted on a NetApp. On Linux, I mount the share with those options:
mount.cifs -o username=`logname`,dom=DOMAIN,cifsacl,multiuser,user_xattr,sec=krb5,iocharset=utf8,noserverino,mapchars //host/share /home/`logname`/mnt
All permissions (set from Windows) are correctly honored. However, there is a strange behavior:
If a user opens a file he created on Windows (or a copy of it) with vim or vi, the file is opened in readonly mode. If he modifies and writes it with :w!, the file gets locked, and cannot be read anymore, even by an administrator or root (permission denied). It can only be deleted by one of those. Gedit opens such files the same way: read only.
However, when such a file is opened with nano, it is precised [converted from DOS format], and when saved, it is flagged [dos format]. The file gets written, and no problem occurs at all.
Do you have any idea why it behaves like that ?
EDIT: I already tried to disable backups and swap files in /etc/vimrc with those options :
set nobackup
set nowritebackup
set noswapfile
Also tried :w! ++ff=dos and :w! ++ff=unix, without success.