From a Freenas CIFS share I have a problem that I can't delete read-only files even if the parent directory is 777. This causes a problem with git: it creates temporary object files that are read only, and even though the parent is 775, it cant remove these temporary files.
user@comp1$ touch d
user@comp1$ chmod -w d
user@comp1$ rm -rf d
rm: cannot remove âdâ: Permission denied
-ALSO-
user@comp1$ git clone <some repo>
....
warning: unable to unlink /media/freenas/files/tmp_pack_Mk8Tdd: Permission denied
....
user@comp1$ rm -rf tmp_pack_Mk8Tdd
rm: cannot remove âtmp_pack_Mk8Tddâ: Permission denied
-ALSO-
user@comp1$ lsattr tmp_pack_Mk8Tdd
lsattr: Operation not supported While reading flags on ./tmp_pack_Mk8Tdd
However, from a local drive or non-freenas cifs share. I can create files, change the permissions to -w, delete these files fine, clone and delete files without these errors.
user@comp1$ touch d
user@comp1$ chmod -w d
user@comp1$ rm -rf d
rm: cannot remove âdâ: Permission denied
-ALSO-
user@comp1$ git clone <some repo>
....
warning: unable to unlink /media/freenas/files/tmp_pack_Mk8Tdd: Permission denied
....
user@comp1$ rm -rf tmp_pack_Mk8Tdd
rm: cannot remove âtmp_pack_Mk8Tddâ: Permission denied
-ALSO-
user@comp1$ lsattr tmp_pack_Mk8Tdd
lsattr: Operation not supported While reading flags on ./tmp_pack_Mk8Tdd
However, from a local drive or non-freenas cifs share. I can create files, change the permissions to -w, delete these files fine, clone and delete files without these errors.
- In each case parent directory is set 777
- In each case file is is set 444
- If I set +w to the file I can delete it
- umask: 0002
- ssh into the freenas box I can delete fine, this seems to be cifs specific
- user on freenas and client both have the same username and uid/gid
- Settings:
- 'Apply Default Permissions' selected
- Both client/server, same username with uid=1000
- mount options in fstab (also tried autofs mount from cli): -fstype=cifs,credentials=/root/.smbcredentials,rw,uid=1000,gid=1000,iocharset=utf8,exec\\
- note the 'â' characters. I have iocharset=utf8,
- Tried:
- resetting permissions to 775 via the gui
- changing mount options
- in windows and linux clients (with git too)