Date: Wed, 16 May 2007 11:30:49 +0200 From: Alexander Leidinger <Alexander@Leidinger.net> To: Dag-Erling =?utf-8?b?U23Dg8K4cmdyYXY=?= <des@des.no> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src Makefile.inc1 Message-ID: <20070516113049.gx56iwpisc8ks08g@webmail.leidinger.net> In-Reply-To: <86mz052nbz.fsf@dwp.des.no> References: <200705131815.l4DIFop9026874@repoman.freebsd.org> <20070514154040.0lofzrgm8kskgog4@webmail.leidinger.net> <86wszbqxbz.fsf@dwp.des.no> <20070514172938.5v4yi78kisokk84s@webmail.leidinger.net> <861whiy5ra.fsf@dwp.des.no> <20070516094330.dkp2e41vdc0w8kg8@webmail.leidinger.net> <86mz052nbz.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Dag-Erling Smørgrav <des@des.no> (from Wed, 16 May 2007
10:18:40 +0200):
> Alexander Leidinger <Alexander@Leidinger.net> writes:
>> What about another idea: removing the chflags all together and let the
>> removal fail (with a message that the file may be protected with schg
>> and it should be removed with chglags). This way only a message
>> appears when the rm fails (saying no to the removal question of rm is
>> not a failure/exit!=0).
>
> OK with me.
>
> BTW, testing for the schg flag is not straightforward, but doable:
>
> flags=$(stat -f '%f' ./$${file})
> if [ $((flags & 131072)) -eq 131072 ] ; then
> # schg is set
> fi
This does not cover the case when the user doesn't want to remove the
file. So I think removing the chflags is better than testing for the
flag.
Bye,
Alexander.
--
Anyone can hold the helm when the sea is calm.
-- Publilius Syrus
http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070516113049.gx56iwpisc8ks08g>
