]> err.no Git - util-linux/commit
namei: fix logic and infinite loop of symlinks
authorKarel Zak <kzak@redhat.com>
Wed, 31 Jan 2007 15:43:18 +0000 (16:43 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 31 Jan 2007 15:43:18 +0000 (16:43 +0100)
commitd8ef4c19ab6ebe29b1deb5d5445cba6d76192a4f
treeaf69ddf9d666eaafb36bd99b5787a7c8b5fb4e6e
parente9ce5ccc90c63cb1c499ad01800e638ece23f8b0
namei: fix logic and infinite loop of symlinks

Don't follow the path if a component is not directory.  It doesn't make sense
to support something like:

$ touch a b
$ namei a/b  <-- where "a" is not directory

The support for infinite loop of symbolic links is a strange wish only. The
stack size is very limited. Try:

$ ln -s x
$ namei x/x

[Migration note: severity="low"]

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/namei.1
misc-utils/namei.c