From owner-p4-projects Thu Oct 3 8:17:28 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F28C737B404; Thu, 3 Oct 2002 08:17:25 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5A0337B401; Thu, 3 Oct 2002 08:17:24 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F25E43E6E; Thu, 3 Oct 2002 08:17:23 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g93FGtOo060503; Thu, 3 Oct 2002 11:16:55 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Thu, 3 Oct 2002 11:16:55 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Brian Feldman Cc: Perforce Change Reviews Subject: Re: PERFORCE change 18586 for review In-Reply-To: <200210031416.g93EG83T059821@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I think a preferred solution for this would be the one adopted by chmod and all other file attribute setting tools in the system: operate on the symlink target unless '-h' is explicitly passed by the caller. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories On Thu, 3 Oct 2002, Brian Feldman wrote: > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18586 > > Change 18586 by green@green_laptop_2 on 2002/10/03 07:15:58 > > Don't uselessly follow symlinks in the extattr utilities. > > Affected files ... > > .. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.8#2 edit > .. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#3 edit > > Differences ... > > ==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.8#2 (text+ko) ==== > > @@ -77,6 +77,9 @@ > the name of the target file or directory, > .Ar attrvalue > a string to store in the attribute. > +Since it is not useful to operate on the target of a symbolic link, the given > +.Ar filename > +is not followed if it is one. > .Pp > The following options are available: > .Bl -tag -width flag > > ==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#3 (text+ko) ==== > > @@ -178,25 +178,25 @@ > for (arg_counter = 0; arg_counter < argc; arg_counter++) { > switch (what) { > case EARM: > - error = extattr_delete_file(argv[arg_counter], > + error = extattr_delete_link(argv[arg_counter], > attrnamespace, attrname); > if (error >= 0) > continue; > break; > case EASET: > - error = extattr_set_file(argv[arg_counter], > + error = extattr_set_link(argv[arg_counter], > attrnamespace, attrname, buf, strlen(buf)); > if (error >= 0) > continue; > break; > case EALS: > case EAGET: > - error = extattr_get_file(argv[arg_counter], > + error = extattr_get_link(argv[arg_counter], > attrnamespace, attrname, NULL, 0); > if (error < 0) > break; > mkbuf(&buf, &buflen, error); > - error = extattr_get_file(argv[arg_counter], > + error = extattr_get_link(argv[arg_counter], > attrnamespace, attrname, buf, buflen); > if (error < 0) > break; > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message