From MAILER-DAEMON Thu Jun 09 13:08:26 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bB3RS-0005fn-Ac
	for mharc-coreutils@gnu.org; Thu, 09 Jun 2016 13:08:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39627)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lijin.abc@gmail.com>) id 1bB2aP-0007up-7Q
	for coreutils@gnu.org; Thu, 09 Jun 2016 12:13:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <lijin.abc@gmail.com>) id 1bB2aO-0000t6-4S
	for coreutils@gnu.org; Thu, 09 Jun 2016 12:13:37 -0400
Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:35553)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lijin.abc@gmail.com>) id 1bB2aN-0000su-W0
	for coreutils@gnu.org; Thu, 09 Jun 2016 12:13:36 -0400
Received: by mail-vk0-x235.google.com with SMTP id d127so61744361vkh.2
	for <coreutils@gnu.org>; Thu, 09 Jun 2016 09:13:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:from:date:message-id:subject:to;
	bh=tcRzFPfF3d2DGWQEA3+OnRYlh1m0zLwO51l2P9oZYoo=;
	b=ezBWiRE2WhYcJ3Qsx9OqwjwSPOYDtrQUzAEVnN57B2v7OhQCFS3+gb0YVq0v3XPHRU
	1DfpAG7qgoiZzhMR1psSHhEiqqy0XGeslEp6zUOOzEV9EAVRgzIF4HMrPJ4Kb1fkOXR3
	wHchgxnXkxC0I931J0/BXxUWw4WeZ6/shWuHvT2n84kSjIiPPA3oaoeqDRlcVlcq7ltM
	KFKZlbuiL2cbCoQm/lkmRsFR9Ulhoa6jsQ4kWfMzCcILmlWL+ywNxLUoujr/AlrL8b7M
	TsZhX9OQBC/AG82xNk4qkOTCmNFhPXcIkLwsuLbX9N8AJEn9kGwwZSBSQkXgc8XYGg0c
	mqTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=tcRzFPfF3d2DGWQEA3+OnRYlh1m0zLwO51l2P9oZYoo=;
	b=ERRpg4o6f1RBjEyuppkk3FqAWtwr38DGZN/duZcb3LRFIaHc3K2WCszOC4hM1RSrBP
	4F9nho1whvwMmRbZu4H1iE21mPX0KIO5vFJVHifANssqlsG2CHvCFiachzmLEYuAOqZC
	wHOhEgvMDNdNRVpV0pWNHNjbzZt0G9Ie4bShrG4YJBISbIGU9lsFZ1d1lsUOFssQyNM4
	UpW+o842QRziQxCL1h+InTXkQLPkO3hTOBXEWm3VXO18meisJ4SVHl05tYIVmNFdMssC
	vqWvyStqFaA7hf16UcjY5pf9wNo44/3lNaZeE5O9n1LE/9SUaKFTnpjBb/HnSG2Ajcem
	npIA==
X-Gm-Message-State: ALyK8tJeiL+eGRMVcj8dHoFmJxu8e6gKv4AguhopT6VzrYQt4TsiJtrfg923tvIdentBmrUdkDb16dDvxEUGIg==
X-Received: by 10.159.41.167 with SMTP id s36mr4992484uas.109.1465488815375;
	Thu, 09 Jun 2016 09:13:35 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.176.67.103 with HTTP; Thu, 9 Jun 2016 09:13:34 -0700 (PDT)
From: Jin Li <lijin.abc@gmail.com>
Date: Thu, 9 Jun 2016 11:13:34 -0500
Message-ID: <CABP_fjqPZWTghnL6iE+nBkh9uO3=kt5OGWEHOhxv95Zt5NkS1w@mail.gmail.com>
Subject: How to design test case to differentiate `conv` options in `dd`?
To: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400c:c05::235
X-Mailman-Approved-At: Thu, 09 Jun 2016 13:08:23 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Jun 2016 16:13:38 -0000

Hi,

I am trying to test disk speed using `dd` program, and I have
questions about what are the differences between `conv` options, i.e.
`fdatasync`, `fsync`, `sync`. To illustrate the difference, I have the
following example.

~~~
~$ dd if=/dev/zero of="$tmpfile" bs=1MB count=500 conv=fsync
500+0 records in
500+0 records out
500000000 bytes (500 MB) copied, 1.58808 s, 315 MB/s

~$ dd if=/dev/zero of="$tmpfile" bs=1MB count=500 conv=sync
500+0 records in
500+0 records out
500000000 bytes (500 MB) copied, 1.5292 s, 327 MB/s

~$ dd if=/dev/zero of="$tmpfile" bs=1MB count=500 conv=fdatasync
500+0 records in
500+0 records out
500000000 bytes (500 MB) copied, 1.48944 s, 336 MB/s
~~~

No big difference can be found in these three options. Please find my
machine and `dd` version.
~~~
~$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.2
BuildVersion: 15C50

~$ dd --version
dd (coreutils) 8.24
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, and Stuart Kemp.
~~~

Could you show me how to design test case to differentiate the three
options? Thanks.

Best regards,
Jin


From MAILER-DAEMON Wed Jun 15 18:14:07 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bDJ4Z-0006KO-4h
	for mharc-coreutils@gnu.org; Wed, 15 Jun 2016 18:14:07 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49705)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bDJ4X-0006JP-Nn
	for coreutils@gnu.org; Wed, 15 Jun 2016 18:14:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bDJ4R-0006IY-Pu
	for coreutils@gnu.org; Wed, 15 Jun 2016 18:14:04 -0400
Received: from mx1.redhat.com ([209.132.183.28]:41666)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bDJ4R-0006IJ-K4
	for coreutils@gnu.org; Wed, 15 Jun 2016 18:13:59 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 153B93710FD
	for <coreutils@gnu.org>; Wed, 15 Jun 2016 22:13:59 +0000 (UTC)
Received: from [10.3.116.106] (ovpn-116-106.phx2.redhat.com [10.3.116.106])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u5FMDwdB010330
	for <coreutils@gnu.org>; Wed, 15 Jun 2016 18:13:58 -0400
To: "coreutils@gnu.org" <coreutils@gnu.org>
From: Eric Blake <eblake@redhat.com>
Subject: dircolors man page should mention proper quoting
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <5761D326.6060802@redhat.com>
Date: Wed, 15 Jun 2016 16:13:58 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="o6VUvXKB5B1Ft9qCJJbXxdE8hRFqwQ9nE"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.29]);
	Wed, 15 Jun 2016 22:13:59 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Jun 2016 22:14:06 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--o6VUvXKB5B1Ft9qCJJbXxdE8hRFqwQ9nE
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

'info dircolors' properly mentions that you should use:

eval "$(dircolors ...)"

but there is no mention in 'dircolors --help' or 'man dircolors' about
the proper way to use it with eval.

I mention this because the 'ssh-agent' man page has a bug: it suggests:

eval `ssh-agent -s`

which BREAKS if any of the environment variables thus output contain
whitespace.  It should be:

eval "`ssh-agent -s`"

(or modern $(), rather than ``).

Since not everyone bothers to read 'info dircolors', and there are lots
of sites out there with bad advice that lack quoting, we probably ought
to make the --help/man page more explicit on safe usage patterns.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--o6VUvXKB5B1Ft9qCJJbXxdE8hRFqwQ9nE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXYdMmAAoJEKeha0olJ0NqHJoH/299yV6VbpM5VHd7Ek29oMi8
7dFkOU0j9ubgH/AMLoFRqB6S29OdZma3O35/31CzkysE5LyamSVzrB0AY9x2S+UG
tOsYcaecgjsgiU3vgBosOJZq47Cd0wtSNT5j1Bm2aQjm/HY/JyjzoracBj+z1FV9
doST6Hc/771DJWXLz3RQTN056x5wSpqW6WoPhGKwn7v0v1qUhOWeTvs2ZiqlYyXF
+deW31MCrEZAMyCZAac6RwilvDHXMXH9Uw/fl018CbQ0DD6k2JwD8g6/da6gMqxs
vdPAL5oJnSbttFAUdLg5X06Tadk38Nkap4bFA+DKX/tUf+Ut7Ll7pAQd/I7hnIM=
=IJta
-----END PGP SIGNATURE-----

--o6VUvXKB5B1Ft9qCJJbXxdE8hRFqwQ9nE--


From MAILER-DAEMON Thu Jun 23 12:32:17 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bG7Y9-0001a7-ED
	for mharc-coreutils@gnu.org; Thu, 23 Jun 2016 12:32:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34871)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG780-00031s-88
	for coreutils@gnu.org; Thu, 23 Jun 2016 12:05:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG77u-0002O9-5m
	for coreutils@gnu.org; Thu, 23 Jun 2016 12:05:15 -0400
Received: from plane.gmane.org ([80.91.229.3]:56475)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG77t-0002NI-VB
	for coreutils@gnu.org; Thu, 23 Jun 2016 12:05:10 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG77n-0006nB-AG
	for coreutils@gnu.org; Thu, 23 Jun 2016 18:05:03 +0200
Received: from d67-193-213-211.home3.cgocable.net ([67.193.213.211])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Thu, 23 Jun 2016 18:05:03 +0200
Received: from brian by d67-193-213-211.home3.cgocable.net with local (Gmexim
	0.1 (Debian)) id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Thu, 23 Jun 2016 18:05:03 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: coreutils@gnu.org
From: "Brian J. Murrell" <brian@interlinx.bc.ca>
Subject: du with a cache for read-only dirs
Date: Thu, 23 Jun 2016 12:03:42 -0400
Lines: 48
Message-ID: <1466697822.14586.177.camel@interlinx.bc.ca>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256";
	protocol="application/pgp-signature"; boundary="=-mohvWm/hDfx2ja2hrneI"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: d67-193-213-211.home3.cgocable.net
X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) 
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-Mailman-Approved-At: Thu, 23 Jun 2016 12:32:15 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Jun 2016 16:05:17 -0000


--=-mohvWm/hDfx2ja2hrneI
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi.

I wonder if anyone has considered or has any patches floating around to
speed up du of a tree of (mostly all) read-only dirs by caching the
information from any read-only dirs.

My use case is a tree of dirs where each dir is a backup of a bunch of
machines using hard links across the dirs to synthesize full backups
with what is really incremental information. =C2=A0I.e. rsync --link-dest a=
s
implemented by a tool called rsnapshot.

Frequently I want to see what the space delta is between any number of
those backups and trawling the whole filesystem for any dirs that have
already been trawled just doesn't seem to make sense. =C2=A0Why not write
out what is known about that dir into a file that du can then just load
back the next time it is asked to run?

It is clearly a corner case, indeed. =C2=A0But I wonder if anyone has gone
down this path and has code to share before I try to find the time to
write some myself.

Cheers,
b.

--=-mohvWm/hDfx2ja2hrneI
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAABCAAGBQJXbAheAAoJENrB0DQWy8igykUH/RQD+SQO+j5H9SIoZi9FRJsG
fczqYdVGErj9oaxvO6LhMtGRBU6GFZ0DKbJ831tBBFHhNGf6bE0Xkhl+Xj+x4RZ1
QxLoxGUjBUe/ad8N5V5JMTISfrCG2PJQ1MIzm114QcIHNEnsOZ5vwt1NmRLD+dcE
2N0IPtSy/UcpcSiyaxXASJlk9J2HITl4JWSLV98kqQx+NCNk7FsfJM79nD/ma4Rl
IEEBxAjedw0FAEirArHzEEfkiLNn6SKB22rvbyDRnjNjwkCdroVLn6cZIzt9iIX5
uaqAVLL56pKHqELQsZwa/A0TJNV40Rl4ORsCVhXWbwAW7fYqJccqFUHDIAs2uLw=
=KZBF
-----END PGP SIGNATURE-----

--=-mohvWm/hDfx2ja2hrneI--




From MAILER-DAEMON Thu Jun 23 12:38:23 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bG7e3-00029I-AP
	for mharc-coreutils@gnu.org; Thu, 23 Jun 2016 12:38:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44495)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bG7dy-0001z8-5t
	for coreutils@gnu.org; Thu, 23 Jun 2016 12:38:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bG7du-0002Xa-Vo
	for coreutils@gnu.org; Thu, 23 Jun 2016 12:38:18 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:52299)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bG7du-0002Wz-Oe
	for coreutils@gnu.org; Thu, 23 Jun 2016 12:38:14 -0400
Received: from [192.168.1.80] (unknown [109.76.68.177])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id EE8D4244;
	Thu, 23 Jun 2016 17:38:09 +0100 (IST)
Subject: Re: du with a cache for read-only dirs
To: "Brian J. Murrell" <brian@interlinx.bc.ca>, coreutils@gnu.org
References: <1466697822.14586.177.camel@interlinx.bc.ca>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <576C1071.6090202@draigBrady.com>
Date: Thu, 23 Jun 2016 17:38:09 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <1466697822.14586.177.camel@interlinx.bc.ca>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Jun 2016 16:38:23 -0000

On 23/06/16 17:03, Brian J. Murrell wrote:
> Hi.
>=20
> I wonder if anyone has considered or has any patches floating around to
> speed up du of a tree of (mostly all) read-only dirs by caching the
> information from any read-only dirs.
>=20
> My use case is a tree of dirs where each dir is a backup of a bunch of
> machines using hard links across the dirs to synthesize full backups
> with what is really incremental information.  I.e. rsync --link-dest as
> implemented by a tool called rsnapshot.
>=20
> Frequently I want to see what the space delta is between any number of
> those backups and trawling the whole filesystem for any dirs that have
> already been trawled just doesn't seem to make sense.  Why not write
> out what is known about that dir into a file that du can then just load
> back the next time it is asked to run?
>=20
> It is clearly a corner case, indeed.  But I wonder if anyone has gone
> down this path and has code to share before I try to find the time to
> write some myself.

I'm thinking this logic shouldn't be within du.
Perhaps a wrapper that reads such cached values if available would be bet=
ter.
Something more general that I mentioned before in the context of file che=
cksums,
would be to have extended attributes that were auto cleared on write
by the system, where one could cache checksums and sizes etc.

cheers,
P=C3=A1draig


From MAILER-DAEMON Thu Jun 23 14:15:58 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bG9AU-00069q-CA
	for mharc-coreutils@gnu.org; Thu, 23 Jun 2016 14:15:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38355)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG8tv-0004nz-Rt
	for coreutils@gnu.org; Thu, 23 Jun 2016 13:58:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG8tr-0007RQ-Mv
	for coreutils@gnu.org; Thu, 23 Jun 2016 13:58:50 -0400
Received: from plane.gmane.org ([80.91.229.3]:35690)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG8tr-0007Py-Fd
	for coreutils@gnu.org; Thu, 23 Jun 2016 13:58:47 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1bG8to-0002QP-Ep
	for coreutils@gnu.org; Thu, 23 Jun 2016 19:58:44 +0200
Received: from d67-193-213-211.home3.cgocable.net ([67.193.213.211])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Thu, 23 Jun 2016 19:58:44 +0200
Received: from brian by d67-193-213-211.home3.cgocable.net with local (Gmexim
	0.1 (Debian)) id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Thu, 23 Jun 2016 19:58:44 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: coreutils@gnu.org
From: "Brian J. Murrell" <brian@interlinx.bc.ca>
Subject: Re: du with a cache for read-only dirs
Date: Thu, 23 Jun 2016 13:58:25 -0400
Lines: 49
Message-ID: <1466704705.14586.188.camel@interlinx.bc.ca>
References: <1466697822.14586.177.camel@interlinx.bc.ca>
	<576C1071.6090202@draigBrady.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256";
	protocol="application/pgp-signature"; boundary="=-SbRBLRHB9sh/6fhUZa1p"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: d67-193-213-211.home3.cgocable.net
In-Reply-To: <576C1071.6090202@draigBrady.com>
X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) 
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-Mailman-Approved-At: Thu, 23 Jun 2016 14:15:57 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Jun 2016 17:58:52 -0000


--=-SbRBLRHB9sh/6fhUZa1p
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2016-06-23 at 17:38 +0100, P=C3=A1draig Brady wrote:
>=C2=A0
> I'm thinking this logic shouldn't be within du.

I can't see how it couldn't/wouldn't be.

> Perhaps a wrapper that reads such cached values if available would be
> better.

And then does what? =C2=A0Gives them to du to see it's tally of the
dirs/subdirs?

> Something more general that I mentioned before in the context of file
> checksums,
> would be to have extended attributes that were auto cleared on write
> by the system, where one could cache checksums and sizes etc.

How does that avoid du from having to trawl the entire tree every time?
=C2=A0I think you are just splitting hairs on whether du gets information
from directory metadata or EAs. =C2=A0I'm trying to avoid descending into a
directory tree entirely by caching the results of the last descent into
it at the top of it.

Cheers,
b.

--=-SbRBLRHB9sh/6fhUZa1p
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAABCAAGBQJXbCNCAAoJENrB0DQWy8igy8EH/RG2Kd8M/GK7sRTfZfeP0bIZ
GeeCMp2f9R1wqPC4nQer9A2+pjmFeE6dA1aGRw7cG/9lfq6h3XCLQ8C/OBmD4+L5
HhYPovkXP2nxlcH+OzI4rTqIxns2GhRUKcDgsnatGlLoVacjm8D4BQ1lzTEEyij4
+Sqsyl9V++0lHBpT/dV7OKmGwE9HZ1ALsgd80wK7nwH3HHBWuTR9S7v8Nm0Aw/JS
ui4t9qLnGy8FDAqBtIfK26Tr1ZF2RA+Swpqm/ha7ked0iQQRxdBxHhYmA1rLIToO
LvAOardWzxsE+NnipXc2IdWYjgt7l8OCxcRjIqFvcKjsquNDCBYxptnHVbHD00k=
=zz1c
-----END PGP SIGNATURE-----

--=-SbRBLRHB9sh/6fhUZa1p--




From MAILER-DAEMON Thu Jun 23 21:35:12 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bGG1Y-00027y-OQ
	for mharc-coreutils@gnu.org; Thu, 23 Jun 2016 21:35:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37752)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1bGG1W-00024z-Eh
	for coreutils@gnu.org; Thu, 23 Jun 2016 21:35:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1bGG1U-0004ix-7B
	for coreutils@gnu.org; Thu, 23 Jun 2016 21:35:09 -0400
Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:34615)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1bGG1U-0004hi-2O
	for coreutils@gnu.org; Thu, 23 Jun 2016 21:35:08 -0400
Received: by mail-oi0-x234.google.com with SMTP id s66so96324865oif.1
	for <coreutils@gnu.org>; Thu, 23 Jun 2016 18:35:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:from:date:message-id:subject:to;
	bh=UtwTeSwZcDN12oYAe1fl2425TPzl0JPUJXGXH9Q+ANQ=;
	b=Wq+A4thGntAc+EfqOT02JDSB1RNvw17M79PCy7/ZFIYp7gA9NNC2AgegzbzEy+gNtU
	lztdnSBLNXTxx19OIbgBh27uOASx/ku0HWHcmxu/hUwOYMSkBfcSDP4pbbcMy8UEsP+g
	maPr5lRy7BIyF1biZj6nElHt7FbRNokTDPvrnGTNow9kdQCNusJc8x5POrBDjmON+1yW
	QvWKVsBWGPgVrod6y2ZPRsDLwdOACX2KvEItRbPhBP97Gs8nz6krjieOI0mq5QTwhKdS
	giQlwaPTURMRnzQdnGXZnOzvgfZKJ7pMILGKdaLEPZ+DJHpmAb+KXdta3IYn3hV8u6c7
	VivQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:sender:from:date:message-id:subject
	:to; bh=UtwTeSwZcDN12oYAe1fl2425TPzl0JPUJXGXH9Q+ANQ=;
	b=fRpROU6xZ8lS59BSdIiAY/0SFZK1juyu0jzKngh0DkyfA1df9mNVSvyFMyxraqkc4C
	5RpcsmIreATGI5EQJSL38YFBYIg/depkqFY1juQYvZZnE6wK99LwXDtFXmc8ZZqOHP0l
	pmenmYtmtaJ5KY+Lnf/cQmIFZAsGoN8b3GDAwUY6nMHETZVYM3KoJpSxm8JOaNFZYbtf
	FWQTfo6i398H87hp3KLfmnlckhpd167zpmGbKUY7knUsX1QMEbNcRGYDRApDYOe8T8GD
	kh6QHc/NBprLqzvfufylzveHPutjHefgpGWmxF2uEghU6fokETyn4yD0WUr6g6248aOS
	4Bnw==
X-Gm-Message-State: ALyK8tKwVcrG8tMcApFYKQJ2My0swBdJuOG56nD3IEYqiwSsnqPICRZeLZT29PHrK75WPbOS9B0LV/Ez9syCRQ==
X-Received: by 10.157.3.48 with SMTP id 45mr1108126otv.172.1466732107159; Thu,
	23 Jun 2016 18:35:07 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.202.73.23 with HTTP; Thu, 23 Jun 2016 18:34:47 -0700 (PDT)
From: Jim Meyering <jim@meyering.net>
Date: Thu, 23 Jun 2016 19:34:47 -0600
X-Google-Sender-Auth: Fc8ql8MioHXpyWYJ4UDvSyBWqXs
Message-ID: <CA+8g5KFNoHiGP_+NwmG3zTNNxUCauP91C91p3-U-1d2xeV0CUA@mail.gmail.com>
Subject: HACKING: suggest use of dnf, not yum
To: Coreutils <coreutils@gnu.org>
Content-Type: multipart/mixed; boundary=94eb2c038da83a768b0535fc2e79
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4003:c06::234
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Jun 2016 01:35:11 -0000

--94eb2c038da83a768b0535fc2e79
Content-Type: text/plain; charset=UTF-8

What do you think?
If someone is reading HACKING, they should be prepared to use dnf
rather than "yum", and should be able to adapt when they're using a
version of Fedora that is so old that "dnf" does not exist.

This patch also updates install --help to insert mention of "dnf"
before that of "yum".

--94eb2c038da83a768b0535fc2e79
Content-Type: text/x-patch; charset=US-ASCII; 
	name="0001-maint-mention-dnf-the-yum-1-replacement.patch"
Content-Disposition: attachment; 
	filename="0001-maint-mention-dnf-the-yum-1-replacement.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ipt2d3rb0

RnJvbSAxMWUyZTBmYzk1YTllNzVmMTcwZGVlYzVmYTAzODkwMjgyNjQ1OGU2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gTWV5ZXJpbmcgPG1leWVyaW5nQGZiLmNvbT4KRGF0ZTog
U3VuLCAyMiBNYXkgMjAxNiAxMTo1OToyNCAtMDcwMApTdWJqZWN0OiBbUEFUQ0hdIG1haW50OiBt
ZW50aW9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9zcmMvaW5zdGFsbC5jCisrKyBiL3NyYy9pbnN0YWxsLmMKQEAgLTYxMiw3ICs2MTIs
NyBAQCBVc2FnZTogJXMgW09QVElPTl0uLi4gWy1UXSBTT1VSQ0UgREVTVFxuXAogVGhpcyBpbnN0
YWxsIHByb2dyYW0gY29waWVzIGZpbGVzIChvZnRlbiBqdXN0IGNvbXBpbGVkKSBpbnRvIGRlc3Rp
bmF0aW9uXG5cCiBsb2NhdGlvbnMgeW91IGNob29zZS4gIElmIHlvdSB3YW50IHRvIGRvd25sb2Fk
IGFuZCBpbnN0YWxsIGEgcmVhZHktdG8tdXNlXG5cCiBwYWNrYWdlIG9uIGEgR05VL0xpbnV4IHN5
c3RlbSwgeW91IHNob3VsZCBpbnN0ZWFkIGJlIHVzaW5nIGEgcGFja2FnZSBtYW5hZ2VyXG5cCi1s
aWtlIHl1bSgxKSBvciBhcHQtZ2V0KDEpLlxuXAorbGlrZSBkbmYoMSksIHl1bSgxKSBvciBhcHQt
Z2V0KDEpLlxuXAogXG5cCiBJbiB0aGUgZmlyc3QgdGhyZWUgZm9ybXMsIGNvcHkgU09VUkNFIHRv
IERFU1Qgb3IgbXVsdGlwbGUgU09VUkNFKHMpIHRvXG5cCiB0aGUgZXhpc3RpbmcgRElSRUNUT1JZ
LCB3aGlsZSBzZXR0aW5nIHBlcm1pc3Npb24gbW9kZXMgYW5kIG93bmVyL2dyb3VwLlxuXAotLSAK
Mi44LjAtcmMyCgo=
--94eb2c038da83a768b0535fc2e79--


From MAILER-DAEMON Fri Jun 24 07:36:33 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bGPPU-00018S-U6
	for mharc-coreutils@gnu.org; Fri, 24 Jun 2016 07:36:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52834)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bGPPS-000165-LG
	for coreutils@gnu.org; Fri, 24 Jun 2016 07:36:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bGPPO-0004T4-9t
	for coreutils@gnu.org; Fri, 24 Jun 2016 07:36:29 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:53826)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bGPPO-0004Ss-3s
	for coreutils@gnu.org; Fri, 24 Jun 2016 07:36:26 -0400
Received: from [192.168.1.80] (unknown [109.77.243.242])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 838AF9858;
	Fri, 24 Jun 2016 12:36:24 +0100 (IST)
Subject: Re: HACKING: suggest use of dnf, not yum
To: Jim Meyering <jim@meyering.net>, Coreutils <coreutils@gnu.org>
References: <CA+8g5KFNoHiGP_+NwmG3zTNNxUCauP91C91p3-U-1d2xeV0CUA@mail.gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <576D1B37.3060609@draigBrady.com>
Date: Fri, 24 Jun 2016 12:36:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <CA+8g5KFNoHiGP_+NwmG3zTNNxUCauP91C91p3-U-1d2xeV0CUA@mail.gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Jun 2016 11:36:31 -0000

On 24/06/16 02:34, Jim Meyering wrote:
> What do you think?
> If someone is reading HACKING, they should be prepared to use dnf
> rather than "yum", and should be able to adapt when they're using a
> version of Fedora that is so old that "dnf" does not exist.
>=20
> This patch also updates install --help to insert mention of "dnf"
> before that of "yum".

Well Fedora-based means Centos/RHEL too which are much more popular
and currently don't have dnf installed by default.
Also `yum install blah` should always work:
https://lists.fedoraproject.org/pipermail/devel/2015-April/209580.html

cheers,
P=E1draig


From MAILER-DAEMON Sat Jun 25 02:45:08 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bGhL2-0006jY-7M
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2016 02:45:08 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55503)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1bGhL0-0006i2-3g
	for coreutils@gnu.org; Sat, 25 Jun 2016 02:45:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1bGhKv-0005QL-6P
	for coreutils@gnu.org; Sat, 25 Jun 2016 02:45:06 -0400
Received: from mail-qt0-x230.google.com ([2607:f8b0:400d:c0d::230]:33885)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1bGhKu-0005QG-WF
	for coreutils@gnu.org; Sat, 25 Jun 2016 02:45:01 -0400
Received: by mail-qt0-x230.google.com with SMTP id m2so3325673qtd.1
	for <coreutils@gnu.org>; Fri, 24 Jun 2016 23:44:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:subject:message-id:date:to:mime-version;
	bh=ikb20lkNCdh7O78EbZybPJnkmWP4CnZ4E8nULXQuV04=;
	b=KGjLnZiChcI/llxviMVjTwAOFEpJrfOo+HNsgL4oJbUotIMJvSHNix9cQLGMzOsrkQ
	ksL4kMnjnziFjQ1sQF0ADXnrC4bABQxsjqX+y9VRyoIu0tCIPXbd6fpa04AC4cvnsSSL
	ABrPTd7b0EGRWYlW4kg4O9vSP5e81iGnEZnuvmvQIPaQm9rC7OQX9uycWPkA1owLtPKW
	SM4xJOuiZgIH41C7k/T3F5+mruuCK/ZGwqIOF8MOi7ldgirVnP4hyKaiXZjZzXgOG7wK
	WoCVtzu6KdRIVW+kYxGe+Jg9xZyVJ/5F27xenNuNaa/1RUrllxAyDVTucwZo+tjTXFhJ
	kHEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:subject:message-id:date:to:mime-version;
	bh=ikb20lkNCdh7O78EbZybPJnkmWP4CnZ4E8nULXQuV04=;
	b=STG38pzL3bKyn8360BXXqnFDTr4xK4YDh9emvfjlbY9L4fciWda8dCq1WoQTJzMwuN
	OaRRlczeGWT7tcnX3np3j3EA9MKZQVzt90TzNXa+/1VpGk8y7N3LCNA556/hTsdA/cRZ
	xVJ6nJ/mKjH2wYz39Xz6lXswuEl70otctMDQlE5BWWUbY2raRPg05IHcvLV75KknRqG8
	mk5p2HEy9QPyqbwLOibz/DA5dXMp8jPyb14nmwf2eHtgwSvv4nCow7254B7pp4oEmDzZ
	ZDcAeDDTG3gXLubk1VdpjUVKa4+NXVBP5a+p/1IIzkwWCjuictTD0i9Vtk7fHLDfHxAv
	70/Q==
X-Gm-Message-State: ALyK8tKBHQwHhga5yc+8nrefwHOJiljUq3k2T5KwBK7C9E+O2Ot2+b0IYMOw8Ik0D7tQrw==
X-Received: by 10.200.42.200 with SMTP id c8mr9927919qta.8.1466837098967;
	Fri, 24 Jun 2016 23:44:58 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	r81sm3861720qka.33.2016.06.24.23.44.57 for <coreutils@gnu.org>
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Fri, 24 Jun 2016 23:44:57 -0700 (PDT)
From: Assaf Gordon <assafgordon@gmail.com>
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_A15D7F5F-D370-4879-9C3D-D63CAFF67DF0"
Subject: expand/unexpand: add tests, refactor common code
Message-Id: <6CFC7CFB-3C94-4284-A531-6E1C559D855F@gmail.com>
Date: Sat, 25 Jun 2016 02:44:55 -0400
To: Coreutils <coreutils@gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c0d::230
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 25 Jun 2016 06:45:07 -0000


--Apple-Mail=_A15D7F5F-D370-4879-9C3D-D63CAFF67DF0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hello,

The attached patches add more tests to expand/unexpand,
then incrementally extract common functionality into a new module =
'expand-common.h'.
(The patches could be squashed before finalizing them, but easier to =
follow when separate).

This could later serve as a basis for trying to add multibyte =
handling...

Comments welcomed,
 - assaf



--Apple-Mail=_A15D7F5F-D370-4879-9C3D-D63CAFF67DF0
Content-Disposition: attachment;
	filename=expand-2016-06-25.patch.xz
Content-Type: application/octet-stream;
	name="expand-2016-06-25.patch.xz"
Content-Transfer-Encoding: base64

/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4LsHIjtdACMcieb24As1TlM56Ds7G+WapW5+/hMbhYm1
9O8ft5RqUQQlWuc0YiwMsjg5MNLGtbBA7mWpaYOnDkxc/8CVSo0Kj5iusFjnfmfj753ByXKWgLow
omq2XaHjuVblWW9nfcl4n4dYyHrmdIWVVFCfx5nu7Qo5U/hAzT4Tnzt7XtnIDWFiAfuLSyqQqEVb
zLdq8tpJuH9MuTnZonml0RbCR5235i16MNvYvAu3oH0zgUDSIyMLMM6/153wFsajA9UFTYiYFne8
kB55qILi5EaLlHj4BMBADI7T5YNOwagR10Vx3+Q7CJe+jtWuBhV9GalmBclv1RJ1zjzJiqrgHxC6
wSADir5NfGpHOWXiH/4vb0MSS7ca1DtVVnZfY3GZXVZmFf0+nkbelK0YfhVeHPtaZPTgkzDpmc15
2gw1u5GsEQqvFB4td4cnXaW61w5E6VFeMAkZBm+xAWz2Bp0buou24FbBOrXXqzx/vER0ca3yBXfN
UVSpCd6GeDlojiO3SLjp0ZgMAGSjzeCnxE91LS+TysxAlsxfiQDxP7qviq2YyR89/fZmoAY0yzrs
+R/Pzgti0Yk7C3SJyLeWty7MU1VhsxKh1S/7REbCoTSdJtaIerPmjUi+OfeVqXhDPpSC/wNZ7PJv
Vj12KAWs8JzEAG0mtGcvU80Gl9A6cQXN7M06AAgOYMJ4v5c6LO67mFr1wwSQTG9gr6dg/pVeo0kr
xwUrOM3de+dNgRs4keEuFohbw7h9llg+vtl6+7TduhD4onjnzgwvTG9OmXL6/1f8MNTkscYI5DTS
3uQHJkRNfS7xrRkTbX8RYKX/ET4jZ3kvhGilDCu7pVAT0CuDz4Rml5Ffy/E+3NXDqMp8xPgputqI
CarSFP+7O9Z68dIp66raNDRf8PMYfK+EzJ+H6dmOmutyUJHWZcE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/YN2imuei0o+EIFugOtMPehG161z+FDZzZYBzN8dlqG
agQLef1k5LKXPthz8ZuLhnqA88hZLsBunCoFUKsMuYl5j9+pXwp+ifJQoZjAO+4sOdaijduack8p
ViG9rCByCvxset1Xd5S41gAA76laB30R19gAAddEiPYCAPf1j8qxxGf7AgAAAAAEWVo=
--Apple-Mail=_A15D7F5F-D370-4879-9C3D-D63CAFF67DF0--


From MAILER-DAEMON Sat Jun 25 07:21:05 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bGle5-00011P-6T
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2016 07:21:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39915)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bGle2-00010w-BO
	for coreutils@gnu.org; Sat, 25 Jun 2016 07:21:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bGldw-00027A-AM
	for coreutils@gnu.org; Sat, 25 Jun 2016 07:21:01 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:55821)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bGldw-00025d-3j
	for coreutils@gnu.org; Sat, 25 Jun 2016 07:20:56 -0400
Received: from [192.168.1.80] (unknown [109.79.211.124])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id BAEE99855;
	Sat, 25 Jun 2016 12:20:51 +0100 (IST)
Subject: Re: expand/unexpand: add tests, refactor common code
To: Assaf Gordon <assafgordon@gmail.com>, Coreutils <coreutils@gnu.org>,
	jonathan.russ.buchanan@gmail.com
References: <6CFC7CFB-3C94-4284-A531-6E1C559D855F@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <576E6912.8040304@draigBrady.com>
Date: Sat, 25 Jun 2016 12:20:50 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <6CFC7CFB-3C94-4284-A531-6E1C559D855F@gmail.com>
Content-Type: multipart/mixed; boundary="------------080907090101020205040502"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 25 Jun 2016 11:21:03 -0000

This is a multi-part message in MIME format.
--------------080907090101020205040502
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 25/06/16 07:44, Assaf Gordon wrote:
> Hello,
>=20
> The attached patches add more tests to expand/unexpand,
> then incrementally extract common functionality into a new module 'expa=
nd-common.h'.
> (The patches could be squashed before finalizing them, but easier to fo=
llow when separate).
>=20
> This could later serve as a basis for trying to add multibyte handling.=
..

Very nice work, especially adding new tests.
Yes these should probably be squashed before pushing.
Attached is a trivial patch to pass syntax-check.

Size increase is negligible:

lt:coreutils (master)$ size src/{,un}expand
   text	   data	    bss	    dec	    hex	filename
  39360	   1108	    496	  40964	   a004	src/expand
  39890	   1116	    528	  41534	   a23e	src/unexpand

lt:coreutils (expand *)$ size src/{,un}expand
   text	   data	    bss	    dec	    hex	filename
  39792	   1108	    512	  41412	   a1c4	src/expand
  40298	   1116	    512	  41926	   a3c6	src/unexpand

As part of this, or at least before looking at multibyte changes,
it would be worth considering this proposal for changing the
unexpand algorithm: http://bugs.gnu.org/23335

thanks!
P=E1draig

--------------080907090101020205040502
Content-Type: text/x-patch;
 name="expand-extern.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="expand-extern.diff"

diff --git a/src/expand-common.c b/src/expand-common.c
index 9c94441..41d7003 100644
--- a/src/expand-common.c
+++ b/src/expand-common.c
@@ -66,7 +66,7 @@ int exit_status =3D EXIT_SUCCESS;
=20
=20
 /* Add tab stop TABVAL to the end of 'tab_list'.  */
-void
+extern void
 add_tab_stop (uintmax_t tabval)
 {
   uintmax_t prev_column =3D first_free_tab ? tab_list[first_free_tab - 1=
] : 0;
@@ -86,7 +86,7 @@ add_tab_stop (uintmax_t tabval)
=20
 /* Add the comma or blank separated list of tab stops STOPS
    to the list of tab stops.  */
-void
+extern void
 parse_tab_stops (char const *stops)
 {
   bool have_tabval =3D false;
@@ -165,7 +165,7 @@ validate_tab_stops (uintmax_t const *tabs, size_t ent=
ries)
    tab-stops =3D N (if value N specified as the only value).
    tab-stops =3D distinct values given on command line (if multiple valu=
es given).
 */
-void
+extern void
 finalize_tab_stops (void)
 {
   validate_tab_stops (tab_list, first_free_tab);
@@ -179,7 +179,7 @@ finalize_tab_stops (void)
 }
=20
=20
-uintmax_t
+extern uintmax_t
 get_next_tab_column (const uintmax_t column, size_t* tab_index,
                      bool* last_tab)
 {
@@ -206,7 +206,7 @@ get_next_tab_column (const uintmax_t column, size_t* =
tab_index,
=20
=20
 /* Sets new file-list */
-void
+extern void
 set_file_list (char **list)
 {
   have_read_stdin =3D false;
@@ -222,7 +222,7 @@ set_file_list (char **list)
    Open a filename of '-' as the standard input.
    Return NULL if there are no more input files.  */
=20
-FILE *
+extern FILE *
 next_file (FILE *fp)
 {
   static char *prev_file;
@@ -266,7 +266,7 @@ next_file (FILE *fp)
 }
=20
 /* */
-void
+extern void
 cleanup_file_list_stdin (void)
 {
     if (have_read_stdin && fclose (stdin) !=3D 0)
diff --git a/src/expand-common.h b/src/expand-common.h
index 4d1074b..8cb2079 100644
--- a/src/expand-common.h
+++ b/src/expand-common.h
@@ -35,38 +35,38 @@ extern size_t max_column_width;
 extern int exit_status;
=20
 /* Add tab stop TABVAL to the end of 'tab_list'.  */
-void
+extern void
 add_tab_stop (uintmax_t tabval);
=20
 /* Add the comma or blank separated list of tab stops STOPS
    to the list of tab stops.  */
-void
+extern void
 parse_tab_stops (char const *stops);
=20
 /* TODO: Document */
-uintmax_t
+extern uintmax_t
 get_next_tab_column (const uintmax_t column, size_t* tab_index,
                      bool* last_tab);
=20
 /* Called after all command-line options have been parsed,
    sets the final tab-stops values */
-void
+extern void
 finalize_tab_stops (void);
=20
=20
=20
=20
 /* Sets new file-list */
-void
+extern void
 set_file_list (char **file_list);
=20
 /* Close the old stream pointer FP if it is non-NULL,
    and return a new one opened to read the next input file.
    Open a filename of '-' as the standard input.
    Return NULL if there are no more input files.  */
-FILE *
+extern FILE *
 next_file (FILE *fp);
=20
 /* */
-void
+extern void
 cleanup_file_list_stdin (void);

--------------080907090101020205040502--


From MAILER-DAEMON Sun Jun 26 14:22:01 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHEgz-0005ja-Qp
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2016 14:22:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58593)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHDWh-0001x8-4t
	for coreutils@gnu.org; Sun, 26 Jun 2016 13:07:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHDWc-0003xO-38
	for coreutils@gnu.org; Sun, 26 Jun 2016 13:07:18 -0400
Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36339)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHDWb-0003xI-SK
	for coreutils@gnu.org; Sun, 26 Jun 2016 13:07:14 -0400
Received: by mail-wm0-x242.google.com with SMTP id c82so18650473wme.3
	for <coreutils@gnu.org>; Sun, 26 Jun 2016 10:07:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:in-reply-to:references;
	bh=J8mU8OrBzMO0fxEn+DCro8ashqmaZOvAtHZxYKmd0FE=;
	b=jMmpNNmYM8Olj0XkVZf47wHLWLVD1BuhRrEWiPmAf8NyxheRztjk92OWoCdQ6gBJt1
	yLlDtUSPiqdbAqCR8FY++Bkifm7UkGkWCwk1JEQQQM6zr79nBtbPiJnjItZpIZ+dNGk1
	OeMfToP5nIXfNMN+jWZz6HEz4QV980QlFChixkgO/Whjtj2pzjlZsUBbTffQtG2oIMOn
	eY9XnZ0zIreqZZyI7LrtE9pVLQy4p/2R1LCPgWwCqFKFws20LOO+6Pb1D2ZJ7UGEQ2p4
	n9p4MUeDBysqi/vMy+Nv9eyPxHDG5KqfCS/hC29kYm7NgatWN688ZT6YLVPwUoFSUJlt
	nQgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
	:references;
	bh=J8mU8OrBzMO0fxEn+DCro8ashqmaZOvAtHZxYKmd0FE=;
	b=hPsEdLsrNBszQrnyRX6Wn7l1EyVQtWNOwEidp9vu4JPzzGxXFv0MfUBclbO2EzCulQ
	J8LDN8Z3TuxpUpWswsDUivSdt00KD7U6CrE4HbeDGzlle7bRbP7leU6y4h1J01kJ4bGS
	SH/cp05vO3vXOl1IB0b2sdDfHQ74V2yiPhUtVT1OjVML6AhvQhJotq2rwXPc1JUuGB3C
	pDLD70hmClkjIwD7h9e3BZvH6MtSxSztCj8u38ovbnrsw2a2veFrCliuPvzw4aouGLwi
	O2fOiXH2UB+pwTsdJKEWqg8WvzwDT5hYd1p6UcgzNL5Q07722cVtB371ErLGacuO0hst
	aWZw==
X-Gm-Message-State: ALyK8tJxg9nRQ1JY+CwPHzGqVOC7Fon6MITITHvOWJXCwv93JalljHfLqxjD2NHtZ5sOtg==
X-Received: by 10.194.200.164 with SMTP id jt4mr12312989wjc.18.1466960833318; 
	Sun, 26 Jun 2016 10:07:13 -0700 (PDT)
Received: from nodezero.corp.ad.wrs.com ([188.24.248.70])
	by smtp.gmail.com with ESMTPSA id e69sm7333855wma.2.2016.06.26.10.07.12
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 26 Jun 2016 10:07:12 -0700 (PDT)
From: Alexandru Moise <00moses.alexander00@gmail.com>
To: jim@meyering.net, P@draigBrady.com, mail@bernhard-voelker.de, ebb9@byu.net,
	eggert@cs.ucla.edu, assafgordon@gmail.com
Cc: coreutils@gnu.org,
	Alexandru Moise <00moses.alexander00@gmail.com>
Subject: [PATCH] cp: use reflink=auto mode by default
Date: Sun, 26 Jun 2016 20:07:06 +0300
Message-Id: <20160626170706.22375-2-00moses.alexander00@gmail.com>
X-Mailer: git-send-email 2.9.0
In-Reply-To: <20160626170706.22375-1-00moses.alexander00@gmail.com>
References: <20160626170706.22375-1-00moses.alexander00@gmail.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::242
X-Mailman-Approved-At: Sun, 26 Jun 2016 14:22:01 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Jun 2016 17:07:20 -0000

On some filesystems (BTRFS), copying a file within the filesystem may
cross subvolume boundaries and we can use a lightweight reflink copy,
which is faster than a full file copy.
This is enabled by default because it's only an optimization for
the fall back copy and does not break user expectations or usability.

* src/mv.c (cp_option_init): Set the reflink mode to AUTO.
* NEWS: Mention the improvement.
---
 NEWS     | 3 +++
 src/cp.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index b6c5c06..76c0127 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,9 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Improvements
 
+   cp will try a reflink before falling back to a standard copy, which is
+   more efficient when copying files across BTRFS subvolume boundaries.
+
    stat and tail now know about "prl_fs" (a parallels file system),
    "m1fs" (a Plexistor file system), "wslfs" (Windows Subsystem for Linux),
    and "smb2".  stat -f --format=%T now reports the file system type, and
diff --git a/src/cp.c b/src/cp.c
index 3b5b6cb..073d23e 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -782,7 +782,7 @@ cp_option_init (struct cp_options *x)
   x->interactive = I_UNSPECIFIED;
   x->move_mode = false;
   x->one_file_system = false;
-  x->reflink_mode = REFLINK_NEVER;
+  x->reflink_mode = REFLINK_AUTO;
 
   x->preserve_ownership = false;
   x->preserve_links = false;
-- 
2.9.0



From MAILER-DAEMON Sun Jun 26 14:22:03 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHEh0-0005kK-UV
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2016 14:22:02 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58592)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHDWh-0001x7-4h
	for coreutils@gnu.org; Sun, 26 Jun 2016 13:07:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHDWb-0003xD-4Z
	for coreutils@gnu.org; Sun, 26 Jun 2016 13:07:18 -0400
Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35457)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHDWa-0003wy-UR
	for coreutils@gnu.org; Sun, 26 Jun 2016 13:07:13 -0400
Received: by mail-wm0-x244.google.com with SMTP id a66so18628211wme.2
	for <coreutils@gnu.org>; Sun, 26 Jun 2016 10:07:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id;
	bh=raegj0iwIMkrHtG/UHjHAp7pGMKUy1+33wOeQVOLUc4=;
	b=dzKIUH/XP1gD4ULwE7L3uFx1NSktvjwwQ0dcQg0c/cq+ZZgLDgW8LBfHzLtWTmg4/B
	mPJwkg+p+wE6DRh8GYF/4ocb5cBdWi+8+D5wlHEeGOjFuKfIfAkI2wkNbIzLP/ixKNBH
	WRQpR5W0JPpUGnLOSPNjlukDMxwhCppIjn28wdA/wHaWxPGAUNl4UYPiejH5kGzi7Bfz
	X0a0jHTyEWtKSN2CWnPRiNZ7tbXUs/ykPIy6FVHHckTA8CtuKuv739ZhegNyBCvQo6oM
	Xyl+NtoYpZ/3Y2Z49iHKMzgKuYUV4U2TJYQveR8eACzw23JzxlY6b7GouqJKJ4cjmGRd
	ztFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:to:cc:subject:date:message-id;
	bh=raegj0iwIMkrHtG/UHjHAp7pGMKUy1+33wOeQVOLUc4=;
	b=jIbXY4tXaQMVQTakomniLFDannlHJKCFApCVc1S+19Q4IkFJyHAKTVnxL5Ot/tKjR/
	Jc5vUeHVZtWcu8fTUclU5eFNvT+Xd+1yu2S0nJzFAmClAh8I6BE/lSwAeA5hxILZUyiU
	ihyqIY8CDEJLQ6ef1F2aixGFxm85l77b+zELdNtoE9YBDdXKVHpzfi2+LrO8p44fY1mJ
	3zP+1DCvZ/7Vs5x2oH9qLGjpZkoT3PKCZIlGgSimlV+Bsn0vDj+R/RcmNZOcAuyr9/xL
	vi6tP+R+f+FzLHlgH+xa37R4rV723vxvsk1oC/lutAMa9BeQA3nJ5RXGxPema0QjT65c
	5jlA==
X-Gm-Message-State: ALyK8tKK7i8rJEUIBg3t+ltSonBFwmg/KgrIiBnAo9EtEUvPkdprCUPj9xcTZ1Z8WKB+pg==
X-Received: by 10.194.115.199 with SMTP id jq7mr11871606wjb.162.1466960831999; 
	Sun, 26 Jun 2016 10:07:11 -0700 (PDT)
Received: from nodezero.corp.ad.wrs.com ([188.24.248.70])
	by smtp.gmail.com with ESMTPSA id e69sm7333855wma.2.2016.06.26.10.07.10
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 26 Jun 2016 10:07:11 -0700 (PDT)
From: Alexandru Moise <00moses.alexander00@gmail.com>
To: jim@meyering.net, P@draigBrady.com, mail@bernhard-voelker.de, ebb9@byu.net,
	eggert@cs.ucla.edu, assafgordon@gmail.com
Cc: coreutils@gnu.org
Subject: Proposal patch for making cp use REFLINK_AUTO option by default
Date: Sun, 26 Jun 2016 20:07:05 +0300
Message-Id: <20160626170706.22375-1-00moses.alexander00@gmail.com>
X-Mailer: git-send-email 2.9.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::244
X-Mailman-Approved-At: Sun, 26 Jun 2016 14:22:01 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Jun 2016 17:07:20 -0000

This is a proposal patch for cp to have default behavior of doing reflink
copies. Many in the BTRFS community have for some time expected that this
should be the default behavior for cp as it is for mv, but it seems that
this is not the case.

This patch is inspired by David Sterba's 2014 patch:

commit b47231be6813e6cb5305266e391b4bb745f27f13
mv: use reflink=auto mode by default



From MAILER-DAEMON Sun Jun 26 14:23:12 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHEi8-0006Mo-Bp
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2016 14:23:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41948)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHEi5-0006MX-NJ
	for coreutils@gnu.org; Sun, 26 Jun 2016 14:23:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHEi1-0008Ca-F3
	for coreutils@gnu.org; Sun, 26 Jun 2016 14:23:08 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58683)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHEi1-0008CR-8D
	for coreutils@gnu.org; Sun, 26 Jun 2016 14:23:05 -0400
Received: from [192.168.1.80] (unknown [109.76.225.107])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 3379D4AE1;
	Sun, 26 Jun 2016 19:23:03 +0100 (IST)
Subject: Re: [PATCH] cp: use reflink=auto mode by default
To: Alexandru Moise <00moses.alexander00@gmail.com>
References: <20160626170706.22375-1-00moses.alexander00@gmail.com>
	<20160626170706.22375-2-00moses.alexander00@gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <57701D86.4020406@draigBrady.com>
Date: Sun, 26 Jun 2016 19:23:02 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <20160626170706.22375-2-00moses.alexander00@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Jun 2016 18:23:10 -0000

On 26/06/16 18:07, Alexandru Moise wrote:
> On some filesystems (BTRFS), copying a file within the filesystem may
> cross subvolume boundaries and we can use a lightweight reflink copy,
> which is faster than a full file copy.

Note the above is accurate for mv, but for cp it's significant
for _any_ copy within a BTRFS file system.

> This is enabled by default because it's only an optimization for
> the fall back copy and does not break user expectations or usability.

That simplifies the argument a bit, but I think there is some weight behi=
nd this change.
Coincidentally? I commented recently at https://news.ycombinator.com/item=
?id=3D11937781
where I describe there why cp may want to change this default behavior.
However I allude there to an implementation using copy_file_range() to be=
 more
file system agnostic rather than trying something BTRFS specific
and falling back each time.

thanks,
P=E1draig


From MAILER-DAEMON Sun Jun 26 16:26:19 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHGdG-0000db-VH
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2016 16:26:19 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58345)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHGdC-0000ax-TO
	for coreutils@gnu.org; Sun, 26 Jun 2016 16:26:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHGd8-0002Rw-Hb
	for coreutils@gnu.org; Sun, 26 Jun 2016 16:26:14 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58919)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHGd8-0002RQ-88
	for coreutils@gnu.org; Sun, 26 Jun 2016 16:26:10 -0400
Received: from [192.168.1.80] (unknown [109.76.225.107])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 496394AE1;
	Sun, 26 Jun 2016 21:26:06 +0100 (IST)
Subject: Re: [Bug 984910] rm fails to detect errors in readdir(3)
To: "P. Benie" <pjb1008@cam.ac.uk>
References: <bug-984910-27849-NcmPmFN8vK@http.bugzilla.opensuse.org/>
	<57698E6F.9000502@bernhard-voelker.de>
	<576A6FC7.1070700@draigBrady.com>
	<19613e89-aecb-2be1-2ab4-3c0b338d1fdb@bernhard-voelker.de>
	<576A8926.3010607@draigBrady.com>
	<9f5c9083-a51f-6352-e71a-1bed462a9946@bernhard-voelker.de>
	<alpine.LSU.2.00.1606221433250.30919@akane.eng.cam.ac.uk>
	<576AA68F.6050709@draigBrady.com>
Cc: Andreas Stieger <astieger@suse.com>, Philipp Thomas <pth@suse.de>,
	Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <57703A5D.4060307@draigBrady.com>
Date: Sun, 26 Jun 2016 21:26:05 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <576AA68F.6050709@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------080703000108070305010904"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Jun 2016 20:26:17 -0000

This is a multi-part message in MIME format.
--------------080703000108070305010904
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

On 22/06/16 15:54, P=E1draig Brady wrote:
> Cool, I'll add that test in your name to coreutils.

Attached.

thanks,
P=E1draig


--------------080703000108070305010904
Content-Type: text/x-patch;
 name="coreutils-fts-readdir.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="coreutils-fts-readdir.patch"

>From ef9650170f795be41223c8887258a1c596ecc162 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Sun, 26 Jun 2016 20:58:41 +0100
Subject: [PATCH 1/2] all: update gnulib submodule and tests/init.sh to latest

* gnulib: Update to latest.
* NEWS: Specifically mention the fts readdir() fix
and reindent to standard indentation.
* tests/init.sh: Update from gnulib.
---
 NEWS          | 60 ++++++++++++++++++++++++++++++++---------------------------
 gnulib        |  2 +-
 tests/init.sh | 31 ++++++++++++++++--------------
 3 files changed, 51 insertions(+), 42 deletions(-)

diff --git a/NEWS b/NEWS
index b6c5c06..bfaf239 100644
--- a/NEWS
+++ b/NEWS
@@ -4,46 +4,52 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Bug fixes
 
-   cp, mv, and install no longer run into undefined behavior when
-   handling ACLs on Cygwin and Solaris platforms. [bug introduced in
-   coreutils-8.24]
+  cp, mv, and install no longer run into undefined behavior when
+  handling ACLs on Cygwin and Solaris platforms. [bug introduced in
+  coreutils-8.24]
 
-   date, du, ls, and pr no longer mishandle time zone abbreviations on
-   System V style platforms where this information is available only
-   in the global variable 'tzname'. [bug introduced in coreutils-8.24]
+  chcon, chgrp, chmod, chown, du, and rm, or specifically utilities
+  using the FTS interface, now diagnose failures returned by readdir().
+  [this bug was inherent in the use of fts: thus, for rm the bug was
+  introduced in coreutils-8.0.  du, chmod, chgrp and chown started using
+  fts in 6.0.  chcon was added in coreutils-6.9.91 with fts support.  ]
 
-   nl now resets numbering for each page section rather than just for each page.
-   [This bug was present in "the beginning".]
+  date, du, ls, and pr no longer mishandle time zone abbreviations on
+  System V style platforms where this information is available only
+  in the global variable 'tzname'. [bug introduced in coreutils-8.24]
 
-   stty --help no longer outputs extraneous gettext header lines
-   for translated languages. [bug introduced in coreutils-8.24]
+  nl now resets numbering for each page section rather than just for each page.
+  [This bug was present in "the beginning".]
 
-   seq now immediately exits upon write errors.
-   [This bug was present in "the beginning".]
+  stty --help no longer outputs extraneous gettext header lines
+  for translated languages. [bug introduced in coreutils-8.24]
 
-   yes now handles short writes, rather than assuming all writes complete.
-   [bug introduced in coreutils-8.24]
+  seq now immediately exits upon write errors.
+  [This bug was present in "the beginning".]
+
+  yes now handles short writes, rather than assuming all writes complete.
+  [bug introduced in coreutils-8.24]
 
 ** Changes in behavior
 
-   seq no longer accepts 0 value as increment, and now also rejects NaN
-   values for any argument.
+  seq no longer accepts 0 value as increment, and now also rejects NaN
+  values for any argument.
 
-   stat now outputs nanosecond information for time stamps even if
-   they are out of localtime range.
+  stat now outputs nanosecond information for time stamps even if
+  they are out of localtime range.
 
-   sort, tail, and uniq now support traditional usage like 'sort +2'
-   and 'tail +10' on systems conforming to POSIX 1003.1-2008 and later.
-   The 2008 edition of POSIX dropped the requirement that arguments
-   like '+2' must be treated as file names.
+  sort, tail, and uniq now support traditional usage like 'sort +2'
+  and 'tail +10' on systems conforming to POSIX 1003.1-2008 and later.
+  The 2008 edition of POSIX dropped the requirement that arguments
+  like '+2' must be treated as file names.
 
 ** Improvements
 
-   stat and tail now know about "prl_fs" (a parallels file system),
-   "m1fs" (a Plexistor file system), "wslfs" (Windows Subsystem for Linux),
-   and "smb2".  stat -f --format=%T now reports the file system type, and
-   tail -f uses polling for "prl_fs" and "smb2", inotify for "m1fs",
-   and attempts inotify for "wslfs".
+  stat and tail now know about "prl_fs" (a parallels file system),
+  "m1fs" (a Plexistor file system), "wslfs" (Windows Subsystem for Linux),
+  and "smb2".  stat -f --format=%T now reports the file system type, and
+  tail -f uses polling for "prl_fs" and "smb2", inotify for "m1fs",
+  and attempts inotify for "wslfs".
 
 
 * Noteworthy changes in release 8.25 (2016-01-20) [stable]
diff --git a/gnulib b/gnulib
index 841c4fa..6835fc4 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 841c4fa800b4c5c930c3350e5a9a164b204a79c8
+Subproject commit 6835fc458f30b94f15d69c35a79cbc2dfabe2d06
diff --git a/tests/init.sh b/tests/init.sh
index ee08022..97e4e4b 100755
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -308,13 +308,19 @@ if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
       fi
     }
   fi
-elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+elif
+  for diff_opt_ in -U3 -c '' no; do
+    test "$diff_opt_" = no && break
+    diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" </dev/null` && break
+  done
+  test "$diff_opt_" != no
+then
   if test -z "$diff_out_"; then
-    compare_ () { diff -c "$@"; }
+    compare_ () { diff $diff_opt_ "$@"; }
   else
     compare_ ()
     {
-      if diff -c "$@" > diff.out; then
+      if diff $diff_opt_ "$@" > diff.out; then
         # No differences were found, but AIX and HP-UX 'diff' produce output
         # "No differences encountered" or "There are no differences between the
         # files.". Hide this output.
@@ -466,7 +472,6 @@ setup_ ()
   fi
 
   initial_cwd_=$PWD
-  fail=0
 
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
@@ -550,8 +555,9 @@ mktempd_ ()
   # Disallow any trailing slash on specified destdir:
   # it would subvert the post-mktemp "case"-based destdir test.
   case $destdir_ in
-  /) ;;
+  / | //) destdir_slash_=$destdir;;
   */) fail_ "invalid destination dir: remove trailing slash(es)";;
+  *) destdir_slash_=$destdir_/;;
   esac
 
   case $template_ in
@@ -561,20 +567,17 @@ mktempd_ ()
   esac
 
   # First, try to use mktemp.
-  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` \
-    || fail=1
+  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
 
   # The resulting name must be in the specified directory.
-  case $d in "$destdir_"*);; *) fail=1;; esac
+  case $d in "$destdir_slash_"*) :;; *) false;; esac &&
 
   # It must have created the directory.
-  test -d "$d" || fail=1
+  test -d "$d" &&
 
   # It must have 0700 permissions.  Handle sticky "S" bits.
-  perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
-  case $perms in drwx------*) ;; *) fail=1;; esac
-
-  test $fail = 0 && {
+  perms=`ls -dgo "$d" 2>/dev/null` &&
+  case $perms in drwx--[-S]---*) :;; *) false;; esac && {
     echo "$d"
     return
   }
@@ -593,7 +596,7 @@ mktempd_ ()
   i_=1
   while :; do
     X_=`rand_bytes_ $nx_`
-    candidate_dir_="$destdir_/$base_template_$X_"
+    candidate_dir_="$destdir_slash_$base_template_$X_"
     err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
       && { echo "$candidate_dir_"; return; }
     test $MAX_TRIES_ -le $i_ && break;
-- 
2.5.5


>From e84298a2589918ffe74a71d91fcf5271eacb3708 Mon Sep 17 00:00:00 2001
From: Peter Benie <pjb1008@cam.ac.uk>
Date: Sun, 26 Jun 2016 19:07:45 +0100
Subject: [PATCH 2/2] tests: verify that fts diagnoses readdir() failures

* tests/rm/rm-readdir-fail.sh: A new test to simulate readdir()
failing immediately or after returning a few entries, and verifying
that rm does the appropriate thing.
This was initially reported at:
http://bugzilla.opensuse.org/show_bug.cgi?id=984910
where it was mentioned that readdir() may fail
when an NFS server has a poor readdir cookie implementation.
---
 tests/local.mk              |   1 +
 tests/rm/rm-readdir-fail.sh | 108 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)
 create mode 100755 tests/rm/rm-readdir-fail.sh

diff --git a/tests/local.mk b/tests/local.mk
index d3afb6e..3032bda 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -223,6 +223,7 @@ all_tests =					\
   tests/rm/unreadable.pl			\
   tests/rm/v-slash.sh				\
   tests/rm/many-dir-entries-vs-OOM.sh		\
+  tests/rm/rm-readdir-fail.sh			\
   tests/chgrp/default-no-deref.sh		\
   tests/chgrp/deref.sh				\
   tests/chgrp/no-x.sh				\
diff --git a/tests/rm/rm-readdir-fail.sh b/tests/rm/rm-readdir-fail.sh
new file mode 100755
index 0000000..20ea50e
--- /dev/null
+++ b/tests/rm/rm-readdir-fail.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+# Test rm's behaviour when the directory cannot be read.
+# This test is skipped on systems that lack LD_PRELOAD support.
+
+# Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ rm
+require_gcc_shared_
+
+mkdir -p dir/notempty || framework_failure_
+
+# Simulate "readdir" failure.
+cat > k.c <<\EOF || framework_failure_
+#define _GNU_SOURCE
+#include <dirent.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+struct dirent *readdir (DIR *dirp)
+{
+  struct dirent *(*real_readdir)(DIR *dirp) = dlsym (RTLD_NEXT, "readdir");
+  if (! real_readdir)
+    {
+      fprintf (stderr, "Failed to find readdir()\n");
+      errno = ESRCH;
+      return NULL;
+    }
+  struct dirent* d = real_readdir (dirp);
+  if (! d)
+    {
+      fprintf (stderr, "Failed to get dirent\n");
+      errno = ENOENT;
+      return NULL;
+    }
+
+  /* Flag that LD_PRELOAD and above functions work.  */
+  static int done = 0;
+  if (! done)
+    {
+      fclose (fopen ("preloaded", "w"));
+      done++;
+    }
+
+  /* Return some entries to trigger partial read failure,
+     ensuring we don't return ignored '.' or '..'  */
+  char const *readdir_partial = getenv ("READDIR_PARTIAL");
+  if (readdir_partial && *readdir_partial && done <= 3)
+    {
+      done++;
+      d->d_name[0]='0'+done; d->d_name[1]='\0';
+#ifdef _DIRENT_HAVE_D_NAMLEN
+      _D_EXACT_NAMELEN(d)=2;
+#endif
+      errno = 0;
+      return d;
+    };
+
+  /* Fail.  */
+  errno = ENOENT;
+  return NULL;
+}
+
+struct dirent64 *readdir64 (DIR *dirp)
+{
+  return (struct dirent64 *) readdir (dirp);
+}
+EOF
+
+# Then compile/link it:
+gcc_shared_ k.c k.so \
+  || framework_failure_ 'failed to build shared library'
+
+# Test if LD_PRELOAD works:
+export READDIR_PARTIAL
+for READDIR_PARTIAL in '' '1'; do
+  (LD_PRELOAD=$LD_PRELOAD:./k.so returns_ 1 rm -Rf dir 2>>err) || fail=1
+done
+test -f preloaded ||
+  skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
+
+# First case is failure to read any items from dir, then assume empty.
+# Generally that will be diagnosed when rm tries to rmdir().
+# Second case is more general error where we fail immediately
+# (with ENOENT in this case but it could be anything).
+cat <<EOF > exp
+rm: cannot remove 'dir': Directory not empty
+rm: traversal failed: dir: No such file or directory
+EOF
+
+compare exp err || fail=1
+
+Exit $fail
-- 
2.5.5


--------------080703000108070305010904--


From MAILER-DAEMON Sun Jun 26 16:48:23 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHGyd-00017R-QO
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2016 16:48:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60321)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHGyb-00017D-JR
	for coreutils@gnu.org; Sun, 26 Jun 2016 16:48:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHGyW-0005YR-Iu
	for coreutils@gnu.org; Sun, 26 Jun 2016 16:48:21 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58945)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHGyW-0005YF-By
	for coreutils@gnu.org; Sun, 26 Jun 2016 16:48:16 -0400
Received: from [192.168.1.80] (unknown [109.76.225.107])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 729AB4AE1;
	Sun, 26 Jun 2016 21:48:14 +0100 (IST)
Subject: Re: [Bug 984910] rm fails to detect errors in readdir(3)
To: "P. Benie" <pjb1008@cam.ac.uk>
References: <bug-984910-27849-NcmPmFN8vK@http.bugzilla.opensuse.org/>
	<57698E6F.9000502@bernhard-voelker.de>
	<576A6FC7.1070700@draigBrady.com>
	<19613e89-aecb-2be1-2ab4-3c0b338d1fdb@bernhard-voelker.de>
	<576A8926.3010607@draigBrady.com>
	<9f5c9083-a51f-6352-e71a-1bed462a9946@bernhard-voelker.de>
	<alpine.LSU.2.00.1606221433250.30919@akane.eng.cam.ac.uk>
	<576AA68F.6050709@draigBrady.com> <57703A5D.4060307@draigBrady.com>
Cc: Andreas Stieger <astieger@suse.com>, Philipp Thomas <pth@suse.de>,
	Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <57703F8D.3060902@draigBrady.com>
Date: Sun, 26 Jun 2016 21:48:13 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <57703A5D.4060307@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------060300030306000608020008"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Jun 2016 20:48:22 -0000

This is a multi-part message in MIME format.
--------------060300030306000608020008
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

On 26/06/16 21:26, P=E1draig Brady wrote:
> On 22/06/16 15:54, P=E1draig Brady wrote:
>> Cool, I'll add that test in your name to coreutils.
>=20
> Attached.

Small adjustment attached.



--------------060300030306000608020008
Content-Type: text/x-patch;
 name="coreutils-fts-readdir.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="coreutils-fts-readdir.diff"

diff --git a/tests/rm/rm-readdir-fail.sh b/tests/rm/rm-readdir-fail.sh
index 20ea50e..15ef1d6 100755
--- a/tests/rm/rm-readdir-fail.sh
+++ b/tests/rm/rm-readdir-fail.sh
@@ -26,23 +26,23 @@ mkdir -p dir/notempty || framework_failure_
 # Simulate "readdir" failure.
 cat > k.c <<\EOF || framework_failure_
 #define _GNU_SOURCE
+#include <dlfcn.h>
 #include <dirent.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <dlfcn.h>
 
 struct dirent *readdir (DIR *dirp)
 {
-  struct dirent *(*real_readdir)(DIR *dirp) = dlsym (RTLD_NEXT, "readdir");
-  if (! real_readdir)
+  static struct dirent *(*real_readdir)(DIR *dirp);
+  if (! real_readdir && ! (real_readdir = dlsym (RTLD_NEXT, "readdir")))
     {
       fprintf (stderr, "Failed to find readdir()\n");
       errno = ESRCH;
       return NULL;
     }
-  struct dirent* d = real_readdir (dirp);
-  if (! d)
+  static struct dirent* d;
+  if (! d && ! ( d = real_readdir (dirp)))
     {
       fprintf (stderr, "Failed to get dirent\n");
       errno = ENOENT;
@@ -50,20 +50,17 @@ struct dirent *readdir (DIR *dirp)
     }
 
   /* Flag that LD_PRELOAD and above functions work.  */
-  static int done = 0;
-  if (! done)
-    {
-      fclose (fopen ("preloaded", "w"));
-      done++;
-    }
+  static int count = 1;
+  if (count == 1)
+    fclose (fopen ("preloaded", "w"));
 
   /* Return some entries to trigger partial read failure,
      ensuring we don't return ignored '.' or '..'  */
   char const *readdir_partial = getenv ("READDIR_PARTIAL");
-  if (readdir_partial && *readdir_partial && done <= 3)
+  if (readdir_partial && *readdir_partial && count <= 3)
     {
-      done++;
-      d->d_name[0]='0'+done; d->d_name[1]='\0';
+      count++;
+      d->d_name[0]='0'+count; d->d_name[1]='\0';
 #ifdef _DIRENT_HAVE_D_NAMLEN
       _D_EXACT_NAMELEN(d)=2;
 #endif
@@ -89,10 +86,11 @@ gcc_shared_ k.c k.so \
 # Test if LD_PRELOAD works:
 export READDIR_PARTIAL
 for READDIR_PARTIAL in '' '1'; do
+  rm -f preloaded
   (LD_PRELOAD=$LD_PRELOAD:./k.so returns_ 1 rm -Rf dir 2>>err) || fail=1
+  test -f preloaded ||
+    skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
 done
-test -f preloaded ||
-  skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
 
 # First case is failure to read any items from dir, then assume empty.
 # Generally that will be diagnosed when rm tries to rmdir().

--------------060300030306000608020008--


From MAILER-DAEMON Sun Jun 26 18:00:55 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHI6o-00056N-W5
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2016 18:00:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38132)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHHRg-0000va-D0
	for coreutils@gnu.org; Sun, 26 Jun 2016 17:18:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHHRc-0002jk-5C
	for coreutils@gnu.org; Sun, 26 Jun 2016 17:18:23 -0400
Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36086)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <00moses.alexander00@gmail.com>) id 1bHHRb-0002j8-Tm
	for coreutils@gnu.org; Sun, 26 Jun 2016 17:18:20 -0400
Received: by mail-wm0-x229.google.com with SMTP id f126so78172528wma.1
	for <coreutils@gnu.org>; Sun, 26 Jun 2016 14:18:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-disposition:content-transfer-encoding:in-reply-to
	:user-agent; bh=7G8/8Gw2J4k2q43YLrSR5Iz1Jatx9r1LOEgSAkMzZVw=;
	b=ss4ajhnsMJRb7L067RlK+NNAK6gC9OJrPKk5YlNY+vI58Pcrre+uR6KUyJ+f+/22UJ
	4iJcPgnUwu94loHS+XRsBa3HsLKSZkC9pTH+y1IUjmgqLfFgpfkZERsd4ToXxSlCirhj
	5N6WNLgWTKjRTHN+9FHb94Zf10Jj0xpLvsKoD1cP7V7gIGcfZ6VPyZ8KNNHeGSxOV1yo
	znfhqbenb8bsl19GRbcixEmEgiXnPBdBjogdTwAn1qazvp/KO6BVdaAqYNX8vNaGHNsz
	vZbzbEviwIznjtTLCi4rRYE97nchu47CEnWcdfMifGE8To+qbW/2dWsKFcjVHtzHIq7v
	OuPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:date:from:to:cc:subject:message-id:references
	:mime-version:content-disposition:content-transfer-encoding
	:in-reply-to:user-agent;
	bh=7G8/8Gw2J4k2q43YLrSR5Iz1Jatx9r1LOEgSAkMzZVw=;
	b=cZcjoGfDlNV6+mfpwcS4tJt/jk+WjKVY4QK4LZysXdazeAV63e4O+iZYkRlMdd2tEd
	3skjWhLnxSYwkeYl6csDrTi6fA6SwJDDCd2hi7Cx6UuXKn4cjOcwSQhTdynzIhmWEMxK
	a4JnynMVYK1Uw7UXnKtgFbC9pOD7L3Sk6+u/xsvT453+FsMRtJCtPLHopNUA1DQf0OV8
	Qdmu5aOEaHgwEjvMXQnuhiFnxrykp2UTptJFBEqmrTWRna2MauoSK8nx68/nPtVXiDrm
	jw6Ho4wlEBiIvHzgxc9RaKleeI7xAbbdxxCMOX0aUjmKmVMYva/13plAgVQ4mPStADpO
	GOuw==
X-Gm-Message-State: ALyK8tJh1AG/L9L+m/Ce+C713xhh/qYi2Z66Dx181jCw9B3fDWf6bpZzG2D1rYYtPCBPkQ==
X-Received: by 10.28.64.213 with SMTP id n204mr7601498wma.7.1466975899124;
	Sun, 26 Jun 2016 14:18:19 -0700 (PDT)
Received: from gmail.com ([188.24.248.70]) by smtp.gmail.com with ESMTPSA id
	bc9sm9338656wjc.45.2016.06.26.14.18.18
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 26 Jun 2016 14:18:18 -0700 (PDT)
Date: Mon, 27 Jun 2016 00:18:13 +0300
From: Alexandru Moise <00moses.alexander00@gmail.com>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org
Subject: Re: [PATCH] cp: use reflink=auto mode by default
Message-ID: <20160626211812.GA32464@gmail.com>
References: <20160626170706.22375-1-00moses.alexander00@gmail.com>
	<20160626170706.22375-2-00moses.alexander00@gmail.com>
	<57701D86.4020406@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <57701D86.4020406@draigBrady.com>
User-Agent: Mutt/1.6.1 (2016-04-27)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::229
X-Mailman-Approved-At: Sun, 26 Jun 2016 18:00:53 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Jun 2016 21:18:25 -0000

On Sun, Jun 26, 2016 at 07:23:02PM +0100, Pádraig Brady wrote:
> On 26/06/16 18:07, Alexandru Moise wrote:
> > On some filesystems (BTRFS), copying a file within the filesystem may
> > cross subvolume boundaries and we can use a lightweight reflink copy,
> > which is faster than a full file copy.
> 
> Note the above is accurate for mv, but for cp it's significant
> for _any_ copy within a BTRFS file system.

To be fair it's also accurate for _any_ move within a BTRFS file system :)
Also you actually not might always want this for moves. And non-CoW copies should
always be optional, while CoW copies being default. Consider the following:

Say we have a small 1G filesystem:

# btrfs sub create a
# btrfs sub create b
# btrfs prop set b compression zlib
# mkdir b/dir
# dd if=/dev/zero of=a/file bs=1M count=200

Disk usage should now be 200M in this filesystem
# mv a/file b/
Due to mv reflinking, the file is still 200M, no compression takes place.
And if we move it around the same subvolume:
# mv b/file b/dir
Disk usage is still 200M

If I want that file to be compressed I have to copy it turning off CoW explicitly. That can
only be achieved with the present behavior of cp binary. This patch was just a proposal and
it DOES break certain use cases as was previously shown.

Strangely files with chattr +C still get CoW-ed. That is why I'm also suggesting a
cp --reflink=never option for when we want explicitly to noCoW-copy files, and mv should
have such an option as well. If we go in that direction I will also send patches implementing
these options as well. _IF_ we go this way.

> 
> > This is enabled by default because it's only an optimization for
> > the fall back copy and does not break user expectations or usability.
> 
> That simplifies the argument a bit, but I think there is some weight behind this change.
> Coincidentally? I commented recently at https://news.ycombinator.com/item?id=11937781
> where I describe there why cp may want to change this default behavior.
> However I allude there to an implementation using copy_file_range() to be more
> file system agnostic rather than trying something BTRFS specific
> and falling back each time.
> 
> thanks,
> Pádraig

Hm, yes I agree with you that this sort of change should ultimately be done at the VFS layer
I intend to investigate in the future as to how this should be implemented.
I don't see it being that problematic that we "fall back each time" however, there's no
noticeable overhead, this kind of change could probably be only noticeable in a micro-brenchmark :)
src/install.c should probably remain as it is regarding reflink mode, I can imagine it would
cause some issues to a lot of build systems.
I will take a few days to reflect on this change and do some research in this area.

Thank you very much for your reply, if you have further thoughts on this I would love to hear them.

Thanks,
	Alex


From MAILER-DAEMON Mon Jun 27 01:18:06 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHOvu-0002YC-PT
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2016 01:18:06 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33996)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1bHOvj-0002Y1-R8
	for coreutils@gnu.org; Mon, 27 Jun 2016 01:18:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1bHOvf-0006z4-RL
	for coreutils@gnu.org; Mon, 27 Jun 2016 01:17:55 -0400
Received: from mail-qt0-x233.google.com ([2607:f8b0:400d:c0d::233]:34748)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1bHOvf-0006z0-NP
	for coreutils@gnu.org; Mon, 27 Jun 2016 01:17:51 -0400
Received: by mail-qt0-x233.google.com with SMTP id m2so17309736qtd.1
	for <coreutils@gnu.org>; Sun, 26 Jun 2016 22:17:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=Z46LycW8jNcPOTxCdSgxG7uqyfR0K1X84acgQG+gNJ8=;
	b=mz69BXgsw/thFz8cYucmPl/ajOJx/CJQ278T7Oa2lLlzyu1gdmDJYxGbLlUJi/52ql
	7a1aHouIjr8sxfTvV1c4Clr4dzgFTgJt2HO+/cAMqFI49fFrQNAaWLLkNF1PoMDoMD3Z
	FETEiVolhM8Eo7G7pHHNSJuxqXaVI0UdI/xzqWO9dzQ1XpTo49r5ZQjp0EnFVn85JZgm
	YJCHevtJ3mrMxlMQWuvpCbdTiBk55qNAbf+nnBsjLP/QiFsglSXVr0MyIAc3rCoxnH8P
	Z/R7EMseS7vNttXDZcpiJZl3TwCi3T8cXpVJIj7pM6BuugPOW+f1caPNPNa79lVnaw0L
	BjYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=Z46LycW8jNcPOTxCdSgxG7uqyfR0K1X84acgQG+gNJ8=;
	b=Dss9d7Hn5xnEZV2HaG+5G+294SR4FYhO2m+mxZ0L1eRrNLzPnmkMZ0ZvptviVUhFH7
	zH+haUj4SH/JwL3QjezVUjeTAfJABjZZo+dYD7XjLVngfPdD3TU7dub/h6B1dYz3m3u2
	6BR1dNoAG8DWeYk/PVkQICepnqrO4Hkllx2s5diPKDItT+C6Xr7s/aX0Jop33NBldO8O
	PnFY27du4ZRhH+wRDy3pcaRDeHsP9H9entVwds2CjYCJCvbgUpROHZ3LVHQP3TXZ2eVk
	ERQcXub+AntOK6535UUzELmrQaK+JCWrRiPL/0UJLW6P5ke0OTOUOkUo4nEC83AwEP5C
	VuLg==
X-Gm-Message-State: ALyK8tKecoGqblaqNjVO/tlAn0F0dxKLWcNxOoE8k4Lr9BpsgEWQD03M9IONJaivRAlYdg==
X-Received: by 10.200.49.50 with SMTP id g47mr21131181qtb.76.1467004670736;
	Sun, 26 Jun 2016 22:17:50 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	q34sm2635117qtd.10.2016.06.26.22.17.48
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 26 Jun 2016 22:17:49 -0700 (PDT)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: expand/unexpand: add tests, refactor common code
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <576E6912.8040304@draigBrady.com>
Date: Mon, 27 Jun 2016 01:17:47 -0400
Cc: Coreutils <coreutils@gnu.org>,
 jonathan.russ.buchanan@gmail.com
Content-Transfer-Encoding: quoted-printable
Message-Id: <C8562056-8D19-4313-B672-02A933E3618B@gmail.com>
References: <6CFC7CFB-3C94-4284-A531-6E1C559D855F@gmail.com>
	<576E6912.8040304@draigBrady.com>
To: =?windows-1252?Q?P=E1draig_Brady?= <P@draigBrady.com>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c0d::233
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jun 2016 05:18:05 -0000

Hello P=E1draig and all,

> On Jun 25, 2016, at 07:20, P=E1draig Brady <P@draigBrady.com> wrote:
>=20
> As part of this, or at least before looking at multibyte changes,
> it would be worth considering this proposal for changing the
> unexpand algorithm: http://bugs.gnu.org/23335

The above bug-report addresses this TODO item:
=3D=3D=3D
unexpand: =
[http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.html]
  printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, =
unmodified.
  printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n"
=3D=3D=3D

I haven't yet carefully read the POSIX description (it seems =
misleadingly short),
but a quick test shows many different implementations struggle with this =
input (see below).

So before starting to work on changing the algorithm, I'd like to verify =
the stated expected output is indeed what is expected by posix (or =
perhaps, as there is simply no consensus, this is not a commonly used =
case and is better left as is?).

Thanks,
 - assaf


=3D=3D=3D

System: AIX
which unexpand: /usr/bin/unexpand
input:=20
          78  09  20  09  20  79  0a
           x  \t      \t       y  \n
   =20

expand -t 8,9 :
          78  09  09  09  20  79  0a
           x  \t  \t  \t       y  \n
   =20

expand -t 5,8 :
          78  09  20  09  20  79  0a
           x  \t      \t       y  \n

=3D=3D=3D

System: SunOS 5.11
which unexpand: /usr/bin/unexpand
input:=20
          78  09  20  09  20  79  0a
           x  \t      \t       y  \n
   =20

expand -t 8,9 :
          78  09  20  09  20  79  0a
           x  \t      \t       y  \n
   =20

expand -t 5,8 :
          78  09  09  20  79  0a
           x  \t  \t       y  \n

=3D=3D=3D

System: Linux 3.16.0-4-amd64 (Debian 8)
which unexpand: /usr/local/bin/unexpand (coreutils 8.25)
input: =20
      78  09  20  09  20  79  0a
       x  \t      \t       y  \n

expand -t 8,9 :
      78  09  09  09  20  79  0a
       x  \t  \t  \t       y  \n

expand -t 5,8 :
      78  09  09  20  79  0a
       x  \t  \t       y  \n

=3D=3D=3D

System: FreeBSD 10.1-RELEASE
which unexpand: /usr/bin/unexpand
input:=20
               78  09  20  09  20  79  0a                                =
   =20
               x  \t      \t       y  \n                                 =
  =20

expand -t 8,9 :
               78  09  09  20  79  0a                                    =
   =20
               x  \t  \t       y  \n                                     =
  =20

expand -t 5,8 :
               78  09  09  09  79  0a                                    =
   =20
               x  \t  \t  \t   y  \n                                     =
  =20

=3D=3D=3D

(test code available in =
http://files.housegordon.org/tmp/test-unexpand.sh)



From MAILER-DAEMON Mon Jun 27 05:56:27 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHTHH-0002jf-78
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2016 05:56:27 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55161)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <harlydavidsen@gmail.com>) id 1bHShC-0003vl-FQ
	for coreutils@gnu.org; Mon, 27 Jun 2016 05:19:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <harlydavidsen@gmail.com>) id 1bHShB-0008RO-Gk
	for coreutils@gnu.org; Mon, 27 Jun 2016 05:19:10 -0400
Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:36061)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <harlydavidsen@gmail.com>) id 1bHShB-0008RJ-97
	for coreutils@gnu.org; Mon, 27 Jun 2016 05:19:09 -0400
Received: by mail-wm0-x22e.google.com with SMTP id f126so91764039wma.1
	for <coreutils@gnu.org>; Mon, 27 Jun 2016 02:19:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:from:date:message-id:subject:to;
	bh=FeKE28rin5iFIF2pEdp7tw8l5MmS3Wy1HhfsbgM1u58=;
	b=gk74ahb7YBzjps5tWot9GXqmdqsz8mrdH7xKeVIOXawrohlwt0sBD2Fk3Q1I1YfEGN
	mmtlABR6C8lnWlJv+bjWkZn1WlshscXf56RrI/s6TAfrogK666XMQ7l8U59fCQZKfGue
	c7dC9hYB6BkWeUOe6CaT3lozrWvRfxE6TD/wNaxUwEj/zs/R6S6xGlXvxZ7oPuZ+rdJE
	GzbibVCeHv3J4LFmhooGkl4doYfZStUoYwQmjR04KNqen5TzqEc1xTIM6TUNLEVaVBcL
	pxgsOksmVKJQlh64XiJiFw/lRkXT2QeuHRw6TrSfL/9NVUYo5rLqzvVpIkfDS3fs0PHu
	MSkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=FeKE28rin5iFIF2pEdp7tw8l5MmS3Wy1HhfsbgM1u58=;
	b=LOVPRsn5ZYBD8F7NAcDD8VyRnxS6f/Yzsa1qO6Si/ZGlJ3KDFwS8GhiuZ9Nfoi+qQ2
	iWdfwdVuOt4cOllqhX+N+ITHMmh3aPIlHGu36YHebaE9/MeHi3YT2ahywFFj0Ry+8ehz
	GzyeD/I45RCu2oHVJ5Q5pGsYZ9i362ITkHmyErfWx2HKqfe9wHTLQU1u+k2HSgg8ao7H
	2BV6Rlc6vmMxa8QaptZZPDrEVdtZXnzLgmWMq1cSbKQkqquWFUyKotqFVjDF0nerjsGF
	xkvXB9m9tA+iKlFdZ7kTu0MWFTUO95atZ3l0IFarDx9ueIoMhMtoRaTwZ0cPPukdTWBS
	Mdiw==
X-Gm-Message-State: ALyK8tIeaC2GK30HEf9jd8G54qp9RBwbKkM1D+gIIqkNWtMbDct0VZQnZwljpv3xmzIJt8R6zB+9drKbmpvN+Q==
X-Received: by 10.28.45.201 with SMTP id t192mr10167065wmt.77.1467019148228;
	Mon, 27 Jun 2016 02:19:08 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.194.201.100 with HTTP; Mon, 27 Jun 2016 02:19:07 -0700 (PDT)
From: Ethin Probst <harlydavidsen@gmail.com>
Date: Mon, 27 Jun 2016 04:19:07 -0500
Message-ID: <CAJQtwF0Rar-Jfv8EOCqcfX0js7qn=xyQFm9K3pTCbrYg56A1Gg@mail.gmail.com>
Subject: Complete provension of rm'ing / without direct forced argument?
To: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::22e
X-Mailman-Approved-At: Mon, 27 Jun 2016 05:56:26 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jun 2016 09:19:11 -0000

Hello all,
I am writing this message to propose a feature enhancement that would
not allow users to delete the root file system (/) when executing rm
-rf. This proposal, if approved, implements a new argument,
--delete-root-filesystem, which would perform the old behavior.
Without this argument, rm -rf (or it's variants) would not allow this
to occur. --delete-root-filesystem would need to be specified in full,
and even then rm would prompt you to ensure you wanted this to occur.
For exploits that require simlinks to /, rm would notify you that this
is a simlink and require that --delete-root-filesystem be specified.
Please think on this.

-- 
Signed,
Ethin D. Probst


From MAILER-DAEMON Mon Jun 27 06:02:37 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHTNF-0007Zf-Sw
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2016 06:02:37 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41572)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHTND-0007ZG-M9
	for coreutils@gnu.org; Mon, 27 Jun 2016 06:02:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHTN7-000202-OT
	for coreutils@gnu.org; Mon, 27 Jun 2016 06:02:34 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:60041)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHTN7-0001zy-IO
	for coreutils@gnu.org; Mon, 27 Jun 2016 06:02:29 -0400
Received: from [192.168.1.80] (unknown [109.79.114.228])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id D9AE312A;
	Mon, 27 Jun 2016 11:02:25 +0100 (IST)
Subject: Re: Complete provension of rm'ing / without direct forced argument?
To: Ethin Probst <harlydavidsen@gmail.com>, coreutils@gnu.org
References: <CAJQtwF0Rar-Jfv8EOCqcfX0js7qn=xyQFm9K3pTCbrYg56A1Gg@mail.gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <5770F9B1.1020309@draigBrady.com>
Date: Mon, 27 Jun 2016 11:02:25 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <CAJQtwF0Rar-Jfv8EOCqcfX0js7qn=xyQFm9K3pTCbrYg56A1Gg@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jun 2016 10:02:36 -0000

On 27/06/16 10:19, Ethin Probst wrote:
> Hello all,
> I am writing this message to propose a feature enhancement that would
> not allow users to delete the root file system (/) when executing rm
> -rf. This proposal, if approved, implements a new argument,
> --delete-root-filesystem, which would perform the old behavior.
> Without this argument, rm -rf (or it's variants) would not allow this
> to occur. --delete-root-filesystem would need to be specified in full,
> and even then rm would prompt you to ensure you wanted this to occur.
> For exploits that require simlinks to /, rm would notify you that this
> is a simlink and require that --delete-root-filesystem be specified.
> Please think on this.

Good suggestion, but it's already implemented :)
See the --no-preserve-root added to rm, chmod, chown
since 5.1.0 (2003-12-21)

cheers,
P=C3=A1draig.


From MAILER-DAEMON Mon Jun 27 06:56:46 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHUDe-0008Gg-Qx
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2016 06:56:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53124)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHUDc-0008GY-Rz
	for coreutils@gnu.org; Mon, 27 Jun 2016 06:56:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHUDY-0004IG-PI
	for coreutils@gnu.org; Mon, 27 Jun 2016 06:56:43 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:60117)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHUDY-0004I0-Jb
	for coreutils@gnu.org; Mon, 27 Jun 2016 06:56:40 -0400
Received: from [192.168.1.80] (unknown [109.79.114.228])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id AD3AF12A;
	Mon, 27 Jun 2016 11:56:38 +0100 (IST)
Subject: Re: expand/unexpand: add tests, refactor common code
To: Assaf Gordon <assafgordon@gmail.com>
References: <6CFC7CFB-3C94-4284-A531-6E1C559D855F@gmail.com>
	<576E6912.8040304@draigBrady.com>
	<C8562056-8D19-4313-B672-02A933E3618B@gmail.com>
Cc: Coreutils <coreutils@gnu.org>, jonathan.russ.buchanan@gmail.com
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <57710666.8030502@draigBrady.com>
Date: Mon, 27 Jun 2016 11:56:38 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <C8562056-8D19-4313-B672-02A933E3618B@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jun 2016 10:56:46 -0000

On 27/06/16 06:17, Assaf Gordon wrote:
> Hello P=E1draig and all,
>=20
>> On Jun 25, 2016, at 07:20, P=E1draig Brady <P@draigBrady.com> wrote:
>>
>> As part of this, or at least before looking at multibyte changes,
>> it would be worth considering this proposal for changing the
>> unexpand algorithm: http://bugs.gnu.org/23335
>=20
> The above bug-report addresses this TODO item:
> =3D=3D=3D
> unexpand: [http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.h=
tml]
>   printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodifie=
d.
>   printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n"
> =3D=3D=3D

I think the second command is wrong there actually?
Surely it should print "x\t\t y\n"

> I haven't yet carefully read the POSIX description (it seems misleading=
ly short),
> but a quick test shows many different implementations struggle with thi=
s input (see below).
>=20
> So before starting to work on changing the algorithm, I'd like to verif=
y the stated expected output is indeed what is expected by posix (or perh=
aps, as there is simply no consensus, this is not a commonly used case an=
d is better left as is?).

Interesting.
To me the Solaris output is most correct since it does minimal translatio=
n,
however the coreutils output will behave the same with tabstops at 8 and =
9.
I.E. we use a tab rather than the existing space to fill the single width=
 space.
So ideally we'd have the Solaris output, but I wouldn't jump through any =
hoops,
or slow down the code to achieve it.

thanks!
P=E1draig.

> =3D=3D=3D
>=20
> System: AIX
> which unexpand: /usr/bin/unexpand
> input:=20
>           78  09  20  09  20  79  0a
>            x  \t      \t       y  \n
>    =20
>=20
> expand -t 8,9 :
>           78  09  09  09  20  79  0a
>            x  \t  \t  \t       y  \n
>    =20
>=20
> expand -t 5,8 :
>           78  09  20  09  20  79  0a
>            x  \t      \t       y  \n
>=20
> =3D=3D=3D
>=20
> System: SunOS 5.11
> which unexpand: /usr/bin/unexpand
> input:=20
>           78  09  20  09  20  79  0a
>            x  \t      \t       y  \n
>    =20
>=20
> expand -t 8,9 :
>           78  09  20  09  20  79  0a
>            x  \t      \t       y  \n
>    =20
>=20
> expand -t 5,8 :
>           78  09  09  20  79  0a
>            x  \t  \t       y  \n
>=20
> =3D=3D=3D
>=20
> System: Linux 3.16.0-4-amd64 (Debian 8)
> which unexpand: /usr/local/bin/unexpand (coreutils 8.25)
> input: =20
>       78  09  20  09  20  79  0a
>        x  \t      \t       y  \n
>=20
> expand -t 8,9 :
>       78  09  09  09  20  79  0a
>        x  \t  \t  \t       y  \n
>=20
> expand -t 5,8 :
>       78  09  09  20  79  0a
>        x  \t  \t       y  \n
>=20
> =3D=3D=3D
>=20
> System: FreeBSD 10.1-RELEASE
> which unexpand: /usr/bin/unexpand
> input:=20
>                78  09  20  09  20  79  0a                              =
     =20
>                x  \t      \t       y  \n                               =
    =20
>=20
> expand -t 8,9 :
>                78  09  09  20  79  0a                                  =
     =20
>                x  \t  \t       y  \n                                   =
    =20
>=20
> expand -t 5,8 :
>                78  09  09  09  79  0a                                  =
     =20
>                x  \t  \t  \t   y  \n                                   =
    =20
>=20
> =3D=3D=3D
>=20
> (test code available in http://files.housegordon.org/tmp/test-unexpand.=
sh)



From MAILER-DAEMON Mon Jun 27 15:31:30 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHcFm-0007y1-Lf
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2016 15:31:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58958)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <macuga@mag-net.sk>) id 1bHboE-0006k4-QI
	for coreutils@gnu.org; Mon, 27 Jun 2016 15:03:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <macuga@mag-net.sk>) id 1bHboA-0008MS-JC
	for coreutils@gnu.org; Mon, 27 Jun 2016 15:03:01 -0400
Received: from i-vilko.mag-net.sk ([195.168.209.19]:49196)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <macuga@mag-net.sk>) id 1bHboA-0008EN-8G
	for coreutils@gnu.org; Mon, 27 Jun 2016 15:02:58 -0400
Received: (qmail 30627 invoked from network); 27 Jun 2016 19:02:50 -0000
Received: from unknown (HELO ?192.169.8.1?) (dusanmacuga@10.3.0.8)
	by i-vilko.mag-net.sk with ESMTPA; 27 Jun 2016 19:02:50 -0000
To: coreutils@gnu.org
From: macuga <macuga@mag-net.sk>
Subject: du suggestion for improvement
Message-ID: <57717857.8040204@mag-net.sk>
Date: Mon, 27 Jun 2016 21:02:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.2
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x
X-Received-From: 195.168.209.19
X-Mailman-Approved-At: Mon, 27 Jun 2016 15:31:29 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jun 2016 19:03:03 -0000

Hi  coreutils maintainers.

Is there a chance to add an option to "du" utility to view also inodes 
count (file  count)?

Reason:
  if "df -i" shows 100% I need some command to display a directory with 
many files in.

KR, D


From MAILER-DAEMON Mon Jun 27 15:39:30 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHcNW-00007n-Ej
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2016 15:39:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40406)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHcNT-00005h-TX
	for coreutils@gnu.org; Mon, 27 Jun 2016 15:39:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHcNQ-0000BT-Pq
	for coreutils@gnu.org; Mon, 27 Jun 2016 15:39:27 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:60940)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bHcNQ-0000B3-Js
	for coreutils@gnu.org; Mon, 27 Jun 2016 15:39:24 -0400
Received: from [192.168.1.80] (unknown [109.79.114.228])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 74BC512A;
	Mon, 27 Jun 2016 20:39:22 +0100 (IST)
Subject: Re: du suggestion for improvement
To: macuga <macuga@mag-net.sk>, coreutils@gnu.org
References: <57717857.8040204@mag-net.sk>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <577180E9.3070800@draigBrady.com>
Date: Mon, 27 Jun 2016 20:39:21 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <57717857.8040204@mag-net.sk>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Jun 2016 19:39:29 -0000

On 27/06/16 20:02, macuga wrote:
> Hi  coreutils maintainers.
>=20
> Is there a chance to add an option to "du" utility to view also inodes=20
> count (file  count)?
>=20
> Reason:
>   if "df -i" shows 100% I need some command to display a directory with=
=20
> many files in.

Good suggestion :)
Already implemented in coreutils 8.22
http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3Dv8.21-=
99-g333dc83

thanks,
P=C3=A1draig


From MAILER-DAEMON Tue Jun 28 03:22:18 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHnLe-0007XM-3g
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 03:22:18 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38242)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <macuga@mag-net.sk>) id 1bHnLb-0007Ui-8w
	for coreutils@gnu.org; Tue, 28 Jun 2016 03:22:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <macuga@mag-net.sk>) id 1bHnLW-0004kt-VY
	for coreutils@gnu.org; Tue, 28 Jun 2016 03:22:14 -0400
Received: from i-vilko.mag-net.sk ([195.168.209.19]:38879)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <macuga@mag-net.sk>) id 1bHnLW-0004kh-JX
	for coreutils@gnu.org; Tue, 28 Jun 2016 03:22:10 -0400
Received: (qmail 2800 invoked from network); 28 Jun 2016 07:22:07 -0000
Received: from unknown (HELO ?192.168.1.39?) (dusanmacuga@188.123.110.175)
	by i-vilko.mag-net.sk with ESMTPA; 28 Jun 2016 07:22:07 -0000
Subject: Re: du suggestion for improvement
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <57717857.8040204@mag-net.sk> <577180E9.3070800@draigBrady.com>
From: macuga <macuga@mag-net.sk>
Message-ID: <5772259E.7000209@mag-net.sk>
Date: Tue, 28 Jun 2016 09:22:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <577180E9.3070800@draigBrady.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x
X-Received-From: 195.168.209.19
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 07:22:16 -0000

Thank u for reply I will look for the version 8.22.

Dusan

On 27.06.2016 21:39, PÃ¡draig Brady wrote:
> On 27/06/16 20:02, macuga wrote:
>> Hi  coreutils maintainers.
>>
>> Is there a chance to add an option to "du" utility to view also inodes
>> count (file  count)?
>>
>> Reason:
>>    if "df -i" shows 100% I need some command to display a directory with
>> many files in.
> Good suggestion :)
> Already implemented in coreutils 8.22
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.21-99-g333dc83
>
> thanks,
> PÃ¡draig
>



From MAILER-DAEMON Tue Jun 28 12:06:12 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHvWe-0002cy-9t
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 12:06:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57548)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHvWc-0002ZP-3m
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:06:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHvWX-0008UJ-4w
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:06:09 -0400
Received: from mx1.redhat.com ([209.132.183.28]:44715)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHvWW-0008UF-Sd
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:06:05 -0400
Received: from int-mx13.intmail.prod.int.phx2.redhat.com
	(int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 20066C04B300;
	Tue, 28 Jun 2016 16:06:04 +0000 (UTC)
Received: from [10.3.116.72] (ovpn-116-72.phx2.redhat.com [10.3.116.72])
	by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u5SG63EG023478; Tue, 28 Jun 2016 12:06:03 -0400
Subject: Re: dircolors man page should mention proper quoting
To: Reuti <reuti@staff.uni-marburg.de>
References: <5761D326.6060802@redhat.com>
	<FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <5772A06B.10406@redhat.com>
Date: Tue, 28 Jun 2016 10:06:03 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="unMo05GpcBunUksUGLe5sXpd1KvvRi1Jt"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.31]);
	Tue, 28 Jun 2016 16:06:04 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 16:06:11 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--unMo05GpcBunUksUGLe5sXpd1KvvRi1Jt
From: Eric Blake <eblake@redhat.com>
To: Reuti <reuti@staff.uni-marburg.de>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
Message-ID: <5772A06B.10406@redhat.com>
Subject: Re: dircolors man page should mention proper quoting
References: <5761D326.6060802@redhat.com>
 <FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
In-Reply-To: <FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 06/28/2016 10:00 AM, Reuti wrote:

>> I mention this because the 'ssh-agent' man page has a bug: it suggests=
:
>>
>> eval `ssh-agent -s`
>>
>> which BREAKS if any of the environment variables thus output contain
>> whitespace.  It should be:
>>
>> eval "`ssh-agent -s`"
>=20
> I don't see this, You mean instead of "SSH_AUTH_SOC" it's named "SSH AU=
TH SOC" which wouldn't be allowed? What would break exactly as there are =
already multiple lines output?

$ mkdir '/tmp/with spaces'
$ TMPDIR=3D'/tmp/with spaces/' ssh-agent -s
SSH_AUTH_SOCK=3D/tmp/with spaces//ssh-kJTBa5h6m7pC/agent.20407; export
SSH_AUTH_SOCK;
SSH_AGENT_PID=3D20408; export SSH_AGENT_PID;
echo Agent pid 20408;

Whoops - running `ssh-agent -s` without enclosing it in quotes tries to
invoke 'spaces//ssh-kJTBa5h6m7pC/agent.20407' (which likely doesn't
exist), and leaves SSH_AUTH_SOCK set to the empty string when all is
said and done (since it was exported, but the only value it was
assigned, '/tmp/with', was temporary only for the duration of the
incorrect command execution attempt).

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--unMo05GpcBunUksUGLe5sXpd1KvvRi1Jt
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXcqBrAAoJEKeha0olJ0NqDXcIAIGLtCEBruWd/40j8LTHM+8F
IqcQyT1QIfnNY0JdWw52EdhYOQSDGRs1Ny4GLdf8wmHQuNhdRNqvx08/Mj7JBDwv
BNlyqRwSxT1GR7kjdtqM5Mno6lQ5ifsYs6IiO+s5gEPE1PYm+VMPjX3I/F0aNDD1
0CeoIZYlASqi/z/9UMB+J4/p2Kal3BUgzrA20bt5iptqIHP0+FjifEyLtS4MOzLM
AuDzuKBafnHGA0EiT2EcakIPI//efPOzPQoTaOcHZR7g6NsClmKChX5daPtqHWrQ
Irqvy1FkLJIBFdGPlpgNsnrUwAfQFmH4XjQE8bfyp//WlIDiPsFeoUOnTYReTuc=
=1oBD
-----END PGP SIGNATURE-----

--unMo05GpcBunUksUGLe5sXpd1KvvRi1Jt--


From MAILER-DAEMON Tue Jun 28 12:10:14 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHvaY-0007lC-Pv
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 12:10:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60476)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHvaX-0007iz-44
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:10:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHvaQ-0002Ui-BH
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:10:12 -0400
Received: from mx1.redhat.com ([209.132.183.28]:57034)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHvaQ-0002TY-30
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:10:06 -0400
Received: from int-mx13.intmail.prod.int.phx2.redhat.com
	(int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 98A0D78231;
	Tue, 28 Jun 2016 16:10:05 +0000 (UTC)
Received: from [10.3.116.72] (ovpn-116-72.phx2.redhat.com [10.3.116.72])
	by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u5SGA5bC027409; Tue, 28 Jun 2016 12:10:05 -0400
Subject: Re: dircolors man page should mention proper quoting
To: Reuti <reuti@staff.uni-marburg.de>
References: <5761D326.6060802@redhat.com>
	<FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
	<5772A06B.10406@redhat.com>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <5772A15D.1050808@redhat.com>
Date: Tue, 28 Jun 2016 10:10:05 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <5772A06B.10406@redhat.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="0hDSBacF5RBjcA6u8DX9Mw1pmecFE7iwO"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.28]);
	Tue, 28 Jun 2016 16:10:05 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 16:10:14 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--0hDSBacF5RBjcA6u8DX9Mw1pmecFE7iwO
From: Eric Blake <eblake@redhat.com>
To: Reuti <reuti@staff.uni-marburg.de>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
Message-ID: <5772A15D.1050808@redhat.com>
Subject: Re: dircolors man page should mention proper quoting
References: <5761D326.6060802@redhat.com>
 <FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
 <5772A06B.10406@redhat.com>
In-Reply-To: <5772A06B.10406@redhat.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 06/28/2016 10:06 AM, Eric Blake wrote:
> On 06/28/2016 10:00 AM, Reuti wrote:
>=20
>>> I mention this because the 'ssh-agent' man page has a bug: it suggest=
s:
>>>
>>> eval `ssh-agent -s`
>>>
>>> which BREAKS if any of the environment variables thus output contain
>>> whitespace.  It should be:
>>>
>>> eval "`ssh-agent -s`"
>>
>> I don't see this, You mean instead of "SSH_AUTH_SOC" it's named "SSH A=
UTH SOC" which wouldn't be allowed? What would break exactly as there are=
 already multiple lines output?
>=20
> $ mkdir '/tmp/with spaces'
> $ TMPDIR=3D'/tmp/with spaces/' ssh-agent -s
> SSH_AUTH_SOCK=3D/tmp/with spaces//ssh-kJTBa5h6m7pC/agent.20407; export

As it is, ssh-agent is broken for not outputting:

SSH_AUTH_SOCK=3D'/tmp/with spaces//...'

but my point remains that if ssh-agent were fixed, it is the difference
between executing this with an unquoted eval:

SSH_AUTH_SOCK=3D"'/tmp with'" spaces//...

vs. the intended version:

SSH_AUTH_SOCK=3D'/tmp/with spaces//...'

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--0hDSBacF5RBjcA6u8DX9Mw1pmecFE7iwO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXcqFdAAoJEKeha0olJ0NqDr0H/2EGjeo4j+0lx4j5SbLjRem0
N7RzoGu5yJZ2ZvROzq179F2TPuEty4bDrEoGsDlOCVqL2AvQ9xA/yyb2K3/OOW97
Ct/Hj6NO6KubJRT5YBcsMOK/29FHwm1NhYDKL5pGntJVydFDQ+mTSGJXJLNbegyD
JQC24GcFRWSMj0s+6azTWIxJJe47YzG8q7UDY7RSseDl9WoPqtTelLhWmhkRKxq7
WId66dbA0ZVmzMIupjeiqx9FLcWp7yvHLXEAU+cDyVPZ5lFAptS1Hg+RzmBfXWdv
2cZXEdRNsBhZxG1oejrDGuixYq8KT+G8LIG6DG5iLJCmHV6vb8dtaJjeOtj/aXI=
=Wmva
-----END PGP SIGNATURE-----

--0hDSBacF5RBjcA6u8DX9Mw1pmecFE7iwO--


From MAILER-DAEMON Tue Jun 28 12:16:55 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHvh1-00079K-H7
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 12:16:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56549)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <reuti@staff.uni-marburg.de>) id 1bHvR9-0003ZT-DU
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:00:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <reuti@staff.uni-marburg.de>) id 1bHvR5-000785-AU
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:00:31 -0400
Received: from vhrz24.hrz.uni-marburg.de ([137.248.1.34]:58266)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <reuti@staff.uni-marburg.de>) id 1bHvR5-00077A-3X
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:00:27 -0400
Received: from ma15106.chemie.uni-marburg.de (ma15106.Chemie.Uni-Marburg.DE
	[137.248.150.142]) (authenticated bits=0)
	by vhrz24.HRZ.Uni-Marburg.DE (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP
	id u5SG0Ceb013351
	(version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); 
	Tue, 28 Jun 2016 18:00:13 +0200
Subject: Re: dircolors man page should mention proper quoting
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Content-Type: multipart/signed;
	boundary="Apple-Mail=_D3FB7ADB-D3F2-48DB-A8F8-05B3CBE7761D";
	protocol="application/pgp-signature"; micalg=pgp-sha1
X-Pgp-Agent: GPGMail 2.5.2
From: Reuti <reuti@staff.uni-marburg.de>
In-Reply-To: <5761D326.6060802@redhat.com>
Date: Tue, 28 Jun 2016 18:00:11 +0200
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
Message-Id: <FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
References: <5761D326.6060802@redhat.com>
To: Eric Blake <eblake@redhat.com>
X-Mailer: Apple Mail (2.2104)
X-Null-Tag: 826a499a9517e5876743ceb855315dc5
X-UniMR-MailScanner-Information: see
	http://www.uni-marburg.de/hrz/internet/mail/spam/
X-UniMR-MailScanner-ID: u5SG0Ceb013351
X-UniMR-MailScanner: Found to be clean
X-UniMR-MailScanner-From: reuti@staff.uni-marburg.de
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 137.248.1.34
X-Mailman-Approved-At: Tue, 28 Jun 2016 12:16:53 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 16:00:32 -0000


--Apple-Mail=_D3FB7ADB-D3F2-48DB-A8F8-05B3CBE7761D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi,

> Am 16.06.2016 um 00:13 schrieb Eric Blake <eblake@redhat.com>:
>=20
> 'info dircolors' properly mentions that you should use:
>=20
> eval "$(dircolors ...)"
>=20
> but there is no mention in 'dircolors --help' or 'man dircolors' about
> the proper way to use it with eval.
>=20
> I mention this because the 'ssh-agent' man page has a bug: it =
suggests:
>=20
> eval `ssh-agent -s`
>=20
> which BREAKS if any of the environment variables thus output contain
> whitespace.  It should be:
>=20
> eval "`ssh-agent -s`"

I don't see this, You mean instead of "SSH_AUTH_SOC" it's named "SSH =
AUTH SOC" which wouldn't be allowed? What would break exactly as there =
are already multiple lines output?

-- Reuti


> (or modern $(), rather than ``).
>=20
> Since not everyone bothers to read 'info dircolors', and there are =
lots
> of sites out there with bad advice that lack quoting, we probably =
ought
> to make the --help/man page more explicit on safe usage patterns.
>=20
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>=20


--Apple-Mail=_D3FB7ADB-D3F2-48DB-A8F8-05B3CBE7761D
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAldynwwACgkQo/GbGkBRnRq/3gCfRduDHVJj8hIsRHvuo4GWOQte
C+8AoMdLRhqSW8zEUs7Bk9RfLPXpNRXE
=UYEb
-----END PGP SIGNATURE-----

--Apple-Mail=_D3FB7ADB-D3F2-48DB-A8F8-05B3CBE7761D--


From MAILER-DAEMON Tue Jun 28 12:50:38 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHwDe-0003PH-Oj
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 12:50:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46477)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <reuti@staff.uni-marburg.de>) id 1bHwDc-0003Mx-CW
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:50:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <reuti@staff.uni-marburg.de>) id 1bHwDX-0007j1-De
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:50:36 -0400
Received: from vhrz24.hrz.uni-marburg.de ([137.248.1.34]:33174)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <reuti@staff.uni-marburg.de>) id 1bHwDX-0007iU-6l
	for coreutils@gnu.org; Tue, 28 Jun 2016 12:50:31 -0400
Received: from ma15106.chemie.uni-marburg.de (ma15106.Chemie.Uni-Marburg.DE
	[137.248.150.142]) (authenticated bits=0)
	by vhrz24.HRZ.Uni-Marburg.DE (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP
	id u5SGoMnw030161
	(version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); 
	Tue, 28 Jun 2016 18:50:22 +0200
Subject: Re: dircolors man page should mention proper quoting
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Content-Type: multipart/signed;
	boundary="Apple-Mail=_0DFEFB7F-49A8-4659-8C29-AD3333B0CAF9";
	protocol="application/pgp-signature"; micalg=pgp-sha1
X-Pgp-Agent: GPGMail 2.5.2
From: Reuti <reuti@staff.uni-marburg.de>
In-Reply-To: <5772A15D.1050808@redhat.com>
Date: Tue, 28 Jun 2016 18:50:21 +0200
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
Message-Id: <5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
References: <5761D326.6060802@redhat.com>
	<FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
	<5772A06B.10406@redhat.com> <5772A15D.1050808@redhat.com>
To: Eric Blake <eblake@redhat.com>
X-Mailer: Apple Mail (2.2104)
X-Null-Tag: 08e8e27cba8024e3f3229a48775468cc
X-UniMR-MailScanner-Information: see
	http://www.uni-marburg.de/hrz/internet/mail/spam/
X-UniMR-MailScanner-ID: u5SGoMnw030161
X-UniMR-MailScanner: Found to be clean
X-UniMR-MailScanner-From: reuti@staff.uni-marburg.de
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 137.248.1.34
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 16:50:37 -0000


--Apple-Mail=_0DFEFB7F-49A8-4659-8C29-AD3333B0CAF9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii


> Am 28.06.2016 um 18:10 schrieb Eric Blake <eblake@redhat.com>:
>=20
> On 06/28/2016 10:06 AM, Eric Blake wrote:
>> On 06/28/2016 10:00 AM, Reuti wrote:
>>=20
>>>> I mention this because the 'ssh-agent' man page has a bug: it =
suggests:
>>>>=20
>>>> eval `ssh-agent -s`
>>>>=20
>>>> which BREAKS if any of the environment variables thus output =
contain
>>>> whitespace.  It should be:
>>>>=20
>>>> eval "`ssh-agent -s`"
>>>=20
>>> I don't see this, You mean instead of "SSH_AUTH_SOC" it's named "SSH =
AUTH SOC" which wouldn't be allowed? What would break exactly as there =
are already multiple lines output?
>>=20
>> $ mkdir '/tmp/with spaces'
>> $ TMPDIR=3D'/tmp/with spaces/' ssh-agent -s
>> SSH_AUTH_SOCK=3D/tmp/with spaces//ssh-kJTBa5h6m7pC/agent.20407; =
export
>=20
> As it is, ssh-agent is broken for not outputting:
>=20
> SSH_AUTH_SOCK=3D'/tmp/with spaces//...'
>=20
> but my point remains that if ssh-agent were fixed, it is the =
difference
> between executing this with an unquoted eval:
>=20
> SSH_AUTH_SOCK=3D"'/tmp with'" spaces//...
>=20
> vs. the intended version:
>=20
> SSH_AUTH_SOCK=3D'/tmp/with spaces//...'

Ok, I see the point in ssh-agent not including the single quotation =
marks. But enclosing the complete output across several lines into =
quotation marks doesn't seem to change anything:

$ unset sock
$ cat foo.sh
echo -n sock=3D\'xx xx/baz\'\;' '
echo export sock\;
$ ./foo.sh
sock=3D'xx xx/baz'; export sock;
$ eval `./foo.sh`
$ echo $sock
xx xx/baz
$ unset sock
$ eval "`./foo.sh`"
$ echo $sock
xx xx/baz

-- Reuti


--Apple-Mail=_0DFEFB7F-49A8-4659-8C29-AD3333B0CAF9
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAldyqs0ACgkQo/GbGkBRnRpRTwCgvNjLcGmV5b6A/bj575EA309b
R/8An1iKbU9PPcmSCEQdtSzgzli2ttjf
=owKd
-----END PGP SIGNATURE-----

--Apple-Mail=_0DFEFB7F-49A8-4659-8C29-AD3333B0CAF9--


From MAILER-DAEMON Tue Jun 28 13:22:45 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHwij-0000cn-RF
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 13:22:45 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55810)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHwii-0000cG-9I
	for coreutils@gnu.org; Tue, 28 Jun 2016 13:22:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHwie-0007w4-22
	for coreutils@gnu.org; Tue, 28 Jun 2016 13:22:43 -0400
Received: from mx1.redhat.com ([209.132.183.28]:53157)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1bHwid-0007vy-Pn
	for coreutils@gnu.org; Tue, 28 Jun 2016 13:22:39 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 34F797AE8E;
	Tue, 28 Jun 2016 17:22:39 +0000 (UTC)
Received: from [10.3.116.72] (ovpn-116-72.phx2.redhat.com [10.3.116.72])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u5SHMcDY019829; Tue, 28 Jun 2016 13:22:38 -0400
Subject: Re: dircolors man page should mention proper quoting
To: Reuti <reuti@staff.uni-marburg.de>
References: <5761D326.6060802@redhat.com>
	<FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
	<5772A06B.10406@redhat.com> <5772A15D.1050808@redhat.com>
	<5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <5772B25E.5010709@redhat.com>
Date: Tue, 28 Jun 2016 11:22:38 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="NfoQnoJRJhfVi4ut85iH9veFh6nLni4p9"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.25]);
	Tue, 28 Jun 2016 17:22:39 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 17:22:45 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--NfoQnoJRJhfVi4ut85iH9veFh6nLni4p9
From: Eric Blake <eblake@redhat.com>
To: Reuti <reuti@staff.uni-marburg.de>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
Message-ID: <5772B25E.5010709@redhat.com>
Subject: Re: dircolors man page should mention proper quoting
References: <5761D326.6060802@redhat.com>
 <FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
 <5772A06B.10406@redhat.com> <5772A15D.1050808@redhat.com>
 <5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
In-Reply-To: <5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 06/28/2016 10:50 AM, Reuti wrote:

>=20
> Ok, I see the point in ssh-agent not including the single quotation mar=
ks. But enclosing the complete output across several lines into quotation=
 marks doesn't seem to change anything:
>=20
> $ unset sock
> $ cat foo.sh
> echo -n sock=3D\'xx xx/baz\'\;' '

'echo -n' is not portable, get used to printf(1) instead.

> echo export sock\;
> $ ./foo.sh
> sock=3D'xx xx/baz'; export sock;
> $ eval `./foo.sh`
> $ echo $sock
> xx xx/baz
> $ unset sock
> $ eval "`./foo.sh`"
> $ echo $sock
> xx xx/baz

Perhaps another example would help. And maybe I should check my facts -
the real problem is not word splitting so much as globbing.

$ cat foo.sh
echo "sock=3D'foo.?h'"
$ touch "sock=3D'foo.ah'"
$ ./foo.sh
sock=3D'foo.?h'
$ eval `./foo.sh`
$ echo "$sock"
foo.ah
$ eval "`./foo.sh`"
$ echo "$sock"
foo.?h

See how the glob converted my command line into the globbed filename,
when `` was unquoted, vs. my intended value with a shell metacharacter
when `` was quoted.

All it takes is for someone to set TMPDIR to such a filename, and then
provide a filename that globs incorrectly, for the unquoted version to
possibly cause unintended behavior.

And that's why the documentation should be fixed to always recommend
quoting, even if the corner cases where it matters are hard to encounter.=


--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--NfoQnoJRJhfVi4ut85iH9veFh6nLni4p9
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXcrJeAAoJEKeha0olJ0NqUVIH/1g6glJD6u6SYsZrjo4J9A5u
txioWwitnyqdIIdnc9HKV1RuAdvRLNJxt4KvAS/GHAhEz3+3Svs68uRX81RgrkHr
SrrK5820o62ATPYGyFimOsDTkozqZwpgq2/kQAdOMon25Y/hudsBe6lNyHowBdex
cdbFWJuTwRkjqdLRnTteiarFnTzd5KdMnHJG7NL0YG0qVkwfJu8TUM/z2CSmz8qj
zRZBV5AT+xaNJuYRYlt8oaWYPLZERVUhnFBBIIks1vg73FadQziek3c834fRQCIL
wtpX8xaSOW6WiinQQB/28Ff0Jl0czzHvMCQFhY6P6LyqdZgGYUecgx64j/aKHJw=
=A0PS
-----END PGP SIGNATURE-----

--NfoQnoJRJhfVi4ut85iH9veFh6nLni4p9--


From MAILER-DAEMON Tue Jun 28 13:25:30 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bHwlO-0002ej-4B
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2016 13:25:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56599)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dualbus@ma.sdf.org>) id 1bHwlK-0002cJ-Ul
	for coreutils@gnu.org; Tue, 28 Jun 2016 13:25:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dualbus@ma.sdf.org>) id 1bHwlF-0000T9-Mz
	for coreutils@gnu.org; Tue, 28 Jun 2016 13:25:25 -0400
Received: from ma.sdf.org ([192.94.73.31]:39673 helo=sdf.org)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dualbus@ma.sdf.org>) id 1bHwlF-0000RR-EH
	for coreutils@gnu.org; Tue, 28 Jun 2016 13:25:21 -0400
Received: from ma.sdf.org
	(IDENT:U2FsdGVkX18t1Sxfc4VH2UzCkonO+3ecvfYA1HFtDm0@localhost
	[127.0.0.1]) by sdf.org (8.14.4/8.14.3) with ESMTP id u5SHPEac028433
	(using TLSv1/SSLv3 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)
	verified NO); Tue, 28 Jun 2016 17:25:14 GMT
Received: (from dualbus@localhost)
	by ma.sdf.org (8.14.4/8.14.4/Submit) id u5SHPCxs028392;
	Tue, 28 Jun 2016 12:25:12 -0500
Date: Tue, 28 Jun 2016 12:25:12 -0500
From: Eduardo =?iso-8859-1?Q?A=2E_Bustamante_L=F3pez?= <dualbus@gmail.com>
To: Reuti <reuti@staff.uni-marburg.de>
Cc: Eric Blake <eblake@redhat.com>, "coreutils@gnu.org" <coreutils@gnu.org>
Subject: Re: dircolors man page should mention proper quoting
Message-ID: <20160628172512.GA11609@ma.sdf.org>
References: <5761D326.6060802@redhat.com>
	<FF6FCCF1-4B1B-492A-8538-D1825B1526A9@staff.uni-marburg.de>
	<5772A06B.10406@redhat.com> <5772A15D.1050808@redhat.com>
	<5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5229D06E-778B-4063-AF00-B623056E886A@staff.uni-marburg.de>
User-Agent: Mutt/1.5.20 (2009-12-10)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 192.94.73.31
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 17:25:28 -0000

On Tue, Jun 28, 2016 at 06:50:21PM +0200, Reuti wrote:
[...]
> Ok, I see the point in ssh-agent not including the single quotation marks. But enclosing the complete output across several lines into quotation marks doesn't seem to change anything:
> 
> $ unset sock
> $ cat foo.sh
> echo -n sock=\'xx xx/baz\'\;' '
> echo export sock\;
> $ ./foo.sh
> sock='xx xx/baz'; export sock;
> $ eval `./foo.sh`
> $ echo $sock
> xx xx/baz
> $ unset sock
> $ eval "`./foo.sh`"
> $ echo $sock
> xx xx/baz
> 
> -- Reuti
> 

There are two problems here:

(1) You're testing with single spaces, which will give you the false idea of
correctness.
(2) You're outputting with 'echo $sock', so it doesn't matter if you quoted the
eval, you're using an unquoted expansion to prove both are the same.

Here's a clearer example:

    dualbus@hp ~ % cat a
    x='a  b  c'

    dualbus@hp ~ % eval $(cat a); declare -p x
    typeset x='a b c'

    dualbus@hp ~ % eval "$(cat a)"; declare -p x
    typeset x='a  b  c'

In case it's not evident, there are *two* spaces separating a, b and c.

When the shell expands $(cat a), it will use IFS to split the resulting string
into multiple tokens, so eval will see:

<eval> <x='a> <b> <c'>

With <...> representing a token.

Which will be reconstructed and interpreted as: x='a b c' (single spaces).

When you quote correctly (i.e. "$(cat a)"), the shell will not perform such IFS
splitting, so eval will see:

<eval> <x='a  b  c'>, storing the correct value in x.

When you do: echo $sock, it has the same problem. Even if sock had the proper
value stored due to using quotes, the unquoted $sock will be subject of word
splitting.

Read more about word splitting here: http://mywiki.wooledge.org/WordSplitting

Or consult the "Word Splitting" in the bash manual.

-- 
Eduardo Bustamante
https://dualbus.me/


From MAILER-DAEMON Thu Jun 30 04:24:17 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bIXGj-0003G1-1W
	for mharc-coreutils@gnu.org; Thu, 30 Jun 2016 04:24:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47558)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <allan.chandler@dti.com.au>) id 1bIRAE-0007L2-06
	for coreutils@gnu.org; Wed, 29 Jun 2016 21:53:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <allan.chandler@dti.com.au>) id 1bIRA9-0006pB-RV
	for coreutils@gnu.org; Wed, 29 Jun 2016 21:53:08 -0400
Received: from 10pmail.ess.barracuda.com ([64.235.150.227]:48223)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <allan.chandler@dti.com.au>) id 1bIRA9-0006oj-LG
	for coreutils@gnu.org; Wed, 29 Jun 2016 21:53:05 -0400
Received: from mx.dti.com.au (202-74-169-146.cep.zetta.net.au
	[202.74.169.146]) by mx1.ess.sfj.cudaops.com (version=TLSv1
	cipher=AES128-SHA bits=128 verify=NO);
	Thu, 30 Jun 2016 01:52:58 +0000
Received: from MX01.dti.lan ([::1]) by mx01.dti.lan ([::1]) with mapi id
	14.03.0158.001; Thu, 30 Jun 2016 09:52:58 +0800
From: Allan Chandler <allan.chandler@dti.com.au>
To: "coreutils@gnu.org" <coreutils@gnu.org>
Subject: wc enhancement possibility
Thread-Topic: wc enhancement possibility
Thread-Index: AdHSchhbj1iBQqxsQUWIxZeQPoIwNg==
Date: Thu, 30 Jun 2016 01:52:58 +0000
Message-ID: <FD3EC9758442224FA81FA20FD6F1AE8C64431970@mx01.dti.lan>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.0.130]
MIME-Version: 1.0
X-BESS-ID: 1467251573-298552-24814-5126-2
X-BESS-VER: 2016.8-r1606211823
X-BESS-Apparent-Source-IP: 202.74.169.146
X-BESS-BRTS-Status: 1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 64.235.150.227
X-Mailman-Approved-At: Thu, 30 Jun 2016 04:24:16 -0400
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Jun 2016 01:53:12 -0000

Good arbitrary-time-of-day, people.

I helped a colleague out today with a "wc" problem they were having with li=
ne counts when the final line of a file did not have a newline at the end o=
f it.

Now this is technically not a bug since the doco explicitly states that "wc=
 --lines/-l" gives the count of newline characters, not the count of lines.=
 And, in any case, it could be argued that the definition of a line SHOULD =
be "zero or more characters followed by a newline".

However, this has caused confusion before in that a non-terminated final li=
ne COULD be considered a line, especially if you're just outputting the fil=
e.

I don't propose changing the behaviour of "--lines" since that would result=
 in chaos for a large number of scripts in the world currently using it, an=
d I don't wish to spend the rest of my life fighting off affected parties, =
Omega-Man-against-the-zombies style, because of the trouble I caused :-)

However, I wonder whether it would be worthwhile adding another option whic=
h included a final non-terminated line, something like "--lines-all".

I've seen some "wc" suggestions turned down in the past (https://www.gnu.or=
g/software/coreutils/rejected_requests.html) but these seem to generally be=
 requests for things that other tools are better to provide.

Keeping in mind the philosophy of UNIX's "a tool should do one thing and do=
 it well", and the fact that the purpose of "wC" is most definitely countin=
g things, it appears it may be a better fit in the "wc" program itself rath=
er than doing it as part of a pipeline.

Anyway, I'm really just raising it as a discussion point. Tell me what you =
think...

Al.


Allan Chandler | Software Engineer

DTI Group Ltd | Transit Security & Surveillance

31 Affleck Road, Perth Airport, WA 6105, AU

P | F | allan.chandler@dti.com.au



Visit our website www.dti.com.au<http://www.dti.com.au>

The information contained in this email is confidential. If you receive thi=
s email in error, please inform DTI Group Ltd via the above contact details=
. If you are not the intended recipient, you may not use or disclose the in=
formation contained in this email or attachments.

From MAILER-DAEMON Thu Jun 30 04:46:40 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bIXcO-0005qw-Nz
	for mharc-coreutils@gnu.org; Thu, 30 Jun 2016 04:46:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45209)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bIXcN-0005px-20
	for coreutils@gnu.org; Thu, 30 Jun 2016 04:46:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bIXcI-0006vM-Rv
	for coreutils@gnu.org; Thu, 30 Jun 2016 04:46:38 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:38013)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1bIXcI-0006un-M8
	for coreutils@gnu.org; Thu, 30 Jun 2016 04:46:34 -0400
Received: from [192.168.1.80] (unknown [109.77.199.159])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 929B19857;
	Thu, 30 Jun 2016 09:46:32 +0100 (IST)
Subject: Re: wc enhancement possibility
To: Allan Chandler <allan.chandler@dti.com.au>,
	"coreutils@gnu.org" <coreutils@gnu.org>
References: <FD3EC9758442224FA81FA20FD6F1AE8C64431970@mx01.dti.lan>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <5774DC67.2090301@draigBrady.com>
Date: Thu, 30 Jun 2016 09:46:31 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <FD3EC9758442224FA81FA20FD6F1AE8C64431970@mx01.dti.lan>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Jun 2016 08:46:40 -0000

On 30/06/16 02:52, Allan Chandler wrote:
> Good arbitrary-time-of-day, people.
>=20
> I helped a colleague out today with a "wc" problem they were having wit=
h line counts when the final line of a file did not have a newline at the=
 end of it.
>=20
> Now this is technically not a bug since the doco explicitly states that=
 "wc --lines/-l" gives the count of newline characters, not the count of =
lines. And, in any case, it could be argued that the definition of a line=
 SHOULD be "zero or more characters followed by a newline".
>=20
> However, this has caused confusion before in that a non-terminated fina=
l line COULD be considered a line, especially if you're just outputting t=
he file.
>=20
> I don't propose changing the behaviour of "--lines" since that would re=
sult in chaos for a large number of scripts in the world currently using =
it, and I don't wish to spend the rest of my life fighting off affected p=
arties, Omega-Man-against-the-zombies style, because of the trouble I cau=
sed :-)
>=20
> However, I wonder whether it would be worthwhile adding another option =
which included a final non-terminated line, something like "--lines-all".
>=20
> I've seen some "wc" suggestions turned down in the past (https://www.gn=
u.org/software/coreutils/rejected_requests.html) but these seem to genera=
lly be requests for things that other tools are better to provide.
>=20
> Keeping in mind the philosophy of UNIX's "a tool should do one thing an=
d do it well", and the fact that the purpose of "wC" is most definitely c=
ounting things, it appears it may be a better fit in the "wc" program its=
elf rather than doing it as part of a pipeline.
>=20
> Anyway, I'm really just raising it as a discussion point. Tell me what =
you think...

Maybe.

Note one of the reasons wc -l doesn't count a non \n terminated line at e=
nd of file
is so that counts are accurate for split files for example.

If we were to add an option it would be a flag type option
rather than selecting a different mode.
But it mightn't be too much overhead to pre-process the data?
I.E. something like:

  wc-all-lines() { sed '$a\' | wc -l; }

cheers,
P=E1draig


From MAILER-DAEMON Thu Jun 30 06:32:41 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bIZGy-0001eM-Ut
	for mharc-coreutils@gnu.org; Thu, 30 Jun 2016 06:32:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53641)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <allan.chandler@dti.com.au>) id 1bIYMn-0001sT-D4
	for coreutils@gnu.org; Thu, 30 Jun 2016 05:34:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <allan.chandler@dti.com.au>) id 1bIYMj-0000Zz-8C
	for coreutils@gnu.org; Thu, 30 Jun 2016 05:34:36 -0400
Received: from 10pmail.ess.barracuda.com ([64.235.150.226]:37955)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <allan.chandler@dti.com.au>) id 1bIYMj-0000Zu-2k
	for coreutils@gnu.org; Thu, 30 Jun 2016 05:34:33 -0400
Received: from mx.dti.com.au (202-74-169-146.cep.zetta.net.au
	[202.74.169.146]) by mx4.ess.sfj.cudaops.com (version=TLSv1
	cipher=AES128-SHA bits=128 verify=NO);
	Thu, 30 Jun 2016 09:34:29 +0000
Received: from MX01.dti.lan ([::1]) by mx01.dti.lan ([::1]) with mapi id
	14.03.0158.001; Thu, 30 Jun 2016 17:34:16 +0800
From: Allan Chandler <allan.chandler@dti.com.au>
To: "coreutils@gnu.org" <coreutils@gnu.org>
Subject: RE: wc enhancement possibility
Thread-Topic: wc enhancement possibility
Thread-Index: AdHSchhbj1iBQqxsQUWIxZeQPoIwNv//7X6A//9ypAA=
Date: Thu, 30 Jun 2016 09:34:15 +0000
Message-ID: <FD3EC9758442224FA81FA20FD6F1AE8C64431B31@mx01.dti.lan>
References: <FD3EC9758442224FA81FA20FD6F1AE8C64431970@mx01.dti.lan>
	<5774DC67.2090301@draigBrady.com>
In-Reply-To: <5774DC67.2090301@draigBrady.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.0.130]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-BESS-ID: 1467279268-298555-11408-7733-1
X-BESS-VER: 2016.7-r1606081844
X-BESS-Apparent-Source-IP: 202.74.169.146
X-BESS-BRTS-Status: 1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 64.235.150.226
X-Mailman-Approved-At: Thu, 30 Jun 2016 06:32:38 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Jun 2016 09:34:38 -0000

Agreed, I'd be rather confused if the sum of "wc -l <file1" and "wc -l <fil=
e2" was not the same as "cat file1 file2 | wc -l". That's why I thought it =
would be better as a separate operation.

And I don't doubt you could generate a pipeline that would do the job (pipi=
ng it through "awk '{print}'" also seems to do the trick for me) but my poi=
nt was that counting things was the raison d'=EAtre of "wc", so it would be=
 better added to _that_ program. You could just as well argue that "sed" sh=
ouldn't have an in-place editing option because you can do the same thing w=
ith a "mv" after the event :-)

I assume by flag option you meant that, rather than a new counting option l=
ike "--lines-including-partial-last", it may be better to have something th=
at modified the behaviour of the existing "--lines", such as "--count-incom=
plete-last-line" or something like that. I have no issue with the mechanics=
 so that sounds fine, my only desire was that there should be _some_ way to=
 get the information from "wc".

Cheers.

-----Original Message-----
From: P=E1draig Brady [mailto:P@draigBrady.com]=20
Sent: Thursday, 30 June 2016 4:47 PM
To: Allan Chandler; coreutils@gnu.org
Subject: Re: wc enhancement possibility

On 30/06/16 02:52, Allan Chandler wrote:
> Good arbitrary-time-of-day, people.
>=20
> I helped a colleague out today with a "wc" problem they were having with =
line counts when the final line of a file did not have a newline at the end=
 of it.
>=20
> Now this is technically not a bug since the doco explicitly states that "=
wc --lines/-l" gives the count of newline characters, not the count of line=
s. And, in any case, it could be argued that the definition of a line SHOUL=
D be "zero or more characters followed by a newline".
>=20
> However, this has caused confusion before in that a non-terminated final =
line COULD be considered a line, especially if you're just outputting the f=
ile.
>=20
> I don't propose changing the behaviour of "--lines" since that would=20
> result in chaos for a large number of scripts in the world currently=20
> using it, and I don't wish to spend the rest of my life fighting off=20
> affected parties, Omega-Man-against-the-zombies style, because of the=20
> trouble I caused :-)
>=20
> However, I wonder whether it would be worthwhile adding another option wh=
ich included a final non-terminated line, something like "--lines-all".
>=20
> I've seen some "wc" suggestions turned down in the past (https://www.gnu.=
org/software/coreutils/rejected_requests.html) but these seem to generally =
be requests for things that other tools are better to provide.
>=20
> Keeping in mind the philosophy of UNIX's "a tool should do one thing and =
do it well", and the fact that the purpose of "wC" is most definitely count=
ing things, it appears it may be a better fit in the "wc" program itself ra=
ther than doing it as part of a pipeline.
>=20
> Anyway, I'm really just raising it as a discussion point. Tell me what yo=
u think...

Maybe.

Note one of the reasons wc -l doesn't count a non \n terminated line at end=
 of file is so that counts are accurate for split files for example.

If we were to add an option it would be a flag type option rather than sele=
cting a different mode.
But it mightn't be too much overhead to pre-process the data?
I.E. something like:

  wc-all-lines() { sed '$a\' | wc -l; }

cheers,
P=E1draig


From MAILER-DAEMON Thu Jun 30 14:20:54 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bIga6-0001ZN-RS
	for mharc-coreutils@gnu.org; Thu, 30 Jun 2016 14:20:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44474)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lsatenstein@yahoo.com>) id 1bIga4-0001Z3-C2
	for coreutils@gnu.org; Thu, 30 Jun 2016 14:20:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <lsatenstein@yahoo.com>) id 1bIgZy-00061s-BX
	for coreutils@gnu.org; Thu, 30 Jun 2016 14:20:51 -0400
Received: from nm7.bullet.mail.bf1.yahoo.com ([98.139.212.166]:43497)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lsatenstein@yahoo.com>) id 1bIgZy-00061h-5l
	for coreutils@gnu.org; Thu, 30 Jun 2016 14:20:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
	t=1467310845; bh=iAqdlT+P48+ZyaggDiP0u8Xw+KxFQipEc8LUHH9n4A8=;
	h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject;
	b=UQpfhObuhTUyGiHvLKpaE6oXwlSi/Ahl8igbuE3FNRawSrOCTSO/SAk9Hs8juX0SBMKx99ERIsujkMouEw1yhw3goZ75p9r8dzZ1LCU37Dd63NdK5V+EXznXIRy/f+w3L1Aae9HgH0p5hXvGkzHXSBWhrfRCwo0w00QXbZXN82nUn9344FO5mOlA7Xteh2ZwBaIbVl3nfSdXgVnooJpUIpXeibCRt7Zx88JB1VmYhN3p6JB9lVE7WKmePf5FFkq3C4Ei6F5nUk87FGdfnYL6qiftHynfhecGA9tsap7F+1/s5hSSx+pJ497XjbDZlPqL/q2HiIvZ9sdZcMWfV4LjFQ==
Received: from [66.196.81.171] by nm7.bullet.mail.bf1.yahoo.com with NNFMP;
	30 Jun 2016 18:20:45 -0000
Received: from [98.139.215.230] by tm17.bullet.mail.bf1.yahoo.com with NNFMP;
	30 Jun 2016 18:20:45 -0000
Received: from [127.0.0.1] by omp1070.mail.bf1.yahoo.com with NNFMP;
	30 Jun 2016 18:20:45 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 267293.9340.bm@omp1070.mail.bf1.yahoo.com
X-YMail-OSG: E1sSQoYVM1mV2tiD37WjIhyXOlcbaYSdLTKAus4jUrOCAYp1QEjSe.Gr7xE6CmU
	sTwa6hYlq_HWdJyRb9bDJM.rz74RWI2CEcC4akWENqa8gAKvUBKV0RXAvB.R7TT02FdqyRpdN8I_
	1YpS1KlQrN7K8.MaHpAyKKianu8pEVq9LLDSfTBAmNWrEI6pzxu1nFkFzFUfpUazImPDurTAazfZ
	LkmrlQb4FAcTE9LAq5XLvmlw7_RlyF7qyvvqc7AiJfZMhZBlR6sdp4AhYMJdfahJod79pj2ZOpmk
	NR0XvTy96K32HTLyLhjOHQKW38vYBKVHQyX03nqkOxgJANJsBkZI3IIZHzPPuXE4CS9.e7tmZjOA
	SOVHOiUQTUG.Fo4HipJZZMwMr.8zHEH10qmGyK_mG9d7EopD3WHsid3PkDuH9znObwqH6ItJHmmL
	Qjm.qZsvVEuXPWRdnfIxW_iI4gN_oQB6CkYp6Nb6ipcESLbQm2GTsI5DfOWhzgZEwV.RcI7lUmUC
	uH2Qwa0SnQJfGwyqDHMjMBQ--
Received: from jws10682.mail.bf1.yahoo.com by sendmailws110.mail.bf1.yahoo.com;
	Thu, 30 Jun 2016 18:20:44 +0000; 1467310844.820
Date: Thu, 30 Jun 2016 18:20:44 +0000 (UTC)
From: Leslie S Satenstein <lsatenstein@yahoo.com>
Reply-To: Leslie S Satenstein <lsatenstein@yahoo.com>
To: "coreutils@gnu.org" <coreutils@gnu.org>
Message-ID: <2116973924.4430297.1467310844360.JavaMail.yahoo@mail.yahoo.com>
In-Reply-To: <5772259E.7000209@mag-net.sk>
References: <57717857.8040204@mag-net.sk> <577180E9.3070800@draigBrady.com>
	<5772259E.7000209@mag-net.sk>
Subject: Date   suggestion for improvement
MIME-Version: 1.0
Content-Length:  719
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 98.139.212.166
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Jun 2016 18:20:53 -0000

It would be useful if the Date routine had a way to indicate the number of =
weeks since the linux=20
day 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Yes, there is the number if seconds sin=
ce then, but with +%J (J is available) we could get the number of days and =
the number of weeks since 1 January 1970.
For example, with this weekno information, a job can be scheduled to run ev=
ery second week by just looking at whether the weekno was even or odd.
The ISO or US weeknumber routines have problems at End-of-Year, as some wee=
k numbers may be 52 or 53.=C2=A0 This weekno variance breaks down if jobs m=
ust run bi-weekly=20


=C2=A0Regards=20
=C2=A0Leslie
 Mr. Leslie Satenstein
Montr=C3=A9al Qu=C3=A9bec, Canada






  

