unable to rm a soft link on a cifs mounted file system

Issues related to applications and software problems
Post Reply
warrendodge
Posts: 9
Joined: 2016/01/03 19:55:51

unable to rm a soft link on a cifs mounted file system

Post by warrendodge » 2017/10/10 02:03:36

I have a LinkSys 1900ac wireless router which has an external drive installed. There is no external network connection. It is a node on my internal network to provide wireless and access to the drive.

It provides a CIFS interface to the drive.

On my centos7 system I have used this fstab line to provide a filesystem interface so I can execute perl scripts on the shared files.

//linksys1900ac/SeagateBackupPlusDrive /SeagateBackupPlusDrive cifs netdev,username=myuser,password=xxxx-,auto,dir_mode=0755,file_mode=0755,uid=11966,gid=1004 0 0

In general I have had no problem with sharing files via this method. I can also use the CIFS interface on the centos system to see the files.

The problem I am having is when soft links are used in this file system. Programs like emacs use soft links to create a lock file.
They are created properly on linux. The problem is that I can not delete them.

The softlinks being used all point into the same file system as where the link is. In emacs they point to a non-existant file for the lock
Here is some example text of the problem.

cd /SeagateBackupPlusDrive
mkdir test
cd test
touch file
ln -s file file_soft_link
ll
total 1024
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 .
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 ..
-rw-rw-rw-. 1 warrend adg 0 Oct 9 19:02 file
lr-xr-xr-x. 1 warrend adg 18 Nov 2 2012 file_soft_link -> file

rm file_soft_link
rm: cannot remove ‘file_soft_link’: Permission denied
mv file_soft_link zzz
ll
total 1024
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 .
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 ..
-rw-rw-rw-. 1 warrend adg 0 Oct 9 18:52 file
lr-xr-xr-x. 1 warrend adg 18 Nov 2 2012 zzz -> file

rm zzz
rm: cannot remove ‘zzz’: Permission denied
rm file
ll
total 1024
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 .
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 ..
lr-xr-xr-x. 1 warrend adg 18 Nov 2 2012 zzz -> file

rm zzz
rm: cannot remove ‘zzz’: No such file or directory

rm -f zzz
NO ERRORS
ll
total 1024
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 .
drwxrwxr-x. 1 warrend adg 0 Nov 2 2012 ..
lr-xr-xr-x. 1 warrend adg 18 Nov 2 2012 zzz -> file

The only way I have found to remove these files is to enable the ftp operation of the linksys 1900ac
Then cd to where the links are at and use the ftp command to remove them.


I am not sure where the problem is at. Any help will be appreciated.

Warren

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: unable to rm a soft link on a cifs mounted file system

Post by mghe » 2017/10/10 05:54:59

Correct way to remove soft link use: unlink

warrendodge
Posts: 9
Joined: 2016/01/03 19:55:51

Re: unable to rm a soft link on a cifs mounted file system

Post by warrendodge » 2017/10/10 16:18:13

unlink file_soft_link
unlink: cannot unlink ‘file_soft_link’: Permission denied

Seems that is not the issue here.

Post Reply