From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 09:22:59 2011 Received: (at submit) by debbugs.gnu.org; 2 Mar 2011 14:23:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pumx9-0001HT-At for submit@debbugs.gnu.org; Wed, 02 Mar 2011 09:22:59 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pum6M-0008Vz-36 for submit@debbugs.gnu.org; Wed, 02 Mar 2011 08:28:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pum6G-0001ta-5J for submit@debbugs.gnu.org; Wed, 02 Mar 2011 08:28:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_DKIM_INVALID,T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:55145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pum6F-0001tW-VP for submit@debbugs.gnu.org; Wed, 02 Mar 2011 08:28:20 -0500 Received: from [140.186.70.92] (port=51589 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pum6E-00087X-PG for bug-coreutils@gnu.org; Wed, 02 Mar 2011 08:28:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pum6D-0001sS-Fy for bug-coreutils@gnu.org; Wed, 02 Mar 2011 08:28:18 -0500 Received: from nm24-vm1.bullet.mail.sp2.yahoo.com ([98.139.91.227]:36842) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pum6D-0001rn-1m for bug-coreutils@gnu.org; Wed, 02 Mar 2011 08:28:17 -0500 Received: from [98.139.91.64] by nm24.bullet.mail.sp2.yahoo.com with NNFMP; 02 Mar 2011 13:28:15 -0000 Received: from [98.139.91.32] by tm4.bullet.mail.sp2.yahoo.com with NNFMP; 02 Mar 2011 13:28:15 -0000 Received: from [127.0.0.1] by omp1032.mail.sp2.yahoo.com with NNFMP; 02 Mar 2011 13:28:15 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 703730.57238.bm@omp1032.mail.sp2.yahoo.com Received: (qmail 22079 invoked by uid 60001); 2 Mar 2011 13:28:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1299072495; bh=C3Akcttdhy/ezhacij0nbIJhpat9mQovNX7xOiXalIk=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=Q+kKZpBYwnE4J31lvQ9soQg9zjWb6ulTY73ZqA5jNe+4ua/Iw6GRfeAMK7Y7z4WX2PJlfEKl4ibKRzVmgkMjz3ieMQ4AoMo3ui6Fe+whOnB8jeIrIQNx484wQxBZUbf5oHR/QTrx6QHhcWSRQnb2TLVhuU1Y/yVgXpFcjIEb6n4= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=ZdxRlTqiljtAXEU/GaJQ7am/QrIFsUFvH9R12QI8jUn17dq9Qjw0apLZUYCOkowMXevSJXv8IHtHFo6u7ohriEiz94JQ3M/tMVEJ2jmm0naugLxlqu8b08P1fAKja+OLXcnfWcQEBYchV0gv33Q7cdTQKmOg+4B2hjFg4tnXsmQ=; Message-ID: <315025.21765.qm@web110208.mail.gq1.yahoo.com> X-YMail-OSG: _ZQHNKAVM1mo7YXEzUAUVCCHF1oGnC0zg0h10snq8QkDkMR H_gzkd01R2V7RBAw6evKfqUIpaYwUh9oqmEkO_llyUWEodsf67Nw51V_3QYw 7Ozi4.NOta.K3YBynaWmOyMtl_RNdyJo.EtE3AYztU_Du6o5EpniH89BSxdK 9bIIkZ47k9GnZhDCP02pn2SIPLIpIYrNFDZApAjt9kolIdpMrjuGW8w2GQfg zgMq78.avTKBpP9yE1UCmmde4GvKIvA4ZR2Yzkl172hGmPZJ.D69ZBVE2GXm HEno_wf9IasGNf1OGQ_yPveixw0_rS1LaBVItjilkczyW3gR9_8oklLxwt2I ailfxeMfTZGDq8Ukm1tkkxgniPVkng9sfzANIYygDV7j8gsbhBsbGs9TGOU4 u8WV07UECzew- Received: from [92.81.54.92] by web110208.mail.gq1.yahoo.com via HTTP; Wed, 02 Mar 2011 05:28:14 PST X-Mailer: YahooMailWebService/0.8.109.292656 Date: Wed, 2 Mar 2011 05:28:14 -0800 (PST) From: Stefan Vargyas Subject: du: issue with `--files0-from=DIR' To: bug-coreutils@gnu.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1995329564-1299072494=:21765" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 02 Mar 2011 09:22:57 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --0-1995329564-1299072494=:21765 Content-Type: text/plain; charset=us-ascii Dear maintainers, While building and running coreutils v8.9, I came across the following issue of 'du': $ mkdir /tmp/foo $ du --files0-from=/tmp/foo du: `/tmp/foo': read error: Is a directory ... The program enters an infinite loop -- continuously printing on stderr the error message shown above. Although such usage pattern of 'du' is erroneous, it better not behave this way. Looking into 'du.c', I found that the unending loop is caused by a misconceived 'continue' statement placed after a call to 'error' (the one labeled by 'case AI_ERR_READ'). A plausible fixing patch is immediate: see it enclosed. Sincerely, Stefan Vargyas. --0-1995329564-1299072494=:21765 Content-Type: text/plain; name="bug-report-du-files0-from-dir.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bug-report-du-files0-from-dir.patch" LS0tIGNvcmV1dGlscy04Ljkvc3JjL2R1LmMJMjAxMS0wMS0wMSAyMzoxOToy My4wMDAwMDAwMDAgKzAyMDAKKysrIGNvcmV1dGlscy04Ljktc3Rldi9zcmMv ZHUuYwkyMDExLTAzLTAyIDAzOjMyOjA0LjAwMDAwMDAwMCArMDIwMApAQCAt OTI2LDggKzkyNiwxMCBAQAogICAgICAgICAgIHN3aXRjaCAoYWlfZXJyKQog ICAgICAgICAgICAgewogICAgICAgICAgICAgY2FzZSBBSV9FUlJfUkVBRDoK LSAgICAgICAgICAgICAgZXJyb3IgKDAsIGVycm5vLCBfKCIlczogcmVhZCBl cnJvciIpLCBxdW90ZSAoZmlsZXNfZnJvbSkpOwotICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgZXJyb3IgKEVYSVRfRkFJTFVSRSwg ZXJybm8sIF8oIiVzOiByZWFkIGVycm9yIiksCisgICAgICAgICAgICAgICAg ICAgICBxdW90ZSAoZmlsZXNfZnJvbSkpOworICAgICAgICAgICAgICBvayA9 IGZhbHNlOworICAgICAgICAgICAgICBnb3RvIG91dF9hcmd2X2l0ZXI7CiAK ICAgICAgICAgICAgIGNhc2UgQUlfRVJSX01FTToKICAgICAgICAgICAgICAg eGFsbG9jX2RpZSAoKTsKQEAgLTk3OCw2ICs5ODAsNyBAQAogICAgICAgICAg IG9rICY9IGR1X2ZpbGVzICh0ZW1wX2FyZ3YsIGJpdF9mbGFncyk7CiAgICAg ICAgIH0KICAgICB9CisgIG91dF9hcmd2X2l0ZXI6CiAKICAgYXJndl9pdGVy X2ZyZWUgKGFpKTsKICAgZGlfc2V0X2ZyZWUgKGRpX3NldCk7Cg== --0-1995329564-1299072494=:21765-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 09:46:31 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 14:46:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunJu-0001nz-Jg for submit@debbugs.gnu.org; Wed, 02 Mar 2011 09:46:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunJs-0001nl-LF for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 09:46:30 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p22EkMdZ020118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Mar 2011 09:46:22 -0500 Received: from [10.3.113.122] (ovpn-113-122.phx2.redhat.com [10.3.113.122]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p22EkL6e017329; Wed, 2 Mar 2011 09:46:22 -0500 Message-ID: <4D6E583D.9020709@redhat.com> Date: Wed, 02 Mar 2011 07:46:21 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: Stefan Vargyas Subject: Re: bug#8154: du: issue with `--files0-from=DIR' References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> In-Reply-To: <315025.21765.qm@web110208.mail.gq1.yahoo.com> X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig33FE2F89AF1D7ED2DED55463" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig33FE2F89AF1D7ED2DED55463 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [adding bug-gnulib] On 03/02/2011 06:28 AM, Stefan Vargyas wrote: > Dear maintainers, >=20 > While building and running coreutils v8.9, I came across the following = issue of 'du': >=20 > $ mkdir /tmp/foo > $ du --files0-from=3D/tmp/foo > du: `/tmp/foo': read error: Is a directory > ... >=20 > The program enters an infinite loop Thanks for the report. This is indeed a bug. I wonder if the better fix would be to modify the gnulib argv-iter module to make argv_iter_init_stream to fail if fileno(fp) is a directory, since not all platforms reliably fail with EISDIR when doing read() on a directory (some, like BSD, successfully return EOF, and some older systems even read raw directory contents). --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig33FE2F89AF1D7ED2DED55463 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNblg9AAoJEKeha0olJ0Nq3woH/jKgmFMZM9mjKBjoYUpDWPN/ //dYGG9GXjSuK3px5/zqn3JwNOkP44L+6OVbh1KXgZjsgPbUMFI+5MUCLEVSHLZW 8EttNBMLJ6Ju2xAId06WCeDnBDb78jTM47s0BECCQyvJFhrIn9pvAsjnlJDlQYgN E/t/b0kQqy7acMskgjzyqevGqfpcmjPTuKnhTXaNAbbClgy0uAwbEYy6KA7098FL xRHl06CUdHd2GFEfXAQlWQgtKb6Qdzc+cAfTo3HBjpIxUQWlgMcWwIpqdvBI+yOz EA5L2sVS/g9KS4jxtCHVo2a+B4dwHhTuYciUbbzIMf2h0xp5ASQcJryabFKCIxg= =x5DM -----END PGP SIGNATURE----- --------------enig33FE2F89AF1D7ED2DED55463-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 10:09:12 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 15:09:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Punfr-0002Nn-Ts for submit@debbugs.gnu.org; Wed, 02 Mar 2011 10:09:12 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Punfq-0002Nc-KG for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 10:09:11 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 0B36C600A2; Wed, 2 Mar 2011 16:09:05 +0100 (CET) From: Jim Meyering To: Eric Blake Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <4D6E583D.9020709@redhat.com> (Eric Blake's message of "Wed, 02 Mar 2011 07:46:21 -0700") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> Date: Wed, 02 Mar 2011 16:09:04 +0100 Message-ID: <871v2peezz.fsf@rho.meyering.net> Lines: 82 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Stefan Vargyas , bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Eric Blake wrote: > [adding bug-gnulib] > > On 03/02/2011 06:28 AM, Stefan Vargyas wrote: >> Dear maintainers, >> >> While building and running coreutils v8.9, I came across the >> following issue of 'du': >> >> $ mkdir /tmp/foo >> $ du --files0-from=/tmp/foo >> du: `/tmp/foo': read error: Is a directory >> ... >> >> The program enters an infinite loop Thanks! That affects the latest (coreutils-8.10), too. > Thanks for the report. This is indeed a bug. > > I wonder if the better fix would be to modify the gnulib argv-iter > module to make argv_iter_init_stream to fail if fileno(fp) is a > directory, since not all platforms reliably fail with EISDIR when doing > read() on a directory (some, like BSD, successfully return EOF, and some > older systems even read raw directory contents). That's just what I've done. Here's a tentative patch, both for du.c and argv-iter.c in gnulib. A probably-identical change to the du.c part will be required for wc.c. I'll add tests and update NEWS, too. diff --git a/src/du.c b/src/du.c index 671cac7..e205cd5 100644 --- a/src/du.c +++ b/src/du.c @@ -889,6 +889,8 @@ main (int argc, char **argv) quote (files_from)); ai = argv_iter_init_stream (stdin); + if (ai == NULL && errno == EISDIR) + error (EXIT_FAILURE, errno, _("invalid file: %s"), quote (files_from)); /* It's not easy here to count the arguments, so assume the worst. */ diff --git a/lib/argv-iter.c b/lib/argv-iter.c index 340e588..f0445f1 100644 --- a/lib/argv-iter.c +++ b/lib/argv-iter.c @@ -21,6 +21,8 @@ #include #include +#include +#include struct argv_iterator { @@ -49,11 +51,21 @@ argv_iter_init_argv (char **argv) } /* Initialize to read from the stream, FP. - The input is expected to contain a list of NUL-delimited tokens. */ + The input is expected to contain a list of NUL-delimited tokens. + If FP refers to a directory, set errno to EISDIR and return NULL. */ struct argv_iterator * argv_iter_init_stream (FILE *fp) { - struct argv_iterator *ai = malloc (sizeof *ai); + struct argv_iterator *ai; + struct stat st; + + if (fstat (fileno (fp), &st) == 0 && S_ISDIR (st.st_mode)) + { + errno = EISDIR; + return NULL; + } + + ai = malloc (sizeof *ai); if (!ai) return NULL; ai->fp = fp; From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 10:16:53 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 15:16:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunnJ-0002Yg-F0 for submit@debbugs.gnu.org; Wed, 02 Mar 2011 10:16:53 -0500 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PunnH-0002YU-D4 for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 10:16:52 -0500 Received: (qmail 32890 invoked from network); 2 Mar 2011 15:16:44 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 2 Mar 2011 15:16:44 -0000 Message-ID: <4D6E5F3A.50507@draigBrady.com> Date: Wed, 02 Mar 2011 15:16:10 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Stefan Vargyas Subject: Re: bug#8154: du: issue with `--files0-from=DIR' References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> In-Reply-To: <315025.21765.qm@web110208.mail.gq1.yahoo.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 02/03/11 13:28, Stefan Vargyas wrote: > Dear maintainers, > > While building and running coreutils v8.9, I came across the following issue of 'du': > > $ mkdir /tmp/foo > $ du --files0-from=/tmp/foo > du: `/tmp/foo': read error: Is a directory > ... > > The program enters an infinite loop -- continuously printing on stderr the error message shown above. Oh, clang pointed out a very similar issue with wc: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=0eaa993a We'll amend your patch as per above I think? Unfortunately du didn't do anything that clang noticed as suspicious, but I should have grepped for AI_ERR_READ to show that wc and du are the only utils to check it. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 10:24:12 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 15:24:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunuN-0002jI-Ri for submit@debbugs.gnu.org; Wed, 02 Mar 2011 10:24:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunuK-0002j2-1P for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 10:24:09 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p22FO2qi003701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Mar 2011 10:24:02 -0500 Received: from [10.3.113.122] (ovpn-113-122.phx2.redhat.com [10.3.113.122]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p22FO1rP002876; Wed, 2 Mar 2011 10:24:01 -0500 Message-ID: <4D6E6111.4010101@redhat.com> Date: Wed, 02 Mar 2011 08:24:01 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#8154: du: issue with `--files0-from=DIR' References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> In-Reply-To: <871v2peezz.fsf@rho.meyering.net> X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigB72D8FD357FE42362CDD03D8" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Stefan Vargyas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB72D8FD357FE42362CDD03D8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/02/2011 08:09 AM, Jim Meyering wrote: >> I wonder if the better fix would be to modify the gnulib argv-iter >> module to make argv_iter_init_stream to fail if fileno(fp) is a >> directory, since not all platforms reliably fail with EISDIR when doin= g >> read() on a directory (some, like BSD, successfully return EOF, and so= me >> older systems even read raw directory contents). >=20 > That's just what I've done. > Here's a tentative patch, both for du.c and argv-iter.c in gnulib. > A probably-identical change to the du.c part will be required for wc.c.= > I'll add tests and update NEWS, too. Yes, that looks nicer for directories. Still, I can't help wonder if the same infloop would happen if we encounter EIO or other (rare) error while reading a non-directory, in which case a variant of Stefan's patch is also needed (even though with Jim's patch, it won't trip for the original case of directories that sparked this thread). > +++ coreutils-8.9-stev/src/du.c 2011-03-02 03:32:04.000000000 +0200 > @@ -926,8 +926,10 @@ > switch (ai_err) > { > case AI_ERR_READ: > - error (0, errno, _("%s: read error"), quote (files_from)= ); > - continue; > + error (EXIT_FAILURE, errno, _("%s: read error"), > + quote (files_from)); > + ok =3D false; This line would never be reached - once you call error() with a non-zero first argument, it calls exit(). The question is whether it is ever worth trying to continue after a read error on the files-from argument, or whether bailing out like this is the only sane approach. Or maybe we still need the error(0) to issue the warning and affect final exit status, while making sure we break out of the loop rather than continue to retry a read that will likely fail again, so that we at least print the summary of all files successfully read prior to the read error on the files-from argument. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigB72D8FD357FE42362CDD03D8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNbmERAAoJEKeha0olJ0NqFXoH/RndGxub4Trvtz/mSCQbukAd JHO37LH8/pBv8DBFkCJoyQJNIGKXrG8P/bukQh4GjajexqW+0aa/2/J7l+DVCMjV wbodWbzM/6Apx8/wr9mwHIv5V7b5IbpPVKNRxx/NgaGXX+4FMsZuraV2FEAJWpi7 xMKjpxAK/gwTUC4IB1UoSOxGrR79fsWNWK8arU6dXvFyWOyfhTEHT9r19bwz3FuX piP+LX7obHTB5HiEhZz+Prl6+wiziikQTXpTMAv6hW9ZF5rFSsoLqLgNYJ+TIBgu Hyeh9o8UKTAiuahhsB1COSitPnz1B+009mvScZEKax0/O662kbwsWGx8qoWAj5g= =78aW -----END PGP SIGNATURE----- --------------enigB72D8FD357FE42362CDD03D8-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 10:26:11 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 15:26:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunwJ-0002m1-As for submit@debbugs.gnu.org; Wed, 02 Mar 2011 10:26:11 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PunwH-0002lo-Dg for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 10:26:10 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 24B1B600A2; Wed, 2 Mar 2011 16:26:03 +0100 (CET) From: Jim Meyering To: Stefan Vargyas Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <315025.21765.qm@web110208.mail.gq1.yahoo.com> (Stefan Vargyas's message of "Wed, 2 Mar 2011 05:28:14 -0800 (PST)") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> Date: Wed, 02 Mar 2011 16:26:03 +0100 Message-ID: <87vd01czn8.fsf@rho.meyering.net> Lines: 99 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Stefan Vargyas wrote: > Dear maintainers, > > While building and running coreutils v8.9, I came across the following > issue of 'du': > > $ mkdir /tmp/foo > $ du --files0-from=/tmp/foo > du: `/tmp/foo': read error: Is a directory > ... > > The program enters an infinite loop -- continuously printing on stderr > the error message shown above. Although such usage pattern of 'du' is > erroneous, it better not behave this way. Looking into 'du.c', I found > that the unending loop is caused by a misconceived 'continue' > statement placed after a call to 'error' (the one labeled by 'case > AI_ERR_READ'). A plausible fixing patch is immediate: see it enclosed. > > Sincerely, > > Stefan Vargyas. > > > > > --- coreutils-8.9/src/du.c 2011-01-01 23:19:23.000000000 +0200 > +++ coreutils-8.9-stev/src/du.c 2011-03-02 03:32:04.000000000 +0200 > @@ -926,8 +926,10 @@ > switch (ai_err) > { > case AI_ERR_READ: > - error (0, errno, _("%s: read error"), quote (files_from)); > - continue; > + error (EXIT_FAILURE, errno, _("%s: read error"), > + quote (files_from)); > + ok = false; > + goto out_argv_iter; > > case AI_ERR_MEM: > xalloc_die (); > @@ -978,6 +980,7 @@ > ok &= du_files (temp_argv, bit_flags); > } > } > + out_argv_iter: Thanks for the patch. Contrary to what my alternative patch suggested, part of yours is required. The part that exits the loop upon read error. Though note that as you wrote it, the goto was unreachable, since error (EXIT_FAILURE, ... never returns, while error (0, ... merely issues a warning. I've taken the opportunity (of this new label) to move the test for EOF into the case alongside the other AI_ERR_* values: diff --git a/src/du.c b/src/du.c index 671cac7..6270092 100644 --- a/src/du.c +++ b/src/du.c @@ -889,6 +889,8 @@ main (int argc, char **argv) quote (files_from)); ai = argv_iter_init_stream (stdin); + if (ai == NULL && errno == EISDIR) + error (EXIT_FAILURE, errno, _("invalid file: %s"), quote (files_from)); /* It's not easy here to count the arguments, so assume the worst. */ @@ -926,15 +928,17 @@ main (int argc, char **argv) bool skip_file = false; enum argv_iter_err ai_err; char *file_name = argv_iter (ai, &ai_err); - if (ai_err == AI_ERR_EOF) - break; if (!file_name) { switch (ai_err) { + case AI_ERR_EOF: + goto argv_iter_done; + case AI_ERR_READ: error (0, errno, _("%s: read error"), quote (files_from)); - continue; + ok = false; + goto argv_iter_done; case AI_ERR_MEM: xalloc_die (); @@ -985,6 +989,7 @@ main (int argc, char **argv) ok &= du_files (temp_argv, bit_flags); } } + argv_iter_done: argv_iter_free (ai); di_set_free (di_set); From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 12:10:46 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 17:10:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PupZW-00055l-Bk for submit@debbugs.gnu.org; Wed, 02 Mar 2011 12:10:46 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PupZU-00055Z-L9 for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 12:10:45 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id EBB8739E80DF; Wed, 2 Mar 2011 09:10:38 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 55Ir-kY1eOEF; Wed, 2 Mar 2011 09:10:38 -0800 (PST) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6462639E8083; Wed, 2 Mar 2011 09:10:38 -0800 (PST) Message-ID: <4D6E7A08.6060401@cs.ucla.edu> Date: Wed, 02 Mar 2011 09:10:32 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#8154: du: issue with `--files0-from=DIR' References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> In-Reply-To: <871v2peezz.fsf@rho.meyering.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, bug-gnulib , Stefan Vargyas , Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) On 03/02/2011 07:09 AM, Jim Meyering wrote: > - struct argv_iterator *ai = malloc (sizeof *ai); > + struct argv_iterator *ai; > + struct stat st; > + > + if (fstat (fileno (fp),&st) == 0&& S_ISDIR (st.st_mode)) > + { > + errno = EISDIR; > + return NULL; > + } > + > + ai = malloc (sizeof *ai); My kneejerk reaction is that this part of the patch should not be needed (though other fixes obviously are). There are lots of reasons that the stream could fail: why check for directories specially? Just let the stream fail in the way that it normally would; this keeps the code smaller and simpler. On an ancient host where "cat dir/" works, "du --files0-from=dir/" should not arbitrarily fail. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 12:12:18 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 17:12:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pupb0-000586-JC for submit@debbugs.gnu.org; Wed, 02 Mar 2011 12:12:18 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pupay-00057t-3a for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 12:12:17 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 05560600A2; Wed, 2 Mar 2011 18:12:09 +0100 (CET) From: Jim Meyering To: Eric Blake Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <4D6E6111.4010101@redhat.com> (Eric Blake's message of "Wed, 02 Mar 2011 08:24:01 -0700") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E6111.4010101@redhat.com> Date: Wed, 02 Mar 2011 18:12:09 +0100 Message-ID: <87k4ghcuqe.fsf@rho.meyering.net> Lines: 107 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Stefan Vargyas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Eric Blake wrote: > On 03/02/2011 08:09 AM, Jim Meyering wrote: >>> I wonder if the better fix would be to modify the gnulib argv-iter >>> module to make argv_iter_init_stream to fail if fileno(fp) is a >>> directory, since not all platforms reliably fail with EISDIR when doing >>> read() on a directory (some, like BSD, successfully return EOF, and some >>> older systems even read raw directory contents). >> >> That's just what I've done. >> Here's a tentative patch, both for du.c and argv-iter.c in gnulib. >> A probably-identical change to the du.c part will be required for wc.c. >> I'll add tests and update NEWS, too. > > Yes, that looks nicer for directories. Still, I can't help wonder if > the same infloop would happen if we encounter EIO or other (rare) error > while reading a non-directory, in which case a variant of Stefan's patch > is also needed (even though with Jim's patch, it won't trip for the > original case of directories that sparked this thread). As you noticed, I thought the same thing and adjusted my patch, which I now see I sent two minutes after you posted this. >> +++ coreutils-8.9-stev/src/du.c 2011-03-02 03:32:04.000000000 +0200 >> @@ -926,8 +926,10 @@ >> switch (ai_err) >> { >> case AI_ERR_READ: >> - error (0, errno, _("%s: read error"), quote (files_from)); >> - continue; >> + error (EXIT_FAILURE, errno, _("%s: read error"), >> + quote (files_from)); >> + ok = false; > > This line would never be reached - once you call error() with a non-zero > first argument, it calls exit(). The question is whether it is ever > worth trying to continue after a read error on the files-from argument, > or whether bailing out like this is the only sane approach. Or maybe we > still need the error(0) to issue the warning and affect final exit > status, while making sure we break out of the loop rather than continue > to retry a read that will likely fail again, so that we at least print > the summary of all files successfully read prior to the read error on > the files-from argument. Unifying argv_iter* handling between du.c and wc.c led me to find another bug just now: A failed ai = argv_iter_init_* would leave ai set to NULL, yet there was no check for that in wc.c before the dereference via argv_iter (ai, ... Here's the full wc.c patch, so far, but I'm about to commit that bug-fix (the 2nd hunk, below) separately: diff --git a/src/wc.c b/src/wc.c index 3afd4de..0a5bfa9 100644 --- a/src/wc.c +++ b/src/wc.c @@ -699,6 +699,9 @@ main (int argc, char **argv) files = NULL; nfiles = 0; ai = argv_iter_init_stream (stream); + if (ai == NULL && errno == EISDIR) + error (EXIT_FAILURE, errno, _("invalid file: %s"), + quote (files_from)); } } else @@ -709,6 +712,9 @@ main (int argc, char **argv) ai = argv_iter_init_argv (files); } + if (!ai) + xalloc_die (); + fstatus = get_input_fstatus (nfiles, files); number_width = compute_number_width (nfiles, fstatus); @@ -719,16 +725,16 @@ main (int argc, char **argv) bool skip_file = false; enum argv_iter_err ai_err; char *file_name = argv_iter (ai, &ai_err); - if (ai_err == AI_ERR_EOF) - break; if (!file_name) { switch (ai_err) { + case AI_ERR_EOF: + goto argv_iter_done; case AI_ERR_READ: - error (EXIT_FAILURE, errno, _("%s: read error"), - quote (files_from)); - continue; + error (0, errno, _("%s: read error"), quote (files_from)); + ok = false; + goto argv_iter_done; case AI_ERR_MEM: xalloc_die (); default: @@ -770,6 +776,7 @@ main (int argc, char **argv) else ok &= wc_file (file_name, &fstatus[nfiles ? i : 0]); } + argv_iter_done: /* No arguments on the command line is fine. That means read from stdin. However, no arguments on the --files0-from input stream is an error From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 12:25:21 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 17:25:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pupnd-0005Rj-0J for submit@debbugs.gnu.org; Wed, 02 Mar 2011 12:25:21 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pupnb-0005RT-4b for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 12:25:20 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 76BE6600AC; Wed, 2 Mar 2011 18:25:13 +0100 (CET) From: Jim Meyering To: Paul Eggert Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <4D6E7A08.6060401@cs.ucla.edu> (Paul Eggert's message of "Wed, 02 Mar 2011 09:10:32 -0800") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> Date: Wed, 02 Mar 2011 18:25:13 +0100 Message-ID: <87ei6pcu4m.fsf@rho.meyering.net> Lines: 32 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, bug-gnulib , Stefan Vargyas , Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Paul Eggert wrote: > On 03/02/2011 07:09 AM, Jim Meyering wrote: >> - struct argv_iterator *ai = malloc (sizeof *ai); >> + struct argv_iterator *ai; >> + struct stat st; >> + >> + if (fstat (fileno (fp),&st) == 0&& S_ISDIR (st.st_mode)) >> + { >> + errno = EISDIR; >> + return NULL; >> + } >> + >> + ai = malloc (sizeof *ai); > > My kneejerk reaction is that this part of the patch > should not be needed (though other fixes obviously are). > There are lots of reasons that the stream could fail: > why check for directories specially? Just let the > stream fail in the way that it normally would; this > keeps the code smaller and simpler. On an ancient > host where "cat dir/" works, "du --files0-from=dir/" > should not arbitrarily fail. I think you're right. The added complexity (both here and in each client) is not worth the theoretical gain in error-handling uniformity. If new tests induce false-positive failure due to differences in how reading from a directory works under the covers, we can deal with it in the tests. Thanks! From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 12:33:31 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 17:33:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PupvW-0006QI-O0 for submit@debbugs.gnu.org; Wed, 02 Mar 2011 12:33:30 -0500 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PupvU-0006Q5-Gm for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 12:33:29 -0500 Received: (qmail 61991 invoked from network); 2 Mar 2011 17:33:22 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 2 Mar 2011 17:33:22 -0000 Message-ID: <4D6E7F3F.1060808@draigBrady.com> Date: Wed, 02 Mar 2011 17:32:47 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#8154: du: issue with `--files0-from=DIR' References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> In-Reply-To: <4D6E7A08.6060401@cs.ucla.edu> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Eric Blake , Stefan Vargyas , bug-gnulib , Jim Meyering X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 02/03/11 17:10, Paul Eggert wrote: > On 03/02/2011 07:09 AM, Jim Meyering wrote: >> - struct argv_iterator *ai = malloc (sizeof *ai); >> + struct argv_iterator *ai; >> + struct stat st; >> + >> + if (fstat (fileno (fp),&st) == 0&& S_ISDIR (st.st_mode)) >> + { >> + errno = EISDIR; >> + return NULL; >> + } >> + >> + ai = malloc (sizeof *ai); > > My kneejerk reaction is that this part of the patch > should not be needed (though other fixes obviously are). > There are lots of reasons that the stream could fail: > why check for directories specially? Just let the > stream fail in the way that it normally would; this > keeps the code smaller and simpler. On an ancient > host where "cat dir/" works, "du --files0-from=dir/" > should not arbitrarily fail. I thought that at first too, but it seems like it might cause more issues that not, by allowing it? Testing bsd here shows that valid NUL terminated file names are returned, but also there is other info interspersed. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 12:35:30 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 17:35:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PupxS-0006T7-07 for submit@debbugs.gnu.org; Wed, 02 Mar 2011 12:35:30 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PupxQ-0006Su-1x for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 12:35:28 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 66A9D600AC; Wed, 2 Mar 2011 18:35:22 +0100 (CET) From: Jim Meyering To: =?iso-8859-1?Q?P=E1draig?= Brady Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <4D6E7F3F.1060808@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?= =?iso-8859-1?Q?g?= Brady"'s message of "Wed, 02 Mar 2011 17:32:47 +0000") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> <4D6E7F3F.1060808@draigBrady.com> Date: Wed, 02 Mar 2011 18:35:22 +0100 Message-ID: <878vwxctnp.fsf@rho.meyering.net> Lines: 30 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Eric Blake , Stefan Vargyas , Paul Eggert , bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) P=E1draig Brady wrote: > On 02/03/11 17:10, Paul Eggert wrote: >> On 03/02/2011 07:09 AM, Jim Meyering wrote: >>> - struct argv_iterator *ai =3D malloc (sizeof *ai); >>> + struct argv_iterator *ai; >>> + struct stat st; >>> + >>> + if (fstat (fileno (fp),&st) =3D=3D 0&& S_ISDIR (st.st_mode)) >>> + { >>> + errno =3D EISDIR; >>> + return NULL; >>> + } >>> + >>> + ai =3D malloc (sizeof *ai); >> >> My kneejerk reaction is that this part of the patch >> should not be needed (though other fixes obviously are). >> There are lots of reasons that the stream could fail: >> why check for directories specially? Just let the >> stream fail in the way that it normally would; this >> keeps the code smaller and simpler. On an ancient >> host where "cat dir/" works, "du --files0-from=3Ddir/" >> should not arbitrarily fail. > > I thought that at first too, but it seems like > it might cause more issues that not, by allowing it? > Testing bsd here shows that valid NUL terminated file names > are returned, but also there is other info interspersed. I'm planning to skip the new tests when "cat some-dir" succeeds. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 12:46:25 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 17:46:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Puq81-0006jq-8Z for submit@debbugs.gnu.org; Wed, 02 Mar 2011 12:46:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Puq7y-0006jc-9W for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 12:46:23 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p22HkFLM019982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Mar 2011 12:46:15 -0500 Received: from [10.3.113.122] (ovpn-113-122.phx2.redhat.com [10.3.113.122]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p22HkEHR019716; Wed, 2 Mar 2011 12:46:14 -0500 Message-ID: <4D6E8266.6040704@redhat.com> Date: Wed, 02 Mar 2011 10:46:14 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#8154: du: issue with `--files0-from=DIR' References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> In-Reply-To: <4D6E7A08.6060401@cs.ucla.edu> X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigBBFCBD6323AF7C3137041E92" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Stefan Vargyas , bug-gnulib , Jim Meyering X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBBFCBD6323AF7C3137041E92 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 03/02/2011 10:10 AM, Paul Eggert wrote: > On 03/02/2011 07:09 AM, Jim Meyering wrote: >> - struct argv_iterator *ai =3D malloc (sizeof *ai); >> + struct argv_iterator *ai; >> + struct stat st; >> + >> + if (fstat (fileno (fp),&st) =3D=3D 0&& S_ISDIR (st.st_mode)) >> + { >> + errno =3D EISDIR; >> + return NULL; >> + } >> + >> + ai =3D malloc (sizeof *ai); >=20 > My kneejerk reaction is that this part of the patch > should not be needed (though other fixes obviously are). > There are lots of reasons that the stream could fail: > why check for directories specially? Because other GNU apps do so? For example, POSIX requires that input files to m4 must be text files. If you do 'm4 dir/', you are therefore violating POSIX, because dir/ is not a text file. However, I've chosen to make m4 uniformly fail with EISDIR on opening the file, rather than deal with the vaguaries of different platforms (some forbid fopen("dir/"), although that is in itself a POSIX violation; most get past the fopen(), but then it's arbitrary whether the fread() sees EOF, reads garbage, or fails with EISDIR). See: http://lists.gnu.org/archive/html/m4-patches/2008-09/msg00004.html http://git.savannah.gnu.org/cgit/m4.git/commit?id=3Deed62f0d > Just let the > stream fail in the way that it normally would; this > keeps the code smaller and simpler. On an ancient > host where "cat dir/" works, "du --files0-from=3Ddir/" > should not arbitrarily fail. Yes, the code would be simpler by letting the directory do what it normally does (be that nothing, error, or raw data), but in the case of raw data, acting on that garbage is likely to lead to a host of other error messages. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigBBFCBD6323AF7C3137041E92 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNboJmAAoJEKeha0olJ0NqO68H/3xjQitJxhXbDNtJBnZEFluW 5+2uHQ1afnycQ2+foa7j9zS2qG11eaSWZNOSl3vu9AQ9/UOUizws2RqAnXxVQiU+ KGWMVvFlLctvfcR7iBJrbBUQVI+h3a3vokaCFvp8754olVBobWfaISpAovy8yXUD VsFs+LDwYhu9aBmbtgguhwegDRTm2FzostQCYaCsNw6qeYcoNtNMoKitjcQXrWpL 3wb5hCbEXbvD4RSKIOc67aktc3tTvvmGh8zIF/A+ke60ech5AeFbPnvzBU5yHJ+p il0FZ/DRhqT/Gw50eMhCCBx9mtGu25ZhgXGJUR+dJ121TBcfwvo+j4b2+YlUWiU= =6B1B -----END PGP SIGNATURE----- --------------enigBBFCBD6323AF7C3137041E92-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 13:32:42 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 18:32:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Puqqo-00007q-8c for submit@debbugs.gnu.org; Wed, 02 Mar 2011 13:32:42 -0500 Received: from nm21-vm1.bullet.mail.ne1.yahoo.com ([98.138.91.46]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Puqql-00007e-Se for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 13:32:40 -0500 Received: from [98.138.90.57] by nm21.bullet.mail.ne1.yahoo.com with NNFMP; 02 Mar 2011 18:32:34 -0000 Received: from [98.138.87.7] by tm10.bullet.mail.ne1.yahoo.com with NNFMP; 02 Mar 2011 18:32:34 -0000 Received: from [127.0.0.1] by omp1007.mail.ne1.yahoo.com with NNFMP; 02 Mar 2011 18:32:34 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 471065.14424.bm@omp1007.mail.ne1.yahoo.com Received: (qmail 67342 invoked by uid 60001); 2 Mar 2011 18:32:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1299090753; bh=KcHw+5L38fXLcRoUGI9U0DyHMhXsx82E77y7oTuQGlo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=iCYgCaS/eaGRU/Adi/A9aKWScqmpa1QcGNgVPJa9VxS0oFg2atEZgdyW0Uf20WOtRzfWNxqKCRfWZcb7zyEskzihV2v+maS3FCnIqLhVh1sd0cJwcX0LQu8pf6YJFQZ7FbsDOkIa+5/VLSb3Goy8qUZ3zRe3TwAaqVvuiAI67fs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=3QzqUyV4bmFJcq+fPMPDT/97i1wqEJnx4Y6qS8DG/yi+pIXHgtuItRJQpK/IglpUV2TotmYfr4w8nDviDAceJF4lKpl/rEuBjf5aRLrsLWlS8F7OypDWTSAJxDFwnGMaSduX3En5jQ2ZqtASrxI8x2gah6sm/MMr6fCv4Xu1xzw=; Message-ID: <655687.66047.qm@web110201.mail.gq1.yahoo.com> X-YMail-OSG: kFVdVWcVM1n3orkPBddQ.ADJWPOOAQVL0KfMGJMM8xZXdpQ bm8ZJZk5pj5JaiB1fZDwWSadRQPAuGmLTrC3Y4Xri7.jNgPRyEUFS4IRlFno naxIx3xJ9OEPeblewM5ZkBmrP.5ojggSGEfGGdQJiL4o4J.2Y3_4Ldd2mPj9 q40nQXXPyXL8S0Rj6Qz8DbTcKnvUYR3Sas.7GuN6LT_rLg8E37YJHpO3vqOV 6xOvN5m.U8zWOe0p10ygTnQ_SNUASECuJx7OxfXI2hDyyXUkY6_r53b2_44C yBEQRynOkqlxo.8LCUnNsCNH75oiawTgz4JAJjW.v8gJFvvwQJJ08FaS4HIM esRPG4tLz7kh7LVP60lnRFYhebQMo.w.J78F.QQsN2LYPWfKd_nzfAYos9CB vLNtZdfvHromVyXpzkPxhqNMXKew- Received: from [92.85.25.155] by web110201.mail.gq1.yahoo.com via HTTP; Wed, 02 Mar 2011 10:32:33 PST X-Mailer: YahooMailWebService/0.8.109.292656 Date: Wed, 2 Mar 2011 10:32:33 -0800 (PST) From: Stefan Vargyas Subject: Re: bug#8154: du: issue with `--files0-from=DIR' To: jim@meyering.net In-Reply-To: <87vd01czn8.fsf@rho.meyering.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Jim, Maybe you would consider appropriate to keep 'wc.c' in sync with 'du.c': with respect to 'argv_iter' processing, both files had similar code patterns. Padraig indirectly suggested this too above in the thread. Stefan. > Date: Wed, 02 Mar 2011 16:26:03 +0100 > From: Jim Meyering > Subject: Re: bug#8154: du: issue with `--files0-from=DIR' > > [...] > > I've taken the opportunity (of this new label) to move the test > for EOF into the case alongside the other AI_ERR_* values: > > diff --git a/src/du.c b/src/du.c > index 671cac7..6270092 100644 > --- a/src/du.c > +++ b/src/du.c > @@ -889,6 +889,8 @@ main (int argc, char **argv) > quote (files_from)); > > ai = argv_iter_init_stream (stdin); > + if (ai == NULL && errno == EISDIR) > + error (EXIT_FAILURE, errno, _("invalid file: %s"), quote > (files_from)); > > /* It's not easy here to count the arguments, so assume the > worst. */ > @@ -926,15 +928,17 @@ main (int argc, char **argv) > bool skip_file = false; > enum argv_iter_err ai_err; > char *file_name = argv_iter (ai, &ai_err); > - if (ai_err == AI_ERR_EOF) > - break; > if (!file_name) > { > switch (ai_err) > { > + case AI_ERR_EOF: > + goto argv_iter_done; > + > case AI_ERR_READ: > error (0, errno, _("%s: read error"), quote (files_from)); > - continue; > + ok = false; > + goto argv_iter_done; > > case AI_ERR_MEM: > xalloc_die (); > @@ -985,6 +989,7 @@ main (int argc, char **argv) > ok &= du_files (temp_argv, bit_flags); > } > } > + argv_iter_done: > > argv_iter_free (ai); > di_set_free (di_set); From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 13:49:39 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 18:49:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pur7D-0000Wd-Ir for submit@debbugs.gnu.org; Wed, 02 Mar 2011 13:49:39 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pur7B-0000WO-7c for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 13:49:37 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 55D26600AC; Wed, 2 Mar 2011 19:49:29 +0100 (CET) From: Jim Meyering To: Stefan Vargyas Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <655687.66047.qm@web110201.mail.gq1.yahoo.com> (Stefan Vargyas's message of "Wed, 2 Mar 2011 10:32:33 -0800 (PST)") References: <655687.66047.qm@web110201.mail.gq1.yahoo.com> Date: Wed, 02 Mar 2011 19:49:29 +0100 Message-ID: <87ipw1bbnq.fsf@rho.meyering.net> Lines: 9 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Stefan Vargyas wrote: > Maybe you would consider appropriate to keep 'wc.c' in sync with 'du.c': > with respect to 'argv_iter' processing, both files had similar code > patterns. Padraig indirectly suggested this too above in the thread. Yes, definitely, thanks. Perhaps you haven't seen later replies? http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8154 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 13:53:26 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 18:53:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PurAr-0000bs-Sy for submit@debbugs.gnu.org; Wed, 02 Mar 2011 13:53:26 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PurAo-0000bg-UC for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 13:53:24 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 734396007B; Wed, 2 Mar 2011 19:53:17 +0100 (CET) From: Jim Meyering To: Paul Eggert Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <87ei6pcu4m.fsf@rho.meyering.net> (Jim Meyering's message of "Wed, 02 Mar 2011 18:25:13 +0100") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> <87ei6pcu4m.fsf@rho.meyering.net> Date: Wed, 02 Mar 2011 19:53:17 +0100 Message-ID: <87fwr5bbhe.fsf@rho.meyering.net> Lines: 270 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Eric Blake , Stefan Vargyas , bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Jim Meyering wrote: > Paul Eggert wrote: >> On 03/02/2011 07:09 AM, Jim Meyering wrote: >>> - struct argv_iterator *ai =3D malloc (sizeof *ai); >>> + struct argv_iterator *ai; >>> + struct stat st; >>> + >>> + if (fstat (fileno (fp),&st) =3D=3D 0&& S_ISDIR (st.st_mode)) >>> + { >>> + errno =3D EISDIR; >>> + return NULL; >>> + } >>> + >>> + ai =3D malloc (sizeof *ai); >> >> My kneejerk reaction is that this part of the patch >> should not be needed (though other fixes obviously are). >> There are lots of reasons that the stream could fail: >> why check for directories specially? Just let the >> stream fail in the way that it normally would; this >> keeps the code smaller and simpler. On an ancient >> host where "cat dir/" works, "du --files0-from=3Ddir/" >> should not arbitrarily fail. > > I think you're right. The added complexity (both here > and in each client) is not worth the theoretical gain > in error-handling uniformity. > > If new tests induce false-positive failure due > to differences in how reading from a directory works > under the covers, we can deal with it in the tests. If we decide it's worthwhile, we can adjust gnulib later. For now, I'm about to fix coreutils with these two patches: >From 59b2f5954fb3828108f1c7b7f5d1e968c0801f08 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 2 Mar 2011 18:54:43 +0100 Subject: [PATCH 1/2] wc: avoid NULL dereference on out-of-memory error * src/wc.c (main): Diagnose failed argv_iter_init_* failure, rather than falling through and dereferencing NULL. * NEWS (Bug fixes): Mention it. --- NEWS | 3 +++ src/wc.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index a367d8d..9993469 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,9 @@ GNU coreutils NEWS -*- o= utline -*- delimiter and an unbounded range like "-f1234567890-". [bug introduced in coreutils-5.3.0] + wc would dereference a NULL pointer upon an early out-of-memory error + [bug introduced in coreutils-7.1] + * Noteworthy changes in release 8.10 (2011-02-04) [stable] diff --git a/src/wc.c b/src/wc.c index 3afd4de..ccf4ccf 100644 --- a/src/wc.c +++ b/src/wc.c @@ -709,6 +709,9 @@ main (int argc, char **argv) ai =3D argv_iter_init_argv (files); } + if (!ai) + xalloc_die (); + fstatus =3D get_input_fstatus (nfiles, files); number_width =3D compute_number_width (nfiles, fstatus); -- 1.7.4.1.21.g4cc62 >From 5764128e3f53474f0ea66a989290819338ebf42d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 2 Mar 2011 19:16:46 +0100 Subject: [PATCH 2/2] du: don't infloop for --files0-from=3DDIR * src/du.c (main): Fail on AI_ERR_READ error, rather than merely diagnosing and continuing. Based on a patch by Stefan Vargyas. Also move the handling of AI_ERR_EOF into the case stmt. Do not report ferror/fclose(stdin) failure when we've already diagnosed e.g., failure to read the DIR, above. * src/wc.c: Handle read failure as with du: do not exit. immediately, but rather go on to print any total and to clean-up. As above, move the handling of AI_ERR_EOF into the case stmt. * tests/du/files0-from-dir: New file, to test both du and wc. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. --- NEWS | 3 +++ THANKS.in | 1 + src/du.c | 15 ++++++++------- src/wc.c | 12 +++++++----- tests/Makefile.am | 1 + tests/du/files0-from-dir | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 12 deletions(-) create mode 100755 tests/du/files0-from-dir diff --git a/NEWS b/NEWS index 9993469..658a89a 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ GNU coreutils NEWS -*- o= utline -*- ** Bug fixes + du would infloop when given --files0-from=3DDIR + [bug introduced in coreutils-7.1] + cut could segfault when invoked with a user-specified output delimiter and an unbounded range like "-f1234567890-". [bug introduced in coreutils-5.3.0] diff --git a/THANKS.in b/THANKS.in index b475eef..fe53c44 100644 --- a/THANKS.in +++ b/THANKS.in @@ -524,6 +524,7 @@ Soeren Sonnenburg sonnenburg@informat= ik.hu-berlin.de Solar Designer solar@owl.openwall.com Stanislav Ievlev inger@altlinux.ru Stavros Passas stabat@ics.forth.gr +Stefan Vargyas stvar@yahoo.com St=E9phane Chazelas Stephane_CHAZELAS@yahoo.fr Stephen Depooter sbdep@myrealbox.com Stephen Eglen eglen@pcg.wustl.edu diff --git a/src/du.c b/src/du.c index 671cac7..67841a3 100644 --- a/src/du.c +++ b/src/du.c @@ -926,19 +926,19 @@ main (int argc, char **argv) bool skip_file =3D false; enum argv_iter_err ai_err; char *file_name =3D argv_iter (ai, &ai_err); - if (ai_err =3D=3D AI_ERR_EOF) - break; if (!file_name) { switch (ai_err) { + case AI_ERR_EOF: + goto argv_iter_done; case AI_ERR_READ: - error (0, errno, _("%s: read error"), quote (files_from)); - continue; - + error (0, errno, _("%s: read error"), + quotearg_colon (files_from)); + ok =3D false; + goto argv_iter_done; case AI_ERR_MEM: xalloc_die (); - default: assert (!"unexpected error code from argv_iter"); } @@ -985,11 +985,12 @@ main (int argc, char **argv) ok &=3D du_files (temp_argv, bit_flags); } } + argv_iter_done: argv_iter_free (ai); di_set_free (di_set); - if (files_from && (ferror (stdin) || fclose (stdin) !=3D 0)) + if (files_from && (ferror (stdin) || fclose (stdin) !=3D 0) && ok) error (EXIT_FAILURE, 0, _("error reading %s"), quote (files_from)); if (print_grand_total) diff --git a/src/wc.c b/src/wc.c index ccf4ccf..0399214 100644 --- a/src/wc.c +++ b/src/wc.c @@ -722,16 +722,17 @@ main (int argc, char **argv) bool skip_file =3D false; enum argv_iter_err ai_err; char *file_name =3D argv_iter (ai, &ai_err); - if (ai_err =3D=3D AI_ERR_EOF) - break; if (!file_name) { switch (ai_err) { + case AI_ERR_EOF: + goto argv_iter_done; case AI_ERR_READ: - error (EXIT_FAILURE, errno, _("%s: read error"), - quote (files_from)); - continue; + error (0, errno, _("%s: read error"), + quotearg_colon (files_from)); + ok =3D false; + goto argv_iter_done; case AI_ERR_MEM: xalloc_die (); default: @@ -773,6 +774,7 @@ main (int argc, char **argv) else ok &=3D wc_file (file_name, &fstatus[nfiles ? i : 0]); } + argv_iter_done: /* No arguments on the command line is fine. That means read from stdin. However, no arguments on the --files0-from input stream is an error diff --git a/tests/Makefile.am b/tests/Makefile.am index 9603441..28eafe8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -370,6 +370,7 @@ TESTS =3D \ du/exclude \ du/fd-leak \ du/files0-from \ + du/files0-from-dir \ du/hard-link \ du/inacc-dest \ du/inacc-dir \ diff --git a/tests/du/files0-from-dir b/tests/du/files0-from-dir new file mode 100755 index 0000000..fc1e184 --- /dev/null +++ b/tests/du/files0-from-dir @@ -0,0 +1,39 @@ +#!/bin/sh +# ensure that du and wc handle --files0-from=3DDIR + +# Copyright (C) 2011 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. "${srcdir=3D.}/init.sh"; path_prepend_ ../src +print_ver_ du wc + +mkdir dir + +# Skip this test if reading from a directory succeeds. +# In that case, using --files0-from=3Ddir would yield garbage, +# interpreting the directory entry as a sequence of +# NUL-separated file names. +cat dir > /dev/null && skip_ "cat dir/ succeeds" + +for prog in du wc; do + $prog --files0-from=3Ddir > /dev/null 2>err && fail=3D1 + printf "$prog: dir:\n" > exp || fail=3D1 + # The diagnostic string is usually "Is a directory" (ENOTDIR), + # but accept a different string or errno value. + sed 's/dir:.*/dir:/' err > k; mv k err + compare err exp || fail=3D1 +done + +Exit $fail -- 1.7.4.1.21.g4cc62 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 14:01:04 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 19:01:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PurIF-0000mE-SM for submit@debbugs.gnu.org; Wed, 02 Mar 2011 14:01:04 -0500 Received: from nm19-vm0.bullet.mail.sp2.yahoo.com ([98.139.91.216]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PurID-0000lk-EV for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 14:01:02 -0500 Received: from [98.139.91.65] by nm19.bullet.mail.sp2.yahoo.com with NNFMP; 02 Mar 2011 19:00:55 -0000 Received: from [98.139.91.25] by tm5.bullet.mail.sp2.yahoo.com with NNFMP; 02 Mar 2011 19:00:55 -0000 Received: from [127.0.0.1] by omp1025.mail.sp2.yahoo.com with NNFMP; 02 Mar 2011 19:00:55 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 474675.96148.bm@omp1025.mail.sp2.yahoo.com Received: (qmail 8093 invoked by uid 60001); 2 Mar 2011 19:00:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1299092454; bh=erpb0AgSC4bMoPHhjYPBFIfAIhMZNTisWQjTulLGlPw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=1dcWls8g0wAQ6E8EMjFsLIzp3BlDM5LH5W1nPBN7xThWPioplVOduS+mDYNLoK5WARu46UtC0EKDGPeix1JAZV9wWLC3RI/Tfp9UZegNrhzLmTqzMOFZ+iZUEcIQGBMMtLoGNadOXW1IqejG+ad/DetLwUeGn8XEHJ3veLB7Xq4= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Vcy/WMCPueBKi6koBQrbPtFZ7w6ENhZd2dHepRWJ4s6OUnQ96gRqs00K3nf4dVKYxQjcHi0eXmhwjO5MCPHnZzCs9tstjrdkYF2tqGQiDQ2G5J9MtZYhMdDmMkQL19V1G4qUV11jF4qavQnZcERiT5AB15U5CZskeYavqGcjBs4=; Message-ID: <679072.7738.qm@web110203.mail.gq1.yahoo.com> X-YMail-OSG: J7x8DiIVM1koQYAPtPIOocX2d7BViZpZBh9NWnOovtAzGsh R5LcMkDDJ0dG7TaRcBKU.kfAZcePYbTCK1ouR6d5SZJq26lJV5DNFvYpLtp_ 1_S5ECWyTuQKs5cvym9bMC0jPuI.3AlNtZfQk2n3MsQhLUDQXDHJcCw9QEHp 9qRgknuKSlJUbxnVcbpCwvzegoCCzHehy0RAhE6tRxb60JQ.YLxlwGwe7IKq fPmFGhVBPiEcn9.2JZekOALGGVr7mtAhI1p2U3uX119E7TRn8sCxpP0NtL4H EAg8nBgsuVNFzz84j36GJxspQb32XKBJjNSybNNeTPRGeI2eQrpKACxvqrXn 3s_yXEtXl5tSV8YDli_jcvlr5G4Pl8gDc9v4KoSErWHFgeKrBXK.nq2zF557 .MmFdjnuS5Cg- Received: from [92.85.25.155] by web110203.mail.gq1.yahoo.com via HTTP; Wed, 02 Mar 2011 11:00:54 PST X-Mailer: YahooMailWebService/0.8.109.292656 Date: Wed, 2 Mar 2011 11:00:54 -0800 (PST) From: Stefan Vargyas Subject: Re: Re: bug#8154: du: issue with `--files0-from=DIR' To: jim@meyering.net In-Reply-To: <87ipw1bbnq.fsf@rho.meyering.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Indeed I wasn't noticing the developments before sending the reply. > Date: Wed, 02 Mar 2011 19:49:29 +0100 > From: Jim Meyering > Subject: Re: bug#8154: du: issue with `--files0-from=DIR' > > [...] > > Yes, definitely, thanks. > Perhaps you haven't seen later replies? > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8154 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 02 14:25:20 2011 Received: (at 8154) by debbugs.gnu.org; 2 Mar 2011 19:25:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Purfk-0001K0-9U for submit@debbugs.gnu.org; Wed, 02 Mar 2011 14:25:20 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Purfh-0001Jm-TV for 8154@debbugs.gnu.org; Wed, 02 Mar 2011 14:25:18 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 44847600A3; Wed, 2 Mar 2011 20:25:12 +0100 (CET) From: Jim Meyering To: Eric Blake Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <4D6E8266.6040704@redhat.com> (Eric Blake's message of "Wed, 02 Mar 2011 10:46:14 -0700") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> <4D6E8266.6040704@redhat.com> Date: Wed, 02 Mar 2011 20:25:12 +0100 Message-ID: <87aahdba07.fsf@rho.meyering.net> Lines: 49 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, Stefan Vargyas , Paul Eggert , bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Eric Blake wrote: > On 03/02/2011 10:10 AM, Paul Eggert wrote: >> On 03/02/2011 07:09 AM, Jim Meyering wrote: >>> - struct argv_iterator *ai = malloc (sizeof *ai); >>> + struct argv_iterator *ai; >>> + struct stat st; >>> + >>> + if (fstat (fileno (fp),&st) == 0&& S_ISDIR (st.st_mode)) >>> + { >>> + errno = EISDIR; >>> + return NULL; >>> + } >>> + >>> + ai = malloc (sizeof *ai); >> >> My kneejerk reaction is that this part of the patch >> should not be needed (though other fixes obviously are). >> There are lots of reasons that the stream could fail: >> why check for directories specially? > > Because other GNU apps do so? For example, POSIX requires that input > files to m4 must be text files. If you do 'm4 dir/', you are therefore That's fine for m4, but the --files0-from argument is a file containing NUL-delimited file names: not a text file. And obviously not covered by POSIX, besides. However, my primary motivation was this: if we special-case directories, should we also special-case char- and block-devices? That seems inappropriate. > violating POSIX, because dir/ is not a text file. However, I've chosen > to make m4 uniformly fail with EISDIR on opening the file, rather than > deal with the vaguaries of different platforms (some forbid > fopen("dir/"), although that is in itself a POSIX violation; most get > past the fopen(), but then it's arbitrary whether the fread() sees EOF, > reads garbage, or fails with EISDIR). See: > http://lists.gnu.org/archive/html/m4-patches/2008-09/msg00004.html > http://git.savannah.gnu.org/cgit/m4.git/commit?id=eed62f0d > >> Just let the >> stream fail in the way that it normally would; this >> keeps the code smaller and simpler. On an ancient >> host where "cat dir/" works, "du --files0-from=dir/" >> should not arbitrarily fail. > > Yes, the code would be simpler by letting the directory do what it > normally does (be that nothing, error, or raw data), but in the case of > raw data, acting on that garbage is likely to lead to a host of other > error messages. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 03 03:11:40 2011 Received: (at 8154) by debbugs.gnu.org; 3 Mar 2011 08:11:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pv3dL-00021Y-Hq for submit@debbugs.gnu.org; Thu, 03 Mar 2011 03:11:40 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pv3dJ-00021K-94 for 8154@debbugs.gnu.org; Thu, 03 Mar 2011 03:11:38 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 89F0D600C7; Thu, 3 Mar 2011 09:11:31 +0100 (CET) From: Jim Meyering To: Paul Eggert Subject: Re: bug#8154: du: issue with `--files0-from=DIR' In-Reply-To: <87fwr5bbhe.fsf@rho.meyering.net> (Jim Meyering's message of "Wed, 02 Mar 2011 19:53:17 +0100") References: <315025.21765.qm@web110208.mail.gq1.yahoo.com> <4D6E583D.9020709@redhat.com> <871v2peezz.fsf@rho.meyering.net> <4D6E7A08.6060401@cs.ucla.edu> <87ei6pcu4m.fsf@rho.meyering.net> <87fwr5bbhe.fsf@rho.meyering.net> Date: Thu, 03 Mar 2011 09:11:31 +0100 Message-ID: <87mxlcaaj0.fsf@rho.meyering.net> Lines: 72 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8154 Cc: 8154@debbugs.gnu.org, bug-gnulib , Stefan Vargyas , Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) Jim Meyering wrote: > Jim Meyering wrote: >> Paul Eggert wrote: >>> On 03/02/2011 07:09 AM, Jim Meyering wrote: >>>> - struct argv_iterator *ai = malloc (sizeof *ai); >>>> + struct argv_iterator *ai; >>>> + struct stat st; >>>> + >>>> + if (fstat (fileno (fp),&st) == 0&& S_ISDIR (st.st_mode)) >>>> + { >>>> + errno = EISDIR; >>>> + return NULL; >>>> + } >>>> + >>>> + ai = malloc (sizeof *ai); >>> >>> My kneejerk reaction is that this part of the patch >>> should not be needed (though other fixes obviously are). >>> There are lots of reasons that the stream could fail: >>> why check for directories specially? Just let the >>> stream fail in the way that it normally would; this >>> keeps the code smaller and simpler. On an ancient >>> host where "cat dir/" works, "du --files0-from=dir/" >>> should not arbitrarily fail. >> >> I think you're right. The added complexity (both here >> and in each client) is not worth the theoretical gain >> in error-handling uniformity. >> >> If new tests induce false-positive failure due >> to differences in how reading from a directory works >> under the covers, we can deal with it in the tests. > > If we decide it's worthwhile, we can adjust gnulib later. > For now, I'm about to fix coreutils with these two patches: > > Subject: [PATCH 1/2] wc: avoid NULL dereference on out-of-memory error I've pushed that, with adjusted logs: (mainly, I dug up and noted each bug-introducing commit) commit caaf2899f67d312d76af91add2a4d9f7be2d5c61 Author: Jim Meyering Date: Wed Mar 2 19:16:46 2011 +0100 du: don't infloop for --files0-from=DIR * src/du.c (main): Fail on AI_ERR_READ error, rather than merely diagnosing and continuing. Based on a patch by Stefan Vargyas. Also move the handling of AI_ERR_EOF into the case stmt. Do not report ferror/fclose(stdin) failure when we've already diagnosed e.g., failure to read the DIR, above. Bug introduced by 2008-11-24 commit 031e2fb5, "du: read and process --files0-from= input a name at a time,". * src/wc.c: Handle read failure as with du: do not exit immediately, but rather go on to print any total and to clean-up. As above, move the handling of AI_ERR_EOF into the case stmt. * tests/du/files0-from-dir: New file, to test both du and wc. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. commit 7cfd12c78e0be4c90f29c99ab383163aa1471504 Author: Jim Meyering Date: Wed Mar 2 18:54:43 2011 +0100 wc: avoid NULL dereference on out-of-memory error * src/wc.c (main): Diagnose failed argv_iter_init_* failure, rather than falling through and dereferencing NULL. Bug introduced by 2008-11-25 commit c2e56e0d, "wc: read and process --files0-from= input a name at a time,". * NEWS (Bug fixes): Mention it. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 20:38:51 2011 Received: (at control) by debbugs.gnu.org; 24 Mar 2011 00:38:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2YZe-0003iT-Or for submit@debbugs.gnu.org; Wed, 23 Mar 2011 20:38:50 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q2YZb-0003iF-L2 for control@debbugs.gnu.org; Wed, 23 Mar 2011 20:38:48 -0400 Received: (qmail 37060 invoked from network); 24 Mar 2011 00:38:41 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 24 Mar 2011 00:38:41 -0000 Message-ID: <4D8A9206.5070703@draigBrady.com> Date: Thu, 24 Mar 2011 00:36:22 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: closing 8154 X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) package coreutils close 8154 8.11 From unknown Sat Jun 21 10:40:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 21 Apr 2011 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator