From owner-freebsd-hackers Sun Jul 22 14:10:22 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id C0EBC37B405; Sun, 22 Jul 2001 14:10:16 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.247.136.127.Dial1.SanJose1.Level3.net [209.247.136.127]) by albatross.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id OAA11771; Sun, 22 Jul 2001 14:10:04 -0700 (PDT) Message-ID: <3B5B4151.C435FF05@mindspring.com> Date: Sun, 22 Jul 2001 14:10:41 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bakul Shah Cc: Bruce Evans , Joshua Goodall , freebsd-fs@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: flags on symlinks References: <200107222003.QAA21807@wellington.cnchost.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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