Symbolic link

heinz at cc.univie.ac.at heinz at cc.univie.ac.at
Fri May 24 20:49:37 AEST 1991


In <16213 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:

>In article <9105200532.AA27396 at csufres.CSUFresno.EDU> quang at CSUFRES.CSUFRESNO.EDU (Quang Ngo) writes:
>>If someone were to make a symbolic link to my account (if I accidentally
>>left it opened), then how do I know?  How would I remove it?

[Stuff deleted]

>thorough job of that you'd need superuser privileges.  You can remove any
>entry from any directory for which you have write permission, using the
>"rm" utility.

The question, as I understand it, was how to remove the symbolic link, motivated
by the following:

One of the major problems with hard links is that if you create a hard link to
another user's file and the owner removes the 'file' (he really removes his
directory entry for the file, which is in fact another hard link itself - the
directory entry, not the file), the file still exists and the user now
may be accounted for a file he doesn't know of any longer (if the
deletion of the file on disk is accompanied by a deletion of the file in
the user's memory :-). This is why the use of hard links should be highly
discouraged, although they can be detected via the link count.

With symbolic links, this problem does not exist, since
a symbolic link only contains the path name of the file (to be exact: it
contains the path name of a hard link to the file), and if this hard link
(= directory entry) is deleted, the symbolic link becomes a dangling pointer and
cannot be used any longer.

So there's no need to find and remove any symbolic links to your directory.
Simply remove the files you want to remove, and the link to them won't be
of use any longer.

I hope this answers your question.

Greetings,
HH
--
--------------------------------------------------------------------------------
---/     Heinz M. Herbeck                    /    Trust me, I know    /       /-
--/     heinz at sophie.pri.univie.ac.at       /    what I'm doing !    /       /--
-/     Vienna University, Austria          /    (Sledge Hammer)     /       /---
--------------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list