Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jun 2009 15:50:03 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/111226: commit references a PR
Message-ID:  <200906211550.n5LFo3jH085854@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/111226; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/111226: commit references a PR
Date: Sun, 21 Jun 2009 15:40:54 +0000 (UTC)

 Author: jilles
 Date: Sun Jun 21 15:40:39 2009
 New Revision: 194588
 URL: http://svn.freebsd.org/changeset/base/194588
 
 Log:
   MFC r193087: rm, find -delete: fix removing symlinks with uchg/uappnd set
   
   Formerly, this tried to clear the flags on the symlink's target
   instead of the symlink itself.
   
   As before, this only happens for root or for the unlink(1) variant of rm.
   
   PR:		bin/111226 (part of)
   Submitted by:	Martin Kammerhofer
   Approved by:	ed (mentor) (implicit)
 
 Modified:
   stable/7/bin/rm/   (props changed)
   stable/7/bin/rm/rm.c
   stable/7/usr.bin/find/   (props changed)
   stable/7/usr.bin/find/function.c
 
 Modified: stable/7/bin/rm/rm.c
 ==============================================================================
 --- stable/7/bin/rm/rm.c	Sun Jun 21 15:36:10 2009	(r194587)
 +++ stable/7/bin/rm/rm.c	Sun Jun 21 15:40:39 2009	(r194588)
 @@ -231,7 +231,7 @@ rm_tree(char **argv)
  			else if (!uid &&
  				 (p->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
  				 !(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
 -				 chflags(p->fts_accpath,
 +				 lchflags(p->fts_accpath,
  					 p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)) < 0)
  				goto err;
  			continue;
 @@ -250,7 +250,7 @@ rm_tree(char **argv)
  		if (!uid &&
  		    (p->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
  		    !(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)))
 -			rval = chflags(p->fts_accpath,
 +			rval = lchflags(p->fts_accpath,
  				       p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE));
  		if (rval == 0) {
  			/*
 @@ -350,7 +350,7 @@ rm_file(char **argv)
  		if (!uid && !S_ISWHT(sb.st_mode) &&
  		    (sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
  		    !(sb.st_flags & (SF_APPEND|SF_IMMUTABLE)))
 -			rval = chflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));
 +			rval = lchflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));
  		if (rval == 0) {
  			if (S_ISWHT(sb.st_mode))
  				rval = undelete(f);
 
 Modified: stable/7/usr.bin/find/function.c
 ==============================================================================
 --- stable/7/usr.bin/find/function.c	Sun Jun 21 15:36:10 2009	(r194587)
 +++ stable/7/usr.bin/find/function.c	Sun Jun 21 15:40:39 2009	(r194588)
 @@ -443,7 +443,7 @@ f_delete(PLAN *plan __unused, FTSENT *en
  	if ((entry->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
  	    !(entry->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
  	    geteuid() == 0)
 -		chflags(entry->fts_accpath,
 +		lchflags(entry->fts_accpath,
  		       entry->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE));
  
  	/* rmdir directories, unlink everything else */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 



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