Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2001 14:10:41 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Bakul Shah <bakul@bitblocks.com>
Cc:        Bruce Evans <bde@zeta.org.au>, Joshua Goodall <joshua@roughtrade.net>, freebsd-fs@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: flags on symlinks
Message-ID:  <3B5B4151.C435FF05@mindspring.com>
References:  <200107222003.QAA21807@wellington.cnchost.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bakul Shah wrote:
> > Flags are associated with inodes, and symlinks do not have
> > inodes in the common case, as they exist solely in the
> > directory entry, unless they are too long.
> 
> $ mkdir foo; cd foo; date > x; ln -s x y; ls -lai
> total 3
> 261248 drwxr-xr-x  2 bakul  bakul  512 Jul 22 12:58 .
> 261211 drwxr-xr-x  3 bakul  bakul  512 Jul 22 12:58 ..
> 261283 -rw-r--r--  1 bakul  bakul   29 Jul 22 12:58 x
> 261296 lrwxr-xr-x  1 bakul  bakul    1 Jul 22 12:58 y -> x
> $ cd ..; rm -rf foo
> 
> > Pretty clearly, there should _NOT_ be a seperate system call;
> 
> There needs to be.

Why?

If the chflags call was defined to always affect its
target (and not follow links), then the user space utility
could do the stat/readlink itself, and find the correct
target, if it wasn't told to not follow links.

This is not like "open", where it is an interface everyone
knows, loves, and uses.

This is an issue for the user space utility; pretty clearly,
he wants to apply it to the link itself.

In fact, "man chflags", and look at the "-L" argument... I
could make a good argument that it should operate on the
link itself, if given a "-l" (currently unused) argument.

Pushing the link following semantics into the kernel, instead
of the C library, was a mistake in the first place; it precludes
easy implementation of things like variant symbolic links,which
are easily handled in a user space library routine that wraps
the actual system call.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B5B4151.C435FF05>