From owner-freebsd-current@freebsd.org Mon Jun 29 19:24:03 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CC6335326F for ; Mon, 29 Jun 2020 19:24:03 +0000 (UTC) (envelope-from freebsd@grem.de) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (Client CN "mail.evolve.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49wcqQ4RJbz4HNT; Mon, 29 Jun 2020 19:24:02 +0000 (UTC) (envelope-from freebsd@grem.de) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id 4cd180ce; Mon, 29 Jun 2020 19:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=grem.de; h=content-type :content-transfer-encoding:mime-version:subject:from:in-reply-to :date:cc:message-id:references:to; s=20180501; bh=rT0JHeGoCfFWt5 FbLT+hMOKhkI8=; b=Uts+zn0SecC1GuOLSF4GOHylVAeRv8yHlFZvLVG6pnGehL 8F4vidF7K0kLmZRphPcFkJWe+IYXlUsoRjtg6OXJLFwjx73ZOEyuLdjnBfMOXQuS YFyd3az6Ed8fwCkdxhC7ORwyREH6fxbEPbYxVs4U4M2JSOkQZEy4lDxgEMZVLUbp 33ey76vUncxPwXz4HVqVP9tCtifBzioibTG39LoOtfute6X9Lc/lQx/6pW5b2v2M kSUsT5s5tvyJyXYy+OorNgED5REME8no6TlGxLsimAFbXY5JEGWTWgcA6shksoZ6 KWzOBQLoDPA1GlgWMhfzK00NRkXy91NX0Fqc3guw== DomainKey-Signature: a=rsa-sha1; c=nofws; d=grem.de; h=content-type :content-transfer-encoding:mime-version:subject:from:in-reply-to :date:cc:message-id:references:to; q=dns; s=20180501; b=awoJ9n9y mBdgi+RgrqfKdlWTadWq/KYjqA0pqLLj1VRVccDUe5IIF4BKV5Ukkw3bFt+8gaEE wxnoKtXT5eQfosJsqqJYVE6Ngu0OO6FJMjE3A59A52f5AfMHKxwcanw1aCpd0nXj W1uMgQSMFQ348vpYQ3Ot0HmwdXGUcLmZR1K+bNFrRqAifH/5H1z4EjMjlEdJ7dIg HI6CT4/QViIk6Z0AavR+av8hZB2Tqmt6wqbLM+GdhatsxMz2flEOLiOe3PhZMEMe NcbI3CvyjU05C3l5wGqtbl3K2fnWV6Ydjq7oDR+WXPPuyUf5hYRC0yPIRFOsD6g2 DS2M0t3HtrN4Fw== Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 5a0f8963 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Mon, 29 Jun 2020 19:23:50 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Re: Undeletable files after kyua test runs From: Michael Gmelin In-Reply-To: <934817c6a90cecc186bf06d3eec1ccba50dd834a.camel@freebsd.org> Date: Mon, 29 Jun 2020 21:23:48 +0200 Cc: Gordon Bergling , "Rodney W. Grimes" , Kevin Oberman , FreeBSD Current , david@catwhisker.org Message-Id: References: <934817c6a90cecc186bf06d3eec1ccba50dd834a.camel@freebsd.org> To: Ian Lepore X-Mailer: iPhone Mail (17F80) X-Rspamd-Queue-Id: 49wcqQ4RJbz4HNT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2020 19:24:03 -0000 > On 29. Jun 2020, at 21:18, Ian Lepore wrote: >=20 > =EF=BB=BFOn Mon, 2020-06-29 at 21:08 +0200, Gordon Bergling wrote: >> On Mon, Jun 29, 2020 at 11:58:47AM -0700, Rodney W. Grimes wrote: >>>> On Mon, Jun 29, 2020 at 10:32:38AM -0700, Kevin Oberman wrote: >>>>> On Mon, Jun 29, 2020 at 10:26 AM Gordon Bergling < >>>>> gbe@freebsd.org> wrote: >>>>>> I recently stumbled across undeletable files that are >>>>>> generated by kyua >>>>>> test runs, >>>>>> for example >>>>>>=20 >>>>>> -rwxr-xr-x 1 root wheel 0 May 9 13:10 >>>>>> /tmp/kyua.aB4q62/8676/work/fileforaudit >>>>>>=20 >>>>>> I haven't yet identified the test that generate those files, >>>>>> but it is >>>>>> impossible >>>>>> to delete them. I have clear_tmp_enable=3D"YES" set in the >>>>>> /etc/rc.conf, but >>>>>> on every boot the system argues that these file aren't >>>>>> deletable. >>>>>> I tried to 'rm -rf' them by hand but, even this wasn't >>>>>> possible. I have >>>>>> looked for >>>>>> any extend attributes, but I didn't find any. >>>>>>=20 >>>>>> Has anyone an idea how this is possible and may how these >>>>>> files can be >>>>>> deleted? >>>>>=20 >>>>> Have you done 'ls -o' to check for flags like schg? >>>>> -- >>>>> Kevin Oberman, Part time kid herder and retired Network >>>>> Engineer >>>>> E-mail: rkoberman@gmail.com >>>>> PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 >>>>=20 >>>> Argh, I haven't thought about chflags for quite some time. The >>>> chflags >>>> bit was set and after an >>>>=20 >>>> # find /tmp/ -type f -exec chflags -R 0 {} \; >>>=20 >>> ^^Only files ^^ meaningless when chflags is >>> given ONLY files >>>=20 >>> You probably could of done: >>> chflags -R 0 /tmp/ >>=20 >> Okay, I am currently working on an update for clear_tmp_enable=3D"YES" >> to include >> a check like this. I would think that an rc option like this should >> delete=20 >> everything in /tmp. >>=20 >=20 > I disagree. One of the few things those immutable flags are good for > is protecting files from things like an rc script or other automation > that deletes files. Those flags are typically set and maintained by > users and admins, and automation should not change them in order to > delete files. >=20 > The real fix we need is for the kyua tests to properly clean up after > themselves, including fixing the flags on temporary files created or > used by the tests, and then deleting them. >=20 +1, having a routine script remove schg automatically IMHO defeats the purpo= se of setting this flag. Cheers, Michael