Date: Thu, 3 Oct 2002 11:16:55 -0400 (EDT) From: Robert Watson <rwatson@FreeBSD.org> To: Brian Feldman <green@FreeBSD.org> Cc: Perforce Change Reviews <perforce@FreeBSD.org> Subject: Re: PERFORCE change 18586 for review Message-ID: <Pine.NEB.3.96L.1021003111543.54053I-100000@fledge.watson.org> In-Reply-To: <200210031416.g93EG83T059821@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1021003111543.54053I-100000>