lkml.org 
[lkml]   [1997]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: PATCH against 2.1.72: better symlinks for a better future (was Re: security warning)
From
Date
mlord <mlord@pobox.com> writes:
>
> What happens when the symlink has a trailing slash in its name,
> as opposed to me entering one on the command line?
>
>
> eg. ln -s foo/ foo-symlink
> instead of ln -s foo foo-symlink
>
> This happens a *lot*.

The first argument to a "symlink" system call is handled through a
different mechanism, so both:

ln -s foo/ slash
ln -s foo noslash

will work irrespective of the proposed changes. On an ext2
filesystem, they create slightly different symlinks:

total 0
lrwxrwxrwx 1 buhr buhr 3 Dec 17 12:58 noslash -> foo
lrwxrwxrwx 1 buhr buhr 4 Dec 17 12:58 slash -> foo/

However, in practice, this doesn't make a difference. Whether "foo"
is a regular file, a directory, or another symlink (dangling or not),
"noslash" and "slash" appear to behave the same in all cases (except,
of course, if you use an explicit "readlink" call).

Kevin <buhr@stat.wisc.edu>

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.112 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site