From MAILER-DAEMON Tue Aug 01 04:02:09 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dcS81-0002BP-5I
	for mharc-coreutils@gnu.org; Tue, 01 Aug 2017 04:02:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37423)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dcS7y-0002B4-Qh
	for coreutils@gnu.org; Tue, 01 Aug 2017 04:02:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dcS7u-0002BV-Ox
	for coreutils@gnu.org; Tue, 01 Aug 2017 04:02:06 -0400
Received: from mx1.redhat.com ([209.132.183.28]:56948)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1dcS7u-0002BH-Iw
	for coreutils@gnu.org; Tue, 01 Aug 2017 04:02:02 -0400
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
	[10.5.11.14])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 76DCB14564C;
	Tue,  1 Aug 2017 08:02:01 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 76DCB14564C
Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 457A467C87;
	Tue,  1 Aug 2017 08:02:01 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: coreutils@gnu.org, Josef Cejka <jcejka@suse.com>,
	Philipp Thomas <pth@suse.de>
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
Date: Tue, 01 Aug 2017 10:02:07 +0200
Message-ID: <8449588.0gYHzZvQaU@kdudka-nb>
User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; )
In-Reply-To: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.30]);
	Tue, 01 Aug 2017 08:02:01 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 01 Aug 2017 08:02:07 -0000

On Tuesday, August 01, 2017 01:54:56 Bernhard Voelker wrote:
> The attached fixes a hang for unaccessible NFS mounts which
> are automounted by systemd.

The summary mentions 'df -l', which is mapped to the show_local_fs flag.  
However, the condition you are adding does not use the flag at all.  Why?

The condition already contains a special handling for 'df -l':

    (me->me_remote && show_local_fs)

Why does not it work without your patch?

How exactly looks the mount entry you want to skip the stat() call for?

What is the full content of *me in this case?

Is there a good reason for http://bugzilla.suse.com/show_bug.cgi?id=1043059 
not being accessible for free?

Kamil

> See e.g.
>   http://blog.tomecek.net/post/automount-with-systemd/
> for how to configure such a systemd unit to reproduce.
> 
> Do we need a test case for this?
> 
> Have a nice day,
> Berny


From MAILER-DAEMON Tue Aug 01 09:29:05 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dcXEP-0000JQ-89
	for mharc-coreutils@gnu.org; Tue, 01 Aug 2017 09:29:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52051)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dcXEM-0000Ix-1H
	for coreutils@gnu.org; Tue, 01 Aug 2017 09:29:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dcXEH-0006iv-TF
	for coreutils@gnu.org; Tue, 01 Aug 2017 09:29:02 -0400
Received: from mout.kundenserver.de ([212.227.126.131]:55622)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dcXEH-0006hn-Ht
	for coreutils@gnu.org; Tue, 01 Aug 2017 09:28:57 -0400
Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de
	(mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0LgKx6-1dHYOw34JY-00ng3M; Tue, 01 Aug 2017 15:28:14 +0200
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
To: Kamil Dudka <kdudka@redhat.com>
Cc: coreutils@gnu.org, Josef Cejka <jcejka@suse.com>,
	Philipp Thomas <pth@suse.de>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
	<8449588.0gYHzZvQaU@kdudka-nb>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <ec23656c-d679-22b1-333a-a497d4ccf812@bernhard-voelker.de>
Date: Tue, 1 Aug 2017 15:28:11 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <8449588.0gYHzZvQaU@kdudka-nb>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:HAJrTwPHK0VQParMJf3Vp0C/y7B286zv8WQCE+qCjggLQW1NdLk
	I+xQc23wChbKoRYyCxhIt0WhIXPrKt6UGSaHO8GLvEWuGLFGM44PGb6FHv/kKGOnRPZx38v
	rfvoqKgpbT94BXFP8tVK39MIGYFwDIR45kEJOte2kQYeU8PFcLobUVjNR2BS+1SxAC8QB0p
	wFwconRE+aw6+wygS740Q==
X-UI-Out-Filterresults: notjunk:1;V01:K0:xFjxNHq7wDc=:rQZIJbiGMsx0ujzPX86ABT
	wGQDn1OVYu268d6CfQSc2r/tjgatpdqwlGrnCNxdzgTvf9yAoDTyrIIPkXSbqQzwjo3XNxSOW
	rBKlzq/ZnokA/zJoIOx+LyOfSrM87u/ejEH/gmEMoNUDffZW35q/DsC6AARf+olWJWQc8ZisQ
	FsPv7JYlTFasNHJ9S79YMQLn7z4E8Y0Tyb98g8qSIyJMBVYfn2OT6YgL2kPg1bPTc35LtN64l
	lGI0RH0AQpKWkOHfs74kPcLIM/sGejLOCoWuyZLQ5MZZE64s9OdNr4NMQyGu14qeBcZsX8lP/
	WRKqRh54hsUXFB+QFZzAY+Q/KRUb2MAoSoVDx367ZG3hoWShadw9wk3aI3PWAFbGCwZ1cf+0A
	FyLpxGm4hLaB5ZMTSv1Rw5OK4huKTICwVUbxxS+/QDhEgqQ84KNX/I3ZKkHcw9Z3jhvWb/73n
	ROHDhoAR6hqQal1y0fdKzQ+MlT6X4xySdhWxtkG0pllrRGMbJen4woQ0BB6IZQz37I+7SIWq2
	SpQulG+X4GK3yYXoqBC0yrWIpEgJGIpCged5vW8n2+sACakBr780KX46QQ/2UzKVYcQQ9wMF6
	2fZAxI5X9e/WVkViyq1cgt8fte3/VraOLJaShV6DEXljrI9MKs7a0Xo3h20Bt69iSJX2vNuXs
	mP97wzCca9FUurVKCjYtRGZ7qjL7HGJ2jM/BXkA2+baMFCnvge90kfCGdIyraRwVGZC/tukMd
	Y772ZhyJHgEKjWWfzt4zzxCEOOT1YnfDGWIpWphADkGYnYw2/K9ykBxz0o0=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.131
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, 01 Aug 2017 13:29:03 -0000

On 08/01/2017 10:02 AM, Kamil Dudka wrote:
> On Tuesday, August 01, 2017 01:54:56 Bernhard Voelker wrote:
>> The attached fixes a hang for unaccessible NFS mounts which
>> are automounted by systemd.
> 
> The summary mentions 'df -l', which is mapped to the show_local_fs flag.  
> However, the condition you are adding does not use the flag at all.  Why?
> 
> The condition already contains a special handling for 'df -l':
> 
>     (me->me_remote && show_local_fs)
> 
> Why does not it work without your patch?

I admit the relation is not so obvious so I tried to explain in the
commit message.

The point is that the mount point of the systemd.automount(5)
is of type "autofs" (where me_dummy=true), and when it would be accessed,
then systemd would over-mount the same mount point with the remote
NFS file system.

Now I think df(1) should not necessarily trigger to automount file systems,
regardless wether they are local or remote.

The new condition therefore avoid the stat() on dummy file systems (which
includes the "autofs" entry of the systemd automounter), and uses the same
condition as that which filters out dummy entries anyway in get_dev().
In effect, this prevents to trigger the automounting.
If the remote file system is mounted, then the existing condition
prevents to stat() it for the -l case.

> How exactly looks the mount entry you want to skip the stat() call for?

133 59 0:43 / /mnt/scratch rw,relatime shared:77 - autofs systemd-1 rw,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct

> What is the full content of *me in this case?

Sorry, I don't have access to my other test system, but I hope the above
explains enough.

> Is there a good reason for http://bugzilla.suse.com/show_bug.cgi?id=1043059 
> not being accessible for free?

Well, it's a bug against SLES12sp2, and some customers don't seem to want
those being visible to everybody.  I (as openSUSE co-maintainer) can only
see it because I was asked if the patch could be included upstreams.  I'm
not sure I could make it available for you.  Josef could probably.

Thanks & Have a nice day,
Berny


From MAILER-DAEMON Tue Aug 01 10:56:13 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dcYaj-0008Uf-QX
	for mharc-coreutils@gnu.org; Tue, 01 Aug 2017 10:56:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58809)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dcYah-0008Sg-Ht
	for coreutils@gnu.org; Tue, 01 Aug 2017 10:56:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dcYad-0003IJ-AP
	for coreutils@gnu.org; Tue, 01 Aug 2017 10:56:11 -0400
Received: from mx1.redhat.com ([209.132.183.28]:56003)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1dcYad-0003Ga-1u
	for coreutils@gnu.org; Tue, 01 Aug 2017 10:56:07 -0400
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com
	[10.5.11.16])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 9B76C5B487;
	Tue,  1 Aug 2017 14:49:31 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B76C5B487
Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 52CF961781;
	Tue,  1 Aug 2017 14:49:31 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: coreutils@gnu.org, Philipp Thomas <pth@suse.de>,
	Josef Cejka <jcejka@suse.com>
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
Date: Tue, 01 Aug 2017 16:49:37 +0200
Message-ID: <2367380.BZzy41pyIT@kdudka-nb>
User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; )
In-Reply-To: <ec23656c-d679-22b1-333a-a497d4ccf812@bernhard-voelker.de>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
	<8449588.0gYHzZvQaU@kdudka-nb>
	<ec23656c-d679-22b1-333a-a497d4ccf812@bernhard-voelker.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.27]);
	Tue, 01 Aug 2017 14:49:31 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 01 Aug 2017 14:56:12 -0000

On Tuesday, August 01, 2017 15:28:11 Bernhard Voelker wrote:
> On 08/01/2017 10:02 AM, Kamil Dudka wrote:
> > On Tuesday, August 01, 2017 01:54:56 Bernhard Voelker wrote:
> >> The attached fixes a hang for unaccessible NFS mounts which
> >> are automounted by systemd.
> > 
> > The summary mentions 'df -l', which is mapped to the show_local_fs flag.
> > However, the condition you are adding does not use the flag at all.  Why?
> > 
> > The condition already contains a special handling for 'df -l':
> >     (me->me_remote && show_local_fs)
> > 
> > Why does not it work without your patch?
> 
> I admit the relation is not so obvious so I tried to explain in the
> commit message.
> 
> The point is that the mount point of the systemd.automount(5)
> is of type "autofs" (where me_dummy=true), and when it would be accessed,
> then systemd would over-mount the same mount point with the remote
> NFS file system.
> 
> Now I think df(1) should not necessarily trigger to automount file systems,
> regardless wether they are local or remote.
> 
> The new condition therefore avoid the stat() on dummy file systems (which
> includes the "autofs" entry of the systemd automounter), and uses the same
> condition as that which filters out dummy entries anyway in get_dev().
> In effect, this prevents to trigger the automounting.
> If the remote file system is mounted, then the existing condition
> prevents to stat() it for the -l case.

If I understand it correctly, your patch takes effect regardless the use
of -l option.  Then please remove it from the summary to make it clear.

The optimized-out stat() call is, however, not the only change done by
your commit.  It has a side-effect that is observable from df's output
(and completely unrelated to autofs or remote file systems).  At first
glance, the side-effect looks useful but it should be properly analyzed
and documented...

Consider the following example:

# mount -t proc none /opt
# mount -t tmpfs none /opt

Now unpached df does not list the /opt entry:

# df | grep opt

... but after your patch, it does:

# df | grep opt
none             2005384        0   2005384   0% /opt

Note that it was important that I have used the same "device" in both
the mount commands.

Kamil

> > How exactly looks the mount entry you want to skip the stat() call for?
> 
> 133 59 0:43 / /mnt/scratch rw,relatime shared:77 - autofs systemd-1
> rw,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct
> > What is the full content of *me in this case?
> 
> Sorry, I don't have access to my other test system, but I hope the above
> explains enough.
> 
> > Is there a good reason for
> > http://bugzilla.suse.com/show_bug.cgi?id=1043059
> > not being accessible for free?
> 
> Well, it's a bug against SLES12sp2, and some customers don't seem to want
> those being visible to everybody.  I (as openSUSE co-maintainer) can only
> see it because I was asked if the patch could be included upstreams.  I'm
> not sure I could make it available for you.  Josef could probably.
> 
> Thanks & Have a nice day,
> Berny


From MAILER-DAEMON Tue Aug 01 16:19:46 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dcddq-00084e-6c
	for mharc-coreutils@gnu.org; Tue, 01 Aug 2017 16:19:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45345)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1dcddm-00083G-Kd
	for coreutils@gnu.org; Tue, 01 Aug 2017 16:19:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1dcddi-0002xW-JA
	for coreutils@gnu.org; Tue, 01 Aug 2017 16:19:42 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:40522)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1dcddi-0002wN-9A
	for coreutils@gnu.org; Tue, 01 Aug 2017 16:19:38 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 712C5160710;
	Tue,  1 Aug 2017 13:19:35 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id qtEXlc0AGqEa; Tue,  1 Aug 2017 13:19:33 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id E3C191606F8;
	Tue,  1 Aug 2017 13:19:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id d2W0rMwMHEJP; Tue,  1 Aug 2017 13:19:33 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.184.153])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C024916006C;
	Tue,  1 Aug 2017 13:19:33 -0700 (PDT)
Subject: Re: [PATCH 3/4] copy: make backup files more reliably
To: Kamil Dudka <kdudka@redhat.com>
Cc: coreutils@gnu.org
References: <1501460347-19275-1-git-send-email-eggert@cs.ucla.edu>
	<1501460347-19275-3-git-send-email-eggert@cs.ucla.edu>
	<1552189.DO5DapkadM@kdudka-nb>
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
Message-ID: <0c6633cb-36d4-04b1-0daa-8861bf776e67@cs.ucla.edu>
Date: Tue, 1 Aug 2017 13:19:33 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <1552189.DO5DapkadM@kdudka-nb>
Content-Type: multipart/mixed; boundary="------------279F40F7C84160CF06B38E03"
Content-Language: en-US
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 01 Aug 2017 20:19:44 -0000

This is a multi-part message in MIME format.
--------------279F40F7C84160CF06B38E03
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Kamil Dudka wrote:
> If the user
> explicitly asks for a simple backup, cp should either make a single
> backup or fail honestly if the simple backup cannot be made.

Fair enough. I installed the attached additional patch to do that. Althou=
gh this=20
reintroduces a race, I guess we've lived with the race for quite some tim=
e.

--------------279F40F7C84160CF06B38E03
Content-Type: text/x-patch;
 name="0001-copy-go-back-to-failing-cp-backup-a-a.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="0001-copy-go-back-to-failing-cp-backup-a-a.patch"

=46rom 929501623820b8d2e4995542ededf2eebbb32894 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 1 Aug 2017 13:14:03 -0700
Subject: [PATCH] copy: go back to failing 'cp --backup a~ a'

Suggested by Kamil Dudka in:
http://lists.gnu.org/archive/html/coreutils/2017-07/msg00072.html
* NEWS: Document the changed nature of the fix.
* doc/coreutils.texi, tests/cp/backup-is-src.sh:
* tests/mv/backup-is-src.sh: Revert previous change.
* src/copy.c (source_is_dst_backup): New function.
(copy_internal): Use it.  Fail instead of falling back on numbered
backups when it looks like the backup will overwrite the source.
Although this reintroduces a race, it's more compatible with
previous behavior.
---
 NEWS                      |  6 +++---
 doc/coreutils.texi        | 18 ++++++++----------
 src/copy.c                | 48 +++++++++++++++++++++++++++++++++++------=
------
 tests/cp/backup-is-src.sh | 16 +++++++++-------
 tests/mv/backup-is-src.sh | 23 +++++++++++++++--------
 5 files changed, 71 insertions(+), 40 deletions(-)

diff --git a/NEWS b/NEWS
index 13bbc96..eb0c0dc 100644
--- a/NEWS
+++ b/NEWS
@@ -15,10 +15,10 @@ GNU coreutils NEWS                                   =
 -*- outline -*-
   later, the races are still present on other platforms.
   [the bug dates back to the initial implementation]
=20
-  cp, install, ln, and mv now use a numbered instead of a simple
-  backup if copying a backup file to what might be its original.
+  cp, install, ln, and mv no longer lose data when asked to copy a
+  backup file to its original via a differently-spelled file name.
   E.g., 'rm -f a a~; : > a; echo data > a~; cp --backup=3Dsimple a~ ./a'=

-  now makes a numbered backup file instead of losing the data.
+  now fails instead of losing the data.
   [the bug dates back to the initial implementation]
=20
   cp, install, ln, and mv now ignore nonsensical backup suffixes.
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8c4746e..77e993e 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -865,19 +865,17 @@ Never make backups.
 @opindex numbered @r{backup method}
 Always make numbered backups.
=20
-@item simple
-@itemx never
-@opindex simple @r{backup method}
-Make simple backups, except make a numbered backup if the source might
-be a simple backup of the destination; this avoids losing source data.
-Please note @samp{never} is not to be confused with @samp{none}.
-
 @item existing
 @itemx nil
 @opindex existing @r{backup method}
-Make numbered backups of files that already have them, or if the source
-might be a simple backup of the destination.
-Otherwise, make simple backups.
+Make numbered backups of files that already have them, simple backups
+of the others.
+
+@item simple
+@itemx never
+@opindex simple @r{backup method}
+Always make simple backups.  Please note @samp{never} is not to be
+confused with @samp{none}.
=20
 @end table
=20
diff --git a/src/copy.c b/src/copy.c
index 263abc1..9a30e16 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1806,6 +1806,29 @@ should_dereference (const struct cp_options *x, bo=
ol command_line_arg)
              && command_line_arg);
 }
=20
+/* Return true if the source file with basename SRCBASE and status SRC_S=
T
+   is likely to be the simple backup file for DST_NAME.  */
+static bool
+source_is_dst_backup (char const *srcbase, struct stat const *src_st,
+                      char const *dst_name)
+{
+  size_t srcbaselen =3D strlen (srcbase);
+  char const *dstbase =3D last_component (dst_name);
+  size_t dstbaselen =3D strlen (dstbase);
+  size_t suffixlen =3D strlen (simple_backup_suffix);
+  if (! (srcbaselen =3D=3D dstbaselen + suffixlen
+         && memcmp (srcbase, dstbase, dstbaselen) =3D=3D 0
+         && STREQ (srcbase + dstbaselen, simple_backup_suffix)))
+    return false;
+  size_t dstlen =3D strlen (dst_name);
+  char *dst_back =3D xmalloc (dstlen + suffixlen + 1);
+  strcpy (mempcpy (dst_back, dst_name, dstlen), simple_backup_suffix);
+  struct stat dst_back_sb;
+  int dst_back_status =3D stat (dst_back, &dst_back_sb);
+  free (dst_back);
+  return dst_back_status =3D=3D 0 && SAME_INODE (*src_st, dst_back_sb);
+}
+
 /* Copy the file SRC_NAME to the file DST_NAME.  The files may be of
    any type.  NEW_DST should be true if the file DST_NAME cannot
    exist because its parent directory was just created; NEW_DST should
@@ -2081,23 +2104,24 @@ copy_internal (char const *src_name, char const *=
dst_name,
                  existing hierarchy.  */
               && (x->move_mode || ! S_ISDIR (dst_sb.st_mode)))
             {
-              /* Silently use numbered backups if creating the backup
-                 file might destroy the source file.  Otherwise, the com=
mands:
+              /* Fail if creating the backup file would likely destroy
+                 the source file.  Otherwise, the commands:
                  cd /tmp; rm -f a a~; : > a; echo A > a~; cp --b=3Dsimpl=
e a~ a
                  would leave two zero-length files: a and a~.  */
-              enum backup_type backup_type =3D x->backup_type;
-              if (backup_type !=3D numbered_backups)
+              if (x->backup_type !=3D numbered_backups
+                  && source_is_dst_backup (srcbase, &src_sb, dst_name))
                 {
-                  size_t srcbaselen =3D strlen (srcbase);
-                  char const *dstbase =3D last_component (dst_name);
-                  size_t dstbaselen =3D strlen (dstbase);
-                  if (srcbaselen =3D=3D dstbaselen + strlen (simple_back=
up_suffix)
-                      && memcmp (srcbase, dstbase, dstbaselen) =3D=3D 0
-                      && STREQ (srcbase + dstbaselen, simple_backup_suff=
ix))
-                    backup_type =3D numbered_backups;
+                  const char *fmt;
+                  fmt =3D (x->move_mode
+                 ? _("backing up %s would destroy source;  %s not moved"=
)
+                 : _("backing up %s would destroy source;  %s not copied=
"));
+                  error (0, 0, fmt,
+                         quoteaf_n (0, dst_name),
+                         quoteaf_n (1, src_name));
+                  return false;
                 }
=20
-              char *tmp_backup =3D backup_file_rename (dst_name, backup_=
type);
+              char *tmp_backup =3D backup_file_rename (dst_name, x->back=
up_type);
=20
               /* FIXME: use fts:
                  Using alloca for a file name that may be arbitrarily
diff --git a/tests/cp/backup-is-src.sh b/tests/cp/backup-is-src.sh
index 8077106..3e4a79f 100755
--- a/tests/cp/backup-is-src.sh
+++ b/tests/cp/backup-is-src.sh
@@ -20,15 +20,17 @@
 print_ver_ cp
=20
 echo a > a || framework_failure_
-cp a a0 || framework_failure_
 echo a-tilde > a~ || framework_failure_
-cp a~ a~0 || framework_failure_
=20
-# This cp command should not trash the source.
-cp --b=3Dsimple a~ ./a > out 2>&1 || fail=3D1
+# This cp command should exit nonzero.
+cp --b=3Dsimple a~ a > out 2>&1 && fail=3D1
=20
-compare a~0 a || fail=3D1
-compare a~0 a~ || fail=3D1
-compare a0 a.~1~ || fail=3D1
+sed "s,cp:,XXX:," out > out2
+
+cat > exp <<\EOF
+XXX: backing up 'a' would destroy source;  'a~' not copied
+EOF
+
+compare exp out2 || fail=3D1
=20
 Exit $fail
diff --git a/tests/mv/backup-is-src.sh b/tests/mv/backup-is-src.sh
index c1310de..04e9f7c 100755
--- a/tests/mv/backup-is-src.sh
+++ b/tests/mv/backup-is-src.sh
@@ -22,18 +22,25 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_srcdir/tests/other-fs-tmpdir"
=20
 a=3D"$other_partition_tmpdir/a"
-a2=3D"$other_partition_tmpdir/./a~"
+a2=3D"$other_partition_tmpdir/a~"
=20
-rm -f "$a" "$a2" a20 || framework_failure_
+rm -f "$a" "$a2" || framework_failure_
 echo a > "$a" || framework_failure_
-cp "$a" a0 || framework_failure_
 echo a2 > "$a2" || framework_failure_
-cp "$a2" a20 || framework_failure_
=20
-# This mv command should not trash the source.
-mv --b=3Dsimple "$a2" "$a" > out 2>&1 || fail=3D1
+# This mv command should exit nonzero.
+mv --b=3Dsimple "$a2" "$a" > out 2>&1 && fail=3D1
=20
-compare a20 "$a" || fail=3D1
-compare a0 "$a.~1~" || fail=3D1
+sed \
+   -e "s,mv:,XXX:," \
+   -e "s,$a,YYY," \
+   -e "s,$a2,ZZZ," \
+  out > out2
+
+cat > exp <<\EOF
+XXX: backing up 'YYY' would destroy source;  'ZZZ' not moved
+EOF
+
+compare exp out2 || fail=3D1
=20
 Exit $fail
--=20
2.7.4


--------------279F40F7C84160CF06B38E03--


From MAILER-DAEMON Wed Aug 02 02:10:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dcmre-00006V-IT
	for mharc-coreutils@gnu.org; Wed, 02 Aug 2017 02:10:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37857)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dcmrc-00006E-UZ
	for coreutils@gnu.org; Wed, 02 Aug 2017 02:10:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dcmrY-0004TK-04
	for coreutils@gnu.org; Wed, 02 Aug 2017 02:10:36 -0400
Received: from mout.kundenserver.de ([212.227.17.24]:49770)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dcmrX-0004Sa-L5
	for coreutils@gnu.org; Wed, 02 Aug 2017 02:10:31 -0400
Received: from [192.168.101.10] ([91.12.166.234]) by mrelayeu.kundenserver.de
	(mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id
	0M1Wqf-1dNAop0cXp-00tTmr; Wed, 02 Aug 2017 08:10:14 +0200
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
To: Kamil Dudka <kdudka@redhat.com>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
	<8449588.0gYHzZvQaU@kdudka-nb>
	<ec23656c-d679-22b1-333a-a497d4ccf812@bernhard-voelker.de>
	<2367380.BZzy41pyIT@kdudka-nb>
Cc: Philipp Thomas <pth@suse.de>, Josef Cejka <jcejka@suse.com>,
	coreutils@gnu.org
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <ad80e36d-2d57-ca79-463f-aa8ecae71e5d@bernhard-voelker.de>
Date: Wed, 2 Aug 2017 08:10:11 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <2367380.BZzy41pyIT@kdudka-nb>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:2r4gVy0+YhUatsb0AICRjLdQapdGkTiAws2zrR76rnz0HL68yOR
	wr31rB7XW/wRR0skUFIDGu4VBL78cyHA9PbglBg3+Zp8iVB3M9Sj61q6p8oi7zW4KeMjtCQ
	neyGgFWESgcFc56eED3VkeC0a8mp8ic5RHNu+jQcqAz0xTuFlCquBN+xzWrlMFJeawpkh5+
	6KB4+N+eH0U3zH0lHS/Aw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:9M5v+/09GIk=:78SR5CAsBVKi8AEZFmRf0G
	/aHPmzVmp9+5xpDulODAKNckLY+JHJz1XvVGs6METfZ85QWLwZLoIPwmg9fyADN50jK1O+eI6
	y/GvV3PgDV1yUd7iE38jkWAB53hRab6TvCCorwhQBggDS5YwzlaA7xLHUK6n6iT2xYyo3GDWQ
	RS/Tfx4eDqFrA4Y9AKAFcZZHynq/9Gbh99YwseMZpw8gz/Sr19wka+7ODdK4SBpi1WywRjyLT
	rvfSF03mb2w23nIcfK///cx6RdV+lFnXQvF+765nVNpk+xXCpYxLLKq9cXdl58YpY6ozPU0vb
	wMjzAje5iJ+Iju/9OfydZpBMif3E0rklDPqgdBZL8zQCgab4ZBVkb3y9EJRs6kcziFEDGyYZD
	62Q+mA7Kasl072nmyejJphY3Z/JRYPk0dMw5GTOu9/pTKzg4ZSWNOrIRpYtu2kY1U+tZfyMpD
	EBXVOx/O7pk6i06IG9Cftwugnby7m1DTk7G6Nemr1crusdnpBqXVDOdVhZSNmBcVswuJL8IIc
	PD+F4GjNhpSuPOs3W0qlzpyqLKTQN59WvsvnIamLkbsLjXK+kWpUJpop1E8rAapPCQpiiBhx0
	2R8dlLAApftrnjQTElhUBbIQ7Ttz1Nr0N/JchbSkaWykzq/YzHEdFoa8tvdafG9W/d237s/8F
	uwIFz3/EvKNlSAR2WtPiMMADcVRt81A/Ke0V1jIE4dZ56MZhrWJxbSx1aEAbeP7nJLvuJS2Wq
	Kw6gBCG8coYl68Olthg43ZDam+rLaMzgYWDYXrJul/bHQivAxX0j1Uem8CU=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.17.24
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, 02 Aug 2017 06:10:37 -0000

On 08/01/2017 04:49 PM, Kamil Dudka wrote:
> If I understand it correctly, your patch takes effect regardless the use
> of -l option.  Then please remove it from the summary to make it clear.
> 
> The optimized-out stat() call is, however, not the only change done by
> your commit.  It has a side-effect that is observable from df's output
> (and completely unrelated to autofs or remote file systems).  At first
> glance, the side-effect looks useful but it should be properly analyzed
> and documented...
> 
> Consider the following example:
> 
> # mount -t proc none /opt
> # mount -t tmpfs none /opt
> 
> Now unpached df does not list the /opt entry:
> 
> # df | grep opt
> 
> ... but after your patch, it does:
> 
> # df | grep opt
> none             2005384        0   2005384   0% /opt
> 
> Note that it was important that I have used the same "device" in both
> the mount commands.

hmm, adding that little condition was too tempting - as there is the
same one later on in get_dev(). ;-/

This sounds like there is another bug to fix in filter_mount_list
wrt over-mounting.
Maybe it should process the entries from /proc/self/mountinfo from
the end instead of the beginning: by this it would be easier to filter
out over-mounted file systems.

WDYT?

Have a nice day,
Berny



From MAILER-DAEMON Wed Aug 02 03:13:42 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dcnqg-0004ox-69
	for mharc-coreutils@gnu.org; Wed, 02 Aug 2017 03:13:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38348)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <raajeshdasari@gmail.com>) id 1dcmsY-0000Q7-G6
	for coreutils@gnu.org; Wed, 02 Aug 2017 02:11:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <raajeshdasari@gmail.com>) id 1dcmsU-0004w1-HU
	for coreutils@gnu.org; Wed, 02 Aug 2017 02:11:34 -0400
Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:36263)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <raajeshdasari@gmail.com>)
	id 1dcmsU-0004tS-AU
	for coreutils@gnu.org; Wed, 02 Aug 2017 02:11:30 -0400
Received: by mail-oi0-x231.google.com with SMTP id g131so35420061oic.3
	for <coreutils@gnu.org>; Tue, 01 Aug 2017 23:11:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=kxWzpYb49uttVGyOwv5wfotwk/siJSRhI+QDwRum23U=;
	b=WWY6FE5ntJeawRWHewa3FZVC5SMFIVuWD7SZ8DqpoB7kEGoVuMlZlgF83lVFq0afSO
	59+U+orVEYy9XnhryVvBPJCi5isNfhhRPJ1s2PDrPKbKRtL3umBTJpfehO4pWkSnpAPm
	aaAM8r5XnkhOLpxBQB4coXGAwxmjrAyTRdczaJRGYEZEUoFsep+HQUY3auCwDIYHO+Lk
	t6FbAkHn34jWUYM015af9O9qDlulhVEYsQAw3fFP+5JR57jMR/GbBzdINnxKDszek8su
	fjd06RJOAb73fi9aI9VgxnTAeJK/F21W0ta3bFCxWfShRFLZcg95FCBUSWqMlyVMx31C
	nkjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=kxWzpYb49uttVGyOwv5wfotwk/siJSRhI+QDwRum23U=;
	b=rUchHI4TlZM1cskGl/bXNzelsD1KdMB73VDNffBLMiKCNz2KxE8FQSOmcK7iPq1w/K
	wR02i12+brZABt5zzzeuP3OMZRV8eXe2rWy28TVVHjITb2hvEn3cHKoJDTo1LMIOwrMj
	y4guz9McwJ06cyoIqSRnvFlPK5mitFzxaJbVergRF1Tloph+T7mAItx1XvS5EERV1xeU
	epinvviPwa9SA58cnxVr/7+6R/tVEyLh2wnY+8Jz9YqmeHIuwMLMEOuOjpBTRD2MrsMM
	0gHbbCoOmTT7O3GgX+QAajmNUeiJeNWaDSgb8pownwjRaogbS3eV5k7tUXUb7K6sBcug
	J99A==
X-Gm-Message-State: AIVw111u6Ke5Worsd73jPBna2oq2AnnKiV7hJ8Mhf1WJO467/wZ5lns7
	jhw1Z9LQ2qn2HB1L3ExW63jUJysbgdNx
X-Received: by 10.202.170.21 with SMTP id t21mr23834995oie.224.1501654287653; 
	Tue, 01 Aug 2017 23:11:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.182.165.129 with HTTP; Tue, 1 Aug 2017 23:11:27 -0700 (PDT)
From: RAJESH DASARI <raajeshdasari@gmail.com>
Date: Wed, 2 Aug 2017 11:41:27 +0530
Message-ID: <CAPXMrf8uSSyB---HLSXpeyk6tHJzQ7kcSY41TgS2ehmYHdBp7Q@mail.gmail.com>
Subject: Backspace is not working in a chroot environment
To: coreutils@gnu.org
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c06::231
X-Mailman-Approved-At: Wed, 02 Aug 2017 03:13:40 -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: Wed, 02 Aug 2017 06:11:35 -0000

Hi ,

I did chroot on my environment and  after i switched to the chrooted
directory ,backspace key is not working properly , when i enter
backspace it is taken  as a "space".


shell i used was bash.On normal bash shell backspace is working fine.
when i chroot it is not working.

 $TERM
bash: xterm-256color

I tried to debug with strace , i see that when i press enter it is read as \177.

pselect6(1, [0], NULL, NULL, NULL, {[], 16}) = 1 (in [0])
read(0, "\177", 1)                      = 1
write(2, "\7", 1)                       = 1


Could some one please help me on this , is this any known issue ? or
any environment setting is needed to fix this .

Thanks,
Rajesh.


From MAILER-DAEMON Wed Aug 02 17:28:42 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dd1C6-0000uv-IR
	for mharc-coreutils@gnu.org; Wed, 02 Aug 2017 17:28:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44777)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dd1C3-0000ss-Q0
	for coreutils@gnu.org; Wed, 02 Aug 2017 17:28:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dd1By-0004eU-SV
	for coreutils@gnu.org; Wed, 02 Aug 2017 17:28:39 -0400
Received: from mout.kundenserver.de ([212.227.126.135]:57262)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dd1By-0004dZ-IQ
	for coreutils@gnu.org; Wed, 02 Aug 2017 17:28:34 -0400
Received: from [192.168.101.10] ([91.12.166.234]) by mrelayeu.kundenserver.de
	(mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0MdTLH-1duGn81ZRr-00IQhZ; Wed, 02 Aug 2017 23:28:21 +0200
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
To: Kamil Dudka <kdudka@redhat.com>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
	<8449588.0gYHzZvQaU@kdudka-nb>
	<ec23656c-d679-22b1-333a-a497d4ccf812@bernhard-voelker.de>
	<2367380.BZzy41pyIT@kdudka-nb>
Cc: Philipp Thomas <pth@suse.de>, Josef Cejka <jcejka@suse.com>,
	coreutils@gnu.org
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <fa782c92-9c84-4902-37c2-bfb9b5c9c037@bernhard-voelker.de>
Date: Wed, 2 Aug 2017 23:28:18 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <2367380.BZzy41pyIT@kdudka-nb>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:3QJw7kW4xKMkyM5cdVR8RHpvuGaPT40TdkregReKlZvEXta0mGi
	Jb2QJ4qODmw/AnxFz5nEQhx+RnW+NKsE3lAjibs0jhb4TOm2eJgH5BVblo+rXdHMYGaDaG0
	4XJGtmDQgQD5nICpE5rTsEfXHdG6vxwjhzBUrXja/eTEUVmVJO32oOuXHfyHFUPHhRAHzo5
	2eX8S1sHZhaYHdOnjF7Yg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:XHT7Kou2veg=:pEBH6pq2Hu5Iejt7Gii/AX
	Q+rKm8ppNq/ys/sKuwNXRKcZqRbc1tNJaMoKcjhrCg9IAGK5bZIBlQETVN7VZey3FROw77/X7
	1wkuvrp27MKejCtRqpZl+rRNaG3DQ0GiYzrqXvA2Mk8Q9Vfb8Vh6l0R4EqsBf9g2+wlrqtFaa
	jsxd9fuIQB+y/s6jy0icgq6dSWXibBZe25wMjLwH6rr/NvP8pk0+1zBKHxEAxRw4pJaRNJ6rl
	ORuXhXdGP+RVCOSGeae6iIDmNK9J/lm8A6fD432j8oRAAhpupnArxxsmmu/cGLuOIYm5oOhgv
	zf6ixIu83hHFeSsa4xWx8QdRKHZEs+NI3pt8Jx/4wwseu28qO1oQPjZZGCD8rtOVbi0ufwlXl
	D/Z0JEDizIqAYdIx5+jAH+8N8CUc+/I8lDpUN05WSFbtinAE3ifbvvVFHJ0KEksBtb5f6uZ25
	igIjXfo7d3M2R0PWSq6NiwUhLSUh0g3PNn9YLTh1vSjar+5iPy7++h8bAplBDuRxu0MjniDdn
	V6dAEDuqnQb34E1BVL79X1IDgwUP5DRD7ajNCiozL0WvcB4M0U4sCgyE6oN4ahWMI4edyvapY
	BEWZ8rMikKtdix505mfkoHsRmWQmDclhskwFb101RQX+W89neA3gQQpY+Yyy3e7mSFEjf9h81
	d5x6T0y4QTMGrWUzpsN3JMKU9c5dLW3mMBgUc+/gB0AobIAy+oHknXwobQhK3PXd9vy5Rcbj2
	SQmzRIWx0w1/rTorQSuhysQHzQ+IE4lWpA8Z1ue1kHJTm6CSe3Xl530I5dA=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.135
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, 02 Aug 2017 21:28:41 -0000

On 08/01/2017 04:49 PM, Kamil Dudka wrote:
> Consider the following example:
> 
> # mount -t proc none /opt
> # mount -t tmpfs none /opt
> 
> Now unpached df does not list the /opt entry:
> 
> # df | grep opt
> 
> ... but after your patch, it does:
> 
> # df | grep opt
> none             2005384        0   2005384   0% /opt

[read it again]

hah, that is (another?) df bug because the tmpfs mounted on /opt
should be shown in the default output.
This proves that our tests lack some important cases
WRT over-mounting and suppressing duplicate mounts.

The test 'tests/df/skip-duplicates.sh' has become quite complicated
over the time.  IMO it would be good to simplify that, e.g. by
changing the LD_PRELOAD snippet so that the mtab entries can be
passed via stdin.  By this, each test case could pass it's own
specific test data to df(1).
TBH I'm not sure I will have time for this in the near future.
Anybody else?

Have a nice day,
Berny


From MAILER-DAEMON Thu Aug 03 06:44:46 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddDcU-0001Vg-0N
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 06:44:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40397)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddDcS-0001VS-CO
	for coreutils@gnu.org; Thu, 03 Aug 2017 06:44:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddDcP-0004EB-MN
	for coreutils@gnu.org; Thu, 03 Aug 2017 06:44:44 -0400
Received: from mx1.redhat.com ([209.132.183.28]:50502)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1ddDcP-00047z-G3
	for coreutils@gnu.org; Thu, 03 Aug 2017 06:44:41 -0400
Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com
	[10.5.11.13])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id E234981227;
	Thu,  3 Aug 2017 10:44:37 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E234981227
Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CB5460DD7;
	Thu,  3 Aug 2017 10:44:37 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: coreutils@gnu.org
Subject: Re: [PATCH 3/4] copy: make backup files more reliably
Date: Thu, 03 Aug 2017 12:44:43 +0200
Message-ID: <3721819.B2TXf7IvyQ@kdudka-nb>
User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; )
In-Reply-To: <0c6633cb-36d4-04b1-0daa-8861bf776e67@cs.ucla.edu>
References: <1501460347-19275-1-git-send-email-eggert@cs.ucla.edu>
	<1552189.DO5DapkadM@kdudka-nb>
	<0c6633cb-36d4-04b1-0daa-8861bf776e67@cs.ucla.edu>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.25]);
	Thu, 03 Aug 2017 10:44:38 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Thu, 03 Aug 2017 10:44:45 -0000

On Tuesday, August 01, 2017 13:19:33 Paul Eggert wrote:
> Kamil Dudka wrote:
> > If the user
> > explicitly asks for a simple backup, cp should either make a single
> > backup or fail honestly if the simple backup cannot be made.
> 
> Fair enough. I installed the attached additional patch to do that. Although
> this reintroduces a race, I guess we've lived with the race for quite some
> time.

Still not perfect.  Now it produces false positives with --backup=existing:

% cp --version | head -1
cp (GNU coreutils) 8.27.65-81a05

% touch a
% ln a a~
% cp -v --backup=numbered a~ a                                                              
'a~' -> 'a' (backup: 'a.~1~')

% cp -v --backup=existing a~ a
cp: backing up 'a' would destroy source;  'a~' not copied


As for the test, could it be simplified like this?

--- a/tests/cp/backup-is-src.sh
+++ b/tests/cp/backup-is-src.sh
@@ -25,12 +25,10 @@ echo a-tilde > a~ || framework_failure_
 # This cp command should exit nonzero.
 cp --b=simple a~ a > out 2>&1 && fail=1

-sed "s,cp:,XXX:," out > out2
-
 cat > exp <<\EOF
-XXX: backing up 'a' would destroy source;  'a~' not copied
+cp: backing up 'a' would destroy source;  'a~' not copied
 EOF

-compare exp out2 || fail=1
+compare exp out || fail=1

 Exit $fail


From MAILER-DAEMON Thu Aug 03 06:59:48 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddDr2-0008CG-H0
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 06:59:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57983)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <coreutils@tlinx.org>) id 1ddDr0-0008BQ-00
	for coreutils@gnu.org; Thu, 03 Aug 2017 06:59:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <coreutils@tlinx.org>) id 1ddDqv-0006bX-Ps
	for coreutils@gnu.org; Thu, 03 Aug 2017 06:59:46 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:47890
	helo=Ishtar.sc.tlinx.org)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <coreutils@tlinx.org>) id 1ddDqv-0006VY-CZ
	for coreutils@gnu.org; Thu, 03 Aug 2017 06:59:41 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
	by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
	v73AxV8K091029; Thu, 3 Aug 2017 03:59:33 -0700
Message-ID: <59830213.805@tlinx.org>
Date: Thu, 03 Aug 2017 03:59:31 -0700
From: L A Walsh <coreutils@tlinx.org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: RAJESH DASARI <raajeshdasari@gmail.com>
CC: Coreutils <coreutils@gnu.org>
Subject: Re: Backspace is not working in a chroot environment
References: <CAPXMrf8uSSyB---HLSXpeyk6tHJzQ7kcSY41TgS2ehmYHdBp7Q@mail.gmail.com>
In-Reply-To: <CAPXMrf8uSSyB---HLSXpeyk6tHJzQ7kcSY41TgS2ehmYHdBp7Q@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 173.164.175.65
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, 03 Aug 2017 10:59:47 -0000

RAJESH DASARI wrote:
> Hi ,
>
> I did chroot on my environment and  after i switched to the chrooted
> directory ,backspace key is not working properly , when i enter
> backspace it is taken  as a "space".
>   
---
    This is not likely a coreutils issue, but likely a behavior
of the how your chroot environment is different from your default
environment.

According to the trace you included below, the BackSpace key
it is being interpreted as the "DELETE" (DEL) key, not as
"BACKSPACE" (BS) or 0x08 (\010).

To see values for the erase key, use "stty -a|grep erase".

Try that before and after you chroot.

After chroot, you'll likely see erase = ^H, when you
probably want it to be 'erase = ^?'. To set it,
just type:

  stty erase KEY

(where you press your backspace key where it says KEY).
If your KEY has a special meaning (like it was mapped to
some function, you'd have to press "control-v" before they
key to get the literal key).

Likely, when you chroot, some init script is
run to set keys like 'erase' to some default value, but some
other script that sets it to your *desired* value isn't
getting run (example: maybe a system /etc/profile gets
run when you 'chroot', but your normal user init-script
isn't run).  It depends on what shell you are running
and what the differences are between your normal and your
chroot environment are.

You can temporarily fix it by resetting the key used for 'erase'
(using stty), and/or find the differences in your normal
and chroot environments and make sure the chroot environment
calls a script to re-set the key to your desired value.





From MAILER-DAEMON Thu Aug 03 07:17:49 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddE8T-0006EB-Fc
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 07:17:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53794)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1ddE8R-0006D5-BL
	for coreutils@gnu.org; Thu, 03 Aug 2017 07:17:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1ddE8N-0002xj-Ly
	for coreutils@gnu.org; Thu, 03 Aug 2017 07:17:47 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46908)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1ddE8N-0002tK-AZ
	for coreutils@gnu.org; Thu, 03 Aug 2017 07:17:43 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6B4F2160217;
	Thu,  3 Aug 2017 04:17:41 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id Jy6O4833_Z-r; Thu,  3 Aug 2017 04:17:40 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id B7F17160732;
	Thu,  3 Aug 2017 04:17:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 3Jd1TfF95Bj9; Thu,  3 Aug 2017 04:17:40 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.184.153])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9A44E160217;
	Thu,  3 Aug 2017 04:17:40 -0700 (PDT)
Subject: Re: [PATCH 3/4] copy: make backup files more reliably
To: Kamil Dudka <kdudka@redhat.com>
Cc: coreutils@gnu.org
References: <1501460347-19275-1-git-send-email-eggert@cs.ucla.edu>
	<1552189.DO5DapkadM@kdudka-nb>
	<0c6633cb-36d4-04b1-0daa-8861bf776e67@cs.ucla.edu>
	<3721819.B2TXf7IvyQ@kdudka-nb>
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
Message-ID: <3d794412-73b6-3680-1363-72b0bd7d45e2@cs.ucla.edu>
Date: Thu, 3 Aug 2017 04:17:40 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <3721819.B2TXf7IvyQ@kdudka-nb>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 03 Aug 2017 11:17:48 -0000

Kamil Dudka wrote:

> Still not perfect.  Now it produces false positives with --backup=3Dexi=
sting:

Yes, I know that, but there's no easy way to change that without introduc=
ing a=20
race condition the other way. I thought it better to be conservative and =
reject=20
the (extremely unusual) case that you mentioned, rather than make the com=
mon=20
case significantly less-efficient or (worse) to lose data in some rare ca=
ses.

I suppose we could change the diagnostic to say "might destroy source" ra=
ther=20
than "would destroy source". That would be more accurate.

> As for the test, could it be simplified like this?

Could be. I didn't look at the test in detail (it's now the same as befor=
e).


From MAILER-DAEMON Thu Aug 03 07:17:54 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddE8Y-0006HZ-Ju
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 07:17:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53987)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <raajeshdasari@gmail.com>) id 1ddE8V-0006G7-VP
	for coreutils@gnu.org; Thu, 03 Aug 2017 07:17:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <raajeshdasari@gmail.com>) id 1ddE8U-000395-MX
	for coreutils@gnu.org; Thu, 03 Aug 2017 07:17:51 -0400
Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:35161)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <raajeshdasari@gmail.com>)
	id 1ddE8U-00035G-EI
	for coreutils@gnu.org; Thu, 03 Aug 2017 07:17:50 -0400
Received: by mail-oi0-x232.google.com with SMTP id e124so9522223oig.2
	for <coreutils@gnu.org>; Thu, 03 Aug 2017 04:17:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=1eaRrAMhDn8SvykYvWcWHZ8Ngt7Pi75x8uECekc62wI=;
	b=UTRihNmOJlt6a5fmiSPS3F20v5xSZ9LpYDOqrlpTXTd0fm4a5GO3rBwpTEAoJ5CQOb
	135Zj08wS49s8Ka3UHdPeM7pa+4Fp03UHPtsAs1IkNc/hkZYG+8WEGi9JH8X061tb5Sl
	xIiiazjikGHcSJuH7iPjslnE/j4tXmMF5ALwDzJocOZc93oaXkd4Z9XC0Q+1L42EDRK4
	pYgO5Ofd80HmyuUjn25S7Z9z3Qrql/NpFP4Iu9LJY46faWvpjTbpcx3tijN1jDSvBB5w
	mjJMH7DW4yMtsn0A4AXg1+erV/9EaXX4NR+Jgaf+U3ODJw46kRvdUJsPZQVU/vIrOeoS
	3GQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=1eaRrAMhDn8SvykYvWcWHZ8Ngt7Pi75x8uECekc62wI=;
	b=Q179RXR9Vz5xPkvz8P2rAt9s3GU8PTueHIzXprMPtQm+SE6k4pxsANryUF4NdF6EpX
	F/E/dvsIcd1MVb0ux9vOOEBJlu2YCstGGI8IyylsvLjLr+s6ZwuRryn+jPpADhTBTRlH
	sgWjwYFtxqjIGsOALpyHi2s4G6IuituIA/5+GhNqPk9jVr3iOxdifyKqCyE2o+nMIH+B
	IUGqU2oCVQtgRHk7Kho8nyqqkoxE/HQC+6C9E+Uc67qtfuLGZCbsS7PujvHIBG9SlQLu
	m4NT/r04niLdPI1yuGM9geMd9fAfz+6iDNd/Q+EjcGyrrrTCFRbLLe4pRVcWyK3Od1L2
	ZsYw==
X-Gm-Message-State: AIVw113IWgTuLiAbL09mdX5X8RazyoMv1Ab7skJJmRh9kUJ/U6ZhpQ/F
	CdPuNl3XLsmXTCVMvXQ4uNr9sA5Rlg==
X-Received: by 10.202.252.79 with SMTP id a76mr1333974oii.92.1501759068153;
	Thu, 03 Aug 2017 04:17:48 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.182.165.129 with HTTP; Thu, 3 Aug 2017 04:17:47 -0700 (PDT)
In-Reply-To: <59830213.805@tlinx.org>
References: <CAPXMrf8uSSyB---HLSXpeyk6tHJzQ7kcSY41TgS2ehmYHdBp7Q@mail.gmail.com>
	<59830213.805@tlinx.org>
From: RAJESH DASARI <raajeshdasari@gmail.com>
Date: Thu, 3 Aug 2017 16:47:47 +0530
Message-ID: <CAPXMrf9YHnvTgid=VxOdrpHk2LgbGA3-TYPG3t98xS93L7cXpQ@mail.gmail.com>
Subject: Re: Backspace is not working in a chroot environment
To: L A Walsh <coreutils@tlinx.org>
Cc: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c06::232
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, 03 Aug 2017 11:17:53 -0000

Hi ,

Thanks for your quick response.

This is not an issue from core-utils as you mentioned.

I found the fix for this issue ,  i have copied the terminfo database
file of the xterm editor to the /usr/share/terminfo of the chroot
directory , it is working fine now.
ncurses libraries are expecting the terminal database files.


Thanks,
Rajesh Dasari.


On Thu, Aug 3, 2017 at 4:29 PM, L A Walsh <coreutils@tlinx.org> wrote:
> RAJESH DASARI wrote:
>>
>> Hi ,
>>
>> I did chroot on my environment and  after i switched to the chrooted
>> directory ,backspace key is not working properly , when i enter
>> backspace it is taken  as a "space".
>>
>
> ---
>    This is not likely a coreutils issue, but likely a behavior
> of the how your chroot environment is different from your default
> environment.
>
> According to the trace you included below, the BackSpace key
> it is being interpreted as the "DELETE" (DEL) key, not as
> "BACKSPACE" (BS) or 0x08 (\010).
>
> To see values for the erase key, use "stty -a|grep erase".
>
> Try that before and after you chroot.
>
> After chroot, you'll likely see erase = ^H, when you
> probably want it to be 'erase = ^?'. To set it,
> just type:
>
>  stty erase KEY
>
> (where you press your backspace key where it says KEY).
> If your KEY has a special meaning (like it was mapped to
> some function, you'd have to press "control-v" before they
> key to get the literal key).
>
> Likely, when you chroot, some init script is
> run to set keys like 'erase' to some default value, but some
> other script that sets it to your *desired* value isn't
> getting run (example: maybe a system /etc/profile gets
> run when you 'chroot', but your normal user init-script
> isn't run).  It depends on what shell you are running
> and what the differences are between your normal and your
> chroot environment are.
>
> You can temporarily fix it by resetting the key used for 'erase'
> (using stty), and/or find the differences in your normal
> and chroot environments and make sure the chroot environment
> calls a script to re-set the key to your desired value.
>
>
>


From MAILER-DAEMON Thu Aug 03 08:22:01 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddF8b-0004Ye-7o
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 08:22:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38592)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddF8Y-0004Wd-2W
	for coreutils@gnu.org; Thu, 03 Aug 2017 08:21:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddF8V-0002EK-3D
	for coreutils@gnu.org; Thu, 03 Aug 2017 08:21:58 -0400
Received: from mx1.redhat.com ([209.132.183.28]:32858)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1ddF8U-0002CB-PT
	for coreutils@gnu.org; Thu, 03 Aug 2017 08:21:55 -0400
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
	[10.5.11.14])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 5A01B61476;
	Thu,  3 Aug 2017 12:21:53 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5A01B61476
Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 11EB77D51F;
	Thu,  3 Aug 2017 12:21:52 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: coreutils@gnu.org, Philipp Thomas <pth@suse.de>,
	Josef Cejka <jcejka@suse.com>
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
Date: Thu, 03 Aug 2017 14:21:58 +0200
Message-ID: <2248543.gIlMjIVHzJ@kdudka-nb>
User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; )
In-Reply-To: <ad80e36d-2d57-ca79-463f-aa8ecae71e5d@bernhard-voelker.de>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
	<2367380.BZzy41pyIT@kdudka-nb>
	<ad80e36d-2d57-ca79-463f-aa8ecae71e5d@bernhard-voelker.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.39]);
	Thu, 03 Aug 2017 12:21:53 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Thu, 03 Aug 2017 12:21:59 -0000

On Wednesday, August 02, 2017 08:10:11 Bernhard Voelker wrote:
> On 08/01/2017 04:49 PM, Kamil Dudka wrote:
> > If I understand it correctly, your patch takes effect regardless the use
> > of -l option.  Then please remove it from the summary to make it clear.
> > 
> > The optimized-out stat() call is, however, not the only change done by
> > your commit.  It has a side-effect that is observable from df's output
> > (and completely unrelated to autofs or remote file systems).  At first
> > glance, the side-effect looks useful but it should be properly analyzed
> > and documented...
> > 
> > Consider the following example:
> > 
> > # mount -t proc none /opt
> > # mount -t tmpfs none /opt
> > 
> > Now unpached df does not list the /opt entry:
> > 
> > # df | grep opt
> > 
> > ... but after your patch, it does:
> > 
> > # df | grep opt
> > none             2005384        0   2005384   0% /opt
> > 
> > Note that it was important that I have used the same "device" in both
> > the mount commands.
> 
> hmm, adding that little condition was too tempting - as there is the
> same one later on in get_dev(). ;-/
> 
> This sounds like there is another bug to fix in filter_mount_list
> wrt over-mounting.
> Maybe it should process the entries from /proc/self/mountinfo from
> the end instead of the beginning: by this it would be easier to filter
> out over-mounted file systems.
> 
> WDYT?

Sounds like it would fix the bug with over-mounted /opt.  But, for some 
reason, it breaks tests/df/skip-duplicates.sh.  This is the patch I tried:

--- a/src/df.c
+++ b/src/df.c
@@ -638,6 +638,24 @@ devlist_free (void *p)
   free (p);
 }

+/* reverse mount_entry list *plist and return its size */
+static int
+reverse_me_list(struct mount_entry **plist)
+{
+  int size = 0;
+  struct mount_entry *me, *next, *prev = NULL;
+  for (me = *plist; me; me = next)
+  {
+    size++;
+    next = me->me_next;
+    me->me_next = prev;
+    prev = me;
+  }
+
+  *plist = prev;
+  return size;
+}
+
 /* Filter mount list by skipping duplicate entries.
    In the case of duplicates - based on the device number - the mount entry
    with a '/' in its me_devname (i.e., not pseudo name like tmpfs) wins.
@@ -652,10 +670,9 @@ filter_mount_list (bool devices_only)

   /* Temporary list to keep entries ordered.  */
   struct devlist *device_list = NULL;
-  int mount_list_size = 0;

-  for (me = mount_list; me; me = me->me_next)
-    mount_list_size++;
+  /* reverse mount_list to better handle over-mounted file systems */
+  int mount_list_size = reverse_me_list(&mount_list);

   devlist_table = hash_initialize (mount_list_size, NULL,
                                  devlist_hash,
@@ -768,6 +785,9 @@ filter_mount_list (bool devices_only)
       hash_free (devlist_table);
       devlist_table = NULL;
   }
+  else
+    /* reverse mount_list back to preserve the order with --all */
+    reverse_me_list(&mount_list);
 }




From MAILER-DAEMON Thu Aug 03 09:02:30 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddFll-0002l3-Vt
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 09:02:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41945)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddFlf-0002jZ-Tk
	for coreutils@gnu.org; Thu, 03 Aug 2017 09:02:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddFlW-00041Z-GW
	for coreutils@gnu.org; Thu, 03 Aug 2017 09:02:23 -0400
Received: from mx1.redhat.com ([209.132.183.28]:60024)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1ddFlW-0003zm-BT
	for coreutils@gnu.org; Thu, 03 Aug 2017 09:02:14 -0400
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
	[10.5.11.14])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 2F4184A6F8;
	Thu,  3 Aug 2017 13:02:13 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2F4184A6F8
Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id E70CB7E112;
	Thu,  3 Aug 2017 13:02:12 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: coreutils@gnu.org
Subject: Re: [PATCH 3/4] copy: make backup files more reliably
Date: Thu, 03 Aug 2017 15:02:18 +0200
Message-ID: <2563463.8lPOtgPHDg@kdudka-nb>
User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; )
In-Reply-To: <3d794412-73b6-3680-1363-72b0bd7d45e2@cs.ucla.edu>
References: <1501460347-19275-1-git-send-email-eggert@cs.ucla.edu>
	<3721819.B2TXf7IvyQ@kdudka-nb>
	<3d794412-73b6-3680-1363-72b0bd7d45e2@cs.ucla.edu>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.38]);
	Thu, 03 Aug 2017 13:02:13 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Thu, 03 Aug 2017 13:02:28 -0000

On Thursday, August 03, 2017 04:17:40 Paul Eggert wrote:
> Yes, I know that, but there's no easy way to change that without introducing
> a race condition the other way. I thought it better to be conservative and
> reject the (extremely unusual) case that you mentioned, rather than make
> the common case significantly less-efficient or (worse) to lose data in
> some rare cases.

Yes, the API of backup_file_rename() is too coarse for that.

> I suppose we could change the diagnostic to say "might destroy source"
> rather than "would destroy source". That would be more accurate.

Sounds reasonable.

Kamil


From MAILER-DAEMON Thu Aug 03 10:01:26 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddGgo-0007nY-EV
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 10:01:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51024)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1ddGgf-0007h6-7p
	for coreutils@gnu.org; Thu, 03 Aug 2017 10:01:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1ddGga-0000Id-Fy
	for coreutils@gnu.org; Thu, 03 Aug 2017 10:01:17 -0400
Received: from mout.kundenserver.de ([217.72.192.74]:50028)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1ddGga-0000Di-0y
	for coreutils@gnu.org; Thu, 03 Aug 2017 10:01:12 -0400
Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de
	(mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id
	0MI8Ug-1dg0Uq34XO-003v5P; Thu, 03 Aug 2017 16:00:22 +0200
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
To: Kamil Dudka <kdudka@redhat.com>
Cc: Philipp Thomas <pth@suse.de>, Josef Cejka <jcejka@suse.com>,
	coreutils@gnu.org
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
	<2367380.BZzy41pyIT@kdudka-nb>
	<ad80e36d-2d57-ca79-463f-aa8ecae71e5d@bernhard-voelker.de>
	<2248543.gIlMjIVHzJ@kdudka-nb>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <eaf58322-3396-bc81-1d79-1ed4034d548a@bernhard-voelker.de>
Date: Thu, 3 Aug 2017 16:00:21 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <2248543.gIlMjIVHzJ@kdudka-nb>
Content-Type: text/plain; charset=utf-8
Content-Language: de-DE-1901
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:C5J2L1hNH3RFB74QoA3nrkLt1cUKpMv+oDY9JANqasGLwGTI6Ba
	vevQkdbL/t9sXHa+hlec5zYetYq+998qyUKVoKKw3sOp/thzcgCmeU6g9pjEVcZk5u3W6JO
	Gnjj3DJglNZ2KTA6i47NGq3vzSzfLjAJ860gpN/X+l2Zn6LHU3D9X164ZqxTvZWvSUM3y+x
	7yb8M8zgQMtVQzgvFVLdw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:krxlz7zE+Ss=:OHTfTo3jcRgIzltMYEuh4B
	dDBwzUReMvA+OwTdfasT7GQygBGC05G+Ff2WLZPLTAAqMLKT61HlijnBVUg6ODCzkr/rM6+IR
	PtsDoZwX488ZnTv1mJUNQaP4UyZwzkoM8+ekUgM4C0GOMI9P1zqxH2VU3vWjy1WouJJJNPVsM
	zYkCEXgVeIO+qfUTgEgjulX+g5ob80Ed8PV696Bnc1eRKNEzr+B8XubIG27Jc5uftAi6BB3Se
	N+7oYikrTMBkFMwi5GKoKOu1W0pVp6MhQXei/ZZgiq5sELo/JO8rBlyRQyk4kAyU02HcqQjPH
	CuotoBL7H4PxQRIARe24TjTXhwadPjKSwxVi2gJ0s3XQbTl/Q3iJtYMPEOoijBB38twshBkY3
	6cQSha9FcIcccIX2Ujzj2A7sp5Ppth3TomDmtHgUk/mI5jQmj5yt2xcFESDUTW6bIk0xvAxaT
	Y4l0TY6vyfooZWgBXhrRvA0nim4SjJXLMExgITZD4W+fI7DnAR+ni8P2yTBpOPyOdwI9PyAwB
	bj5IubP/zE7IPaM6YayBIa6Hl1U+y2Yf2Er2+BuskMEsbBt7Jxx9aYTY026fdcwj5hLIxCiWC
	ixkoy8JdnEZBBRJwj73RG+e7DcBzCq4jfbgs1n/+0stA8xATY+hturA7sJ3CfhvJVSwHfZZE7
	6JZfJe4nEDDVBiv1+R56QT1WBmazRCoKa0sDbNkyWuilrsshf/ifasRImM7I6bMs/FXgrdFXZ
	rbB7MV32YJ1nKp8pMqRupsGs4dTLIrHBWT7woc0FieHRlz9X3ma+RVet1IE=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 217.72.192.74
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, 03 Aug 2017 14:01:25 -0000

On 08/03/2017 02:21 PM, Kamil Dudka wrote:
> @@ -652,10 +670,9 @@ filter_mount_list (bool devices_only)
> 
>    /* Temporary list to keep entries ordered.  */
>    struct devlist *device_list = NULL;
> -  int mount_list_size = 0;
> 
> -  for (me = mount_list; me; me = me->me_next)
> -    mount_list_size++;
> +  /* reverse mount_list to better handle over-mounted file systems */
> +  int mount_list_size = reverse_me_list(&mount_list);
> 
>    devlist_table = hash_initialize (mount_list_size, NULL,
>                                   devlist_hash,
> @@ -768,6 +785,9 @@ filter_mount_list (bool devices_only)
>        hash_free (devlist_table);
>        devlist_table = NULL;
>    }
> +  else
> +    /* reverse mount_list back to preserve the order with --all */
> +    reverse_me_list(&mount_list);
>  }

No, unfortunately that doesn't work as simple as that.

The point is that today's code processes the entries, and if a later one
over-mounts a previous one, then the previous one gets removed in favor
of the later one.  IIRC, this does not work correctly in the following
case - mount points:

/a      # initial mount
/a/b    # mount on a subdirectory
/a/b    # over-mounting the sub-directory
/a      # over-mounting all of the above

AFAIR today's code wouldn't elide the /a/b mounts.
Going backward would ease creating the net list of visible mounts,
because later entries could just be ignored.
After that, the regular filtering of local, excluded, included etc.
mounts could happen in a second loop.

With -a, the over-mounted file systems could/should show up with '-' entries
again.

Thanks & have a nice day,
Berny


From MAILER-DAEMON Thu Aug 03 16:47:16 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddN1Y-0008FJ-Hd
	for mharc-coreutils@gnu.org; Thu, 03 Aug 2017 16:47:16 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42563)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1ddN1W-0008Dn-DR
	for coreutils@gnu.org; Thu, 03 Aug 2017 16:47:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1ddN1T-0004oZ-Id
	for coreutils@gnu.org; Thu, 03 Aug 2017 16:47:14 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37562)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1ddN1T-0004le-8U
	for coreutils@gnu.org; Thu, 03 Aug 2017 16:47:11 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8E7AE160731;
	Thu,  3 Aug 2017 13:47:08 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id s1F7EsjdL1fu; Thu,  3 Aug 2017 13:47:07 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id BA62D160734;
	Thu,  3 Aug 2017 13:47:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id a271bxvOjVHW; Thu,  3 Aug 2017 13:47:07 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9E225160731;
	Thu,  3 Aug 2017 13:47:07 -0700 (PDT)
Subject: Re: [PATCH 3/4] copy: make backup files more reliably
To: Kamil Dudka <kdudka@redhat.com>
Cc: coreutils@gnu.org
References: <1501460347-19275-1-git-send-email-eggert@cs.ucla.edu>
	<3721819.B2TXf7IvyQ@kdudka-nb>
	<3d794412-73b6-3680-1363-72b0bd7d45e2@cs.ucla.edu>
	<2563463.8lPOtgPHDg@kdudka-nb>
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
Message-ID: <0e1ca8f2-3ef5-e494-d99c-299261422084@cs.ucla.edu>
Date: Thu, 3 Aug 2017 13:47:07 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <2563463.8lPOtgPHDg@kdudka-nb>
Content-Type: multipart/mixed; boundary="------------D21EDF54A3473B298E08B32A"
Content-Language: en-US
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 03 Aug 2017 20:47:15 -0000

This is a multi-part message in MIME format.
--------------D21EDF54A3473B298E08B32A
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 08/03/2017 06:02 AM, Kamil Dudka wrote:
>> I suppose we could change the diagnostic to say "might destroy source"
>> rather than "would destroy source". That would be more accurate.
> Sounds reasonable.

OK, I installed the attached.


--------------D21EDF54A3473B298E08B32A
Content-Type: text/x-patch;
 name="0001-copy-more-accurate-warning-about-destruction.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-copy-more-accurate-warning-about-destruction.patch"

>From 8f1b44c8901bb6183691aae093b7cc3093877260 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 3 Aug 2017 13:44:53 -0700
Subject: [PATCH] copy: more-accurate warning about destruction

* src/copy.c (copy_internal):
* tests/cp/backup-is-src.sh, tests/mv/backup-is-src.sh:
Say "might destroy", not "would destroy".
---
 src/copy.c                | 4 ++--
 tests/cp/backup-is-src.sh | 2 +-
 tests/mv/backup-is-src.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/copy.c b/src/copy.c
index 9a30e16a8..c4c574050 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2113,8 +2113,8 @@ copy_internal (char const *src_name, char const *dst_name,
                 {
                   const char *fmt;
                   fmt = (x->move_mode
-                 ? _("backing up %s would destroy source;  %s not moved")
-                 : _("backing up %s would destroy source;  %s not copied"));
+                 ? _("backing up %s might destroy source;  %s not moved")
+                 : _("backing up %s might destroy source;  %s not copied"));
                   error (0, 0, fmt,
                          quoteaf_n (0, dst_name),
                          quoteaf_n (1, src_name));
diff --git a/tests/cp/backup-is-src.sh b/tests/cp/backup-is-src.sh
index 3e4a79f39..38c310fb2 100755
--- a/tests/cp/backup-is-src.sh
+++ b/tests/cp/backup-is-src.sh
@@ -28,7 +28,7 @@ cp --b=simple a~ a > out 2>&1 && fail=1
 sed "s,cp:,XXX:," out > out2
 
 cat > exp <<\EOF
-XXX: backing up 'a' would destroy source;  'a~' not copied
+XXX: backing up 'a' might destroy source;  'a~' not copied
 EOF
 
 compare exp out2 || fail=1
diff --git a/tests/mv/backup-is-src.sh b/tests/mv/backup-is-src.sh
index 04e9f7c81..3d099cddb 100755
--- a/tests/mv/backup-is-src.sh
+++ b/tests/mv/backup-is-src.sh
@@ -38,7 +38,7 @@ sed \
   out > out2
 
 cat > exp <<\EOF
-XXX: backing up 'YYY' would destroy source;  'ZZZ' not moved
+XXX: backing up 'YYY' might destroy source;  'ZZZ' not moved
 EOF
 
 compare exp out2 || fail=1
-- 
2.13.3


--------------D21EDF54A3473B298E08B32A--


From MAILER-DAEMON Fri Aug 04 03:38:58 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddXCE-0001Ya-Hk
	for mharc-coreutils@gnu.org; Fri, 04 Aug 2017 03:38:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59591)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1ddXCA-0001Xx-MZ
	for coreutils@gnu.org; Fri, 04 Aug 2017 03:38:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1ddXC7-00038A-63
	for coreutils@gnu.org; Fri, 04 Aug 2017 03:38:54 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:60420)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1ddXC6-00034e-PZ
	for coreutils@gnu.org; Fri, 04 Aug 2017 03:38:51 -0400
Received: from localhost.localdomain (unknown [73.93.155.111])
	(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 3A85C4B05;
	Fri,  4 Aug 2017 08:38:47 +0100 (IST)
Subject: Re: [PATCH] kill: fix signal number to name lookup on AIX
To: Michael Felt <michael@felt.demon.nl>, coreutils@gnu.org
References: <d6eba7e5-2d3c-0e22-ac30-84a24004bf4a@felt.demon.nl>
	<0557f29d-82ed-17ba-47fd-23c6bd3b299c@felt.demon.nl>
	<16f50a12-4a01-6fc4-bcc3-e2d37e6f0702@draigBrady.com>
	<a04c541f-aa3d-86a0-a31b-8aeb5e665698@felt.demon.nl>
	<4bef75c7-5e7d-f4d5-4acf-da4719d04433@felt.demon.nl>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <69aaf746-501b-0a0d-d282-a41c8189f3ee@draigBrady.com>
Date: Fri, 4 Aug 2017 00:38:44 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <4bef75c7-5e7d-f4d5-4acf-da4719d04433@felt.demon.nl>
Content-Type: multipart/mixed; boundary="------------1FFCF82A0DBF1577BC1EDE48"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 04 Aug 2017 07:38:57 -0000

This is a multi-part message in MIME format.
--------------1FFCF82A0DBF1577BC1EDE48
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 27/07/17 10:10, Michael Felt wrote:
> On 27/07/2017 10:22, Michael Felt wrote:
>> Hint: I expect the issue here is that the ln is done on a NFS server=20
>> rather than "local" filesystem.
>>
>> Also, not run (here) as root, so those tests were skipped here.
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>>    GNU coreutils 8.27.4-3c9d7: ./tests/test-suite.log
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>>
>> # TOTAL: 592
>> # PASS:  414
>> # SKIP:  177
>> # XFAIL: 0
>> # FAIL:  1
>> # XPASS: 0
>> # ERROR: 0
>>
>> from ./tests/test-suite.log
>>
>> FAIL: tests/ln/sf-1
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
>=20
> Ok, it looks like the test above above succeeds when on jfs2.

The attached patches should address the above and all previous issues you=
 mentioned.
I've made a dist tarball for test available at:
https://www.pixelbeat.org/cu/coreutils-8.27.70-bfe8dc.tar.xz

Re the following discussion of cp, I couldn't follow it exactly.
Which test failed for you?
Are you saying that you would expect `cp -p` to not
preserve set[ug]id bits when not copying your own files?
I wouldn't expect that and I also see this comment in copy.c:

/* POSIX says that 'cp -p' must restore the following:
     - permission bits
     - setuid, setgid bits
     - owner and group
     If it fails to restore any of those, we may give a warning but
     the destination must not be removed.

cheers,
P=C3=A1draig.

> Running as root - a test previously skipped now fails. And it is a real=
=20
> bug, it seems, as the AIX cp command (/usr/bin/cp) works as expected.
>=20
> Look at the commands used to create the c4 and c8 files (the directory=20
> was given mode 777 to permit the writing regardless of userid.
>=20
>=20
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]touch c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chmod a=3Dr,ug+sx c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]su
> root's Password:
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]cp -p c c1
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chroot --skip-chdir=20
> --user=3Dnobody src/cp -p c c2
> chroot: option --skip-chdir only permitted if NEWROOT is old '/'
> Try 'chroot --help' for more information.
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chroot --skip-chdir=20
> --user=3Dnobody / src/cp -p c c2
> cp: cannot create regular file 'c2': Permission denied
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c??
> ls: cannot access 'c??': No such file or directory
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chmod 777 .
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chroot --skip-chdir=20
> --user=3Dnobody / src/cp -p c c2
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c2
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]su nobody -c src/cp=20
> -p c c3
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c3
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]su nobody -c=20
> /usr/bin/cp -p c c4
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody  felt 0 Jul 27 16:53 c4
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]
>=20
> Here I exit from SU mode.
>=20
> As the file c is owned by michael - not surprising that c5 has=20
> permission bits. But c2 is owned by nobody, and I would not expect thos=
e=20
> special bits to copy as michael
>=20
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]id
> uid=3D199(michael) gid=3D1954(felt)=20
> groups=3D1954(felt),1(staff),33(httpd),208(xdata)
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]cp -p c c5
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]src/cp -p c c6
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody  felt 0 Jul 27 16:53 c4
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c5
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c6
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]src/cp -p c2 c6
> cp: cannot create regular file 'c6': Permission denied
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]src/cp -p c2 c7
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody  felt 0 Jul 27 16:53 c4
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c5
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c6
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c7
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]/usr/bin/cp -p c2 c8
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody  felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody  felt 0 Jul 27 16:53 c4
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c5
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c6
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c7
> -r-xr-xr-- 1 michael felt 0 Jul 27 16:53 c8
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]
>=20
> So, it seems that src/cp is still copying the file mode, regardless.


--------------1FFCF82A0DBF1577BC1EDE48
Content-Type: text/plain; charset=UTF-8;
 name="aix.patches"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="aix.patches"

RnJvbSAyZWI3NDA1M2U5ZWM1ZTVlNDg2NWYzOGUzMmI3YjdkNmMxMzUwNjM4IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/UD1DMz1BMWRyYWlnPTIwQnJhZHk/
PSA8UEBkcmFpZ0JyYWR5LmNvbT4KRGF0ZTogVGh1LCAzIEF1ZyAyMDE3IDIxOjIwOjA4IC0w
NzAwClN1YmplY3Q6IFtQQVRDSCAxLzNdIHRlc3RzOiBhdm9pZCBmYWxzZSBmYWlsdXJlcyBv
biBBSVgKCiogdGVzdHMvbG4vc2YtMS5zaDogTGltaXQgdGhlIHN5bWxpbmsgc2l6ZSB0byAx
TWlCCnRvIGF2b2lkIG1lbW9yeSBleGhhdXN0aW9uIHNlZW4gb24gTkZTIG9uIEFJWCwgZ2l2
aW5nOgogICsgcHJpbnRmICclMCpkJyA0Mjk0OTY3Mjk2IDAKICArIC4vdGVzdHMvbG4vc2Yt
MS5zaDogbGluZSAzODogcHJpbnRmOiB3YXJuaW5nOiAwOiBSZXN1bHQgdG9vIGxhcmdlCiog
dGVzdHMvaWQvc2V0Z2lkLnNoOiBTa2lwIHRoZSB0ZXN0IHdoZW4gdGhlIGFkanVzdGVkIGdp
ZAp3b3VsZCBlcXVhbCA0Mjk0OTY3Mjk1LCBhcyB0aGF0J3MgcmVzZXJ2ZWQgb24gQUlYLgpS
ZXBvcnRlZCBieSBNaWNoYWVsIEZlbHQuCi0tLQogdGVzdHMvaWQvc2V0Z2lkLnNoIHwgNSAr
KysrKwogdGVzdHMvbG4vc2YtMS5zaCAgIHwgNyArKysrKystCiAyIGZpbGVzIGNoYW5nZWQs
IDExIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKCmRpZmYgLS1naXQgYS90ZXN0cy9p
ZC9zZXRnaWQuc2ggYi90ZXN0cy9pZC9zZXRnaWQuc2gKaW5kZXggNjFhMWQ5OS4uMDlmOWVi
MCAxMDA3NTUKLS0tIGEvdGVzdHMvaWQvc2V0Z2lkLnNoCisrKyBiL3Rlc3RzL2lkL3NldGdp
ZC5zaApAQCAtMjAsMTEgKzIwLDE2IEBACiBwcmludF92ZXJfIGlkCiByZXF1aXJlX3Jvb3Rf
CiAKK2dldGxpbWl0c18KKwogIyBDb25zdHJ1Y3QgYSBkaWZmZXJlbnQgZ3JvdXAgbnVtYmVy
CiBncDE9JE5PTl9ST09UX0dJRAogZ3AxPSQoZXhwciAkZ3AxICsgMSkgfHwKICAgc2tpcF8g
ImZhaWxlZCB0byBhZGp1c3QgR0lEICROT05fUk9PVF9HSUQiCiAKK3Rlc3QgIiRncDEiIC1s
dCAkR0lEX1RfTUFYIHx8CisgIHNraXBfICJHSUQgJGdwMSBpcyByZXNlcnZlZCBvbiBzb21l
IHN5c3RlbXMiCisKIGVjaG8gJGdwMSA+IGV4cCB8fCBmcmFtZXdvcmtfZmFpbHVyZV8KIAog
IyBXaXRoIGNvcmV1dGlscy04LjE2IGFuZCBlYXJsaWVyLCBpZCAtRyB3b3VsZCBwcmludCBi
b3RoOgpkaWZmIC0tZ2l0IGEvdGVzdHMvbG4vc2YtMS5zaCBiL3Rlc3RzL2xuL3NmLTEuc2gK
aW5kZXggMTQ5YjI3NS4uNDkyZmNlOSAxMDA3NTUKLS0tIGEvdGVzdHMvbG4vc2YtMS5zaAor
KysgYi90ZXN0cy9sbi9zZi0xLnNoCkBAIC0zMyw5ICszMywxNCBAQCBlc2FjCiAKICMgRW5z
dXJlIHdlIHJlcGxhY2Ugc3ltbGlua3MgdGhhdCBkb24ndCBvciBjYW4ndCBsaW5rIHRvIGFu
IGV4aXN0aW5nIHRhcmdldC4KICMgY29yZXV0aWxzLTguMjIgd291bGQgZmFpbCB0byByZXBs
YWNlIHtFTk9URElSLEVMT09QLEVOQU1FVE9PTE9OR31fbGluayBiZWxvdy4KLW5hbWVfbWF4
X3BsdXMxPSQoZXhwciAkKHN0YXQgLWYgLWMgJWwgLikgKyAxKQorbmFtZV9tYXg9JChzdGF0
IC1mIC1jICVsIC4pIHx8IHNraXBfICdFcnJvciBkZXRlcm1pbmluZyBOQU1FX01BWCcKKyMg
QXBwbHkgYSBsaW1pdCBzaW5jZSBBSVggcmV0dXJucyAyXjMyLTEgd2hpY2ggd291bGQgdHJp
Z2dlciByZXNvdXJjZSBpc3N1ZXMuCituYW1lX2xpbWl0PSQoKDEwMjQqMTAyNCkpCit0ZXN0
ICIkbmFtZV9tYXgiIC1sdCAiJG5hbWVfbGltaXQiIHx8IG5hbWVfbWF4PSIkbmFtZV9saW1p
dCIKK25hbWVfbWF4X3BsdXMxPSQoZXhwciAkbmFtZV9tYXggKyAxKQogdGVzdCAkbmFtZV9t
YXhfcGx1czEgLWd0IDEgfHwgc2tpcF8gJ0Vycm9yIGRldGVybWluaW5nIE5BTUVfTUFYJwog
bG9uZ19uYW1lPSQocHJpbnRmICclMCpkJyAkbmFtZV9tYXhfcGx1czEgMCkKKwogZm9yIGYg
aW4gJycgZjsgZG8KICAgbG4gLXMkZiBtaXNzaW5nIEVOT0VOVF9saW5rIHx8IGZhaWw9MQog
ICBsbiAtcyRmIGEvYiBFTk9URElSX2xpbmsgfHwgZmFpbD0xCi0tIAoyLjkuMwoKCkZyb20g
MTJlNzRhYTdmZDI5NWZlOGM2NThjMzZmODUyMTUwMjg5M2EwMDI5ZSBNb24gU2VwIDE3IDAw
OjAwOjAwIDIwMDEKRnJvbTogPT9VVEYtOD9xP1A9QzM9QTFkcmFpZz0yMEJyYWR5Pz0gPFBA
ZHJhaWdCcmFkeS5jb20+CkRhdGU6IFRodSwgMyBBdWcgMjAxNyAyMzozOToyNiAtMDcwMApT
dWJqZWN0OiBbUEFUQ0ggMi8zXSBidWlsZDogdXNlIHRoZSBhcHByb3ByaWF0ZSBzaW5nbGUg
ZmlsZSBpbmNsdWRlIG9wdGlvbgogd2l0aCB4bGMKCiogY29uZmlndXJlLmFjOiBTZXQgVVNF
X1hMQ19JTkNMVURFIHdoZW4gX194bGNfXyBpcyBkZWZpbmVkLgoqIHNyYy9sb2NhbC5tazog
VXNlIGl0IHRvIHNlbGVjdCB0aGUgYXBwcm9wcmlhdGUgaW5jbHVkZSBvcHRpb24uClJlcG9y
dGVkIGJ5IE1pY2hhZWwgRmVsdC4KLS0tCiBjb25maWd1cmUuYWMgfCAxMiArKysrKysrKysr
KysKIHNyYy9sb2NhbC5tayB8IDEwICsrKysrKysrLS0KIDIgZmlsZXMgY2hhbmdlZCwgMjAg
aW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9jb25maWd1cmUu
YWMgYi9jb25maWd1cmUuYWMKaW5kZXggN2M3YzhjMi4uZDI0NTljZSAxMDA2NDQKLS0tIGEv
Y29uZmlndXJlLmFjCisrKyBiL2NvbmZpZ3VyZS5hYwpAQCAtNDk2LDYgKzQ5NiwxOCBAQCBm
aQogQ0ZMQUdTPSRhY19zYXZlX0NGTEFHUwogTERGTEFHUz0kYWNfc2F2ZV9MREZMQUdTCiAK
KyMgRGV0ZWN0IHdoZW4gdXNpbmcgeGxjIHRvIGRldGVybWluZSB3aGV0aGVyIHRvIHVzZSAt
cWluY2x1ZGU9CitBQ19DQUNIRV9DSEVDSyhbd2hldGhlciB0aGUgc3lzdGVtIHN1cHBvcnRz
IHhsYyBpbmNsdWRlXSwgW3V0aWxzX2N2X3hsY10sCisgIFtBQ19DT01QSUxFX0lGRUxTRSgK
KyAgICAgW0FDX0xBTkdfUFJPR1JBTShbWworICAgICAgICAgICNpZm5kZWYgX194bGNfXwor
ICAgICAgICAgICAgI2Vycm9yICJub3QgeGxjIgorICAgICAgICAgICNlbmRpZgorICAgICAg
ICBdXSldLAorICAgICBbdXRpbHNfY3ZfeGxjPXllc10sCisgICAgIFt1dGlsc19jdl94bGM9
bm9dKV0pCitBTV9DT05ESVRJT05BTChbVVNFX1hMQ19JTkNMVURFXSwgW3Rlc3QgIiR1dGls
c19jdl94bGMiID0geWVzXSkKKwogIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwogCiBkbmwgQXV0
b2dlbmVyYXRlZCBieSB0aGUgJ2dlbi1saXN0cy1vZi1wcm9ncmFtcy5zaCcgYXV4aWxpYXJ5
IHNjcmlwdC4KZGlmZiAtLWdpdCBhL3NyYy9sb2NhbC5tayBiL3NyYy9sb2NhbC5tawppbmRl
eCA5YjJiMTcyLi4xY2I2ODU5IDEwMDY0NAotLS0gYS9zcmMvbG9jYWwubWsKKysrIGIvc3Jj
L2xvY2FsLm1rCkBAIC0zOTcsOCArMzk3LDE0IEBAIHNyY19zaGEzODRzdW1fU09VUkNFUyA9
IHNyYy9tZDVzdW0uYwogc3JjX3NoYTM4NHN1bV9DUFBGTEFHUyA9IC1ESEFTSF9BTEdPX1NI
QTM4ND0xICQoQU1fQ1BQRkxBR1MpCiBzcmNfc2hhNTEyc3VtX1NPVVJDRVMgPSBzcmMvbWQ1
c3VtLmMKIHNyY19zaGE1MTJzdW1fQ1BQRkxBR1MgPSAtREhBU0hfQUxHT19TSEE1MTI9MSAk
KEFNX0NQUEZMQUdTKQotc3JjX2Iyc3VtX0NQUEZMQUdTID0gLWluY2x1ZGUgY29uZmlnLmgg
LURIQVNIX0FMR09fQkxBS0UyPTEgXAotCQkgICAgICQoQU1fQ1BQRkxBR1MpCisjIEluY2x1
ZGUgdGhlIGZpbGUgb24gdGhlIGNvbW1hbmQgbGluZSB0byBhdm9pZCBtb2RpZnlpbmcKKyMg
dGhlIGJsYWtlMiB1cHN0cmVhbSBzb3VyY2UKK2lmIFVTRV9YTENfSU5DTFVERQorc3JjX2Iy
c3VtX0NQUEZMQUdTID0gLXFpbmNsdWRlPWNvbmZpZy5oCitlbHNlCitzcmNfYjJzdW1fQ1BQ
RkxBR1MgPSAtaW5jbHVkZSBjb25maWcuaAorZW5kaWYKK3NyY19iMnN1bV9DUFBGTEFHUyAr
PSAtREhBU0hfQUxHT19CTEFLRTI9MSAkKEFNX0NQUEZMQUdTKQogc3JjX2Iyc3VtX1NPVVJD
RVMgPSBzcmMvbWQ1c3VtLmMgXAogCQkgICAgc3JjL2JsYWtlMi9ibGFrZTIuaCBzcmMvYmxh
a2UyL2JsYWtlMi1pbXBsLmggXAogCQkgICAgc3JjL2JsYWtlMi9ibGFrZTJiLXJlZi5jIFwK
LS0gCjIuOS4zCgoKRnJvbSBiZmU4ZGMxODdjMzBjMDFjMmI1YTk2NWVmNWFiZWExYWMzMDRi
NDg2IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/UD1DMz1BMWRy
YWlnPTIwQnJhZHk/PSA8UEBkcmFpZ0JyYWR5LmNvbT4KRGF0ZTogU3VuLCAyMyBKdWwgMjAx
NyAwMzoyNTozMiAtMDcwMApTdWJqZWN0OiBbUEFUQ0ggMy8zXSBraWxsOiBmaXggc2lnbmFs
IG51bWJlciB0byBuYW1lIGxvb2t1cCBvbiBBSVgKCiogc3JjL29wZXJhbmQyc2lnLmMgKG9w
ZXJhbmQyc2lnKTogQUlYIHVzZXMgYSBkaWZmZXJlbnQgYml0IHBhdHRlcm4KaW4gdGhlIHJl
dHVybmVkIHN0YXR1cyBmcm9tIHRoZSB3YWl0KCkgZnVuY3Rpb25zIGFuZCBmcm9tIHNoZWxs
cy4KVGhlcmVmb3JlIGhhcmRjb2RlIHRoZSBzZWxlY3Rpb24gb2YgdGhlIGxvd2VyIGJpdHMg
b2YgdGhlIG51bWJlci4KKiBORVdTOiBNZW50aW9uIHRoZSBmaXguCi0tLQogTkVXUyAgICAg
ICAgICAgICAgfCAgNCArKysrCiBzcmMvb3BlcmFuZDJzaWcuYyB8IDExICsrKysrKysrKy0t
CiAyIGZpbGVzIGNoYW5nZWQsIDEzIGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pCgpk
aWZmIC0tZ2l0IGEvTkVXUyBiL05FV1MKaW5kZXggZWIwYzBkYy4uNmI2Y2FmZCAxMDA2NDQK
LS0tIGEvTkVXUworKysgYi9ORVdTCkBAIC00MSw2ICs0MSwxMCBAQCBHTlUgY29yZXV0aWxz
IE5FV1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtKi0gb3V0bGluZSAt
Ki0KICAgTm93LCBpdCBwcmludHMgYSBkaWFnbm9zdGljIG9yIGEgbGluZSB0byBzdGRvdXQg
Zm9yIGVhY2ggYXJndW1lbnQuCiAgIFtidWcgaW50cm9kdWNlZCBpbiB0aGUgYm91cm5lLXNo
ZWxsLXRvLUMgcmV3cml0ZSBmb3IgY29yZXV0aWxzLTYuMTFdCiAKKyAga2lsbCBub3cgY29u
dmVydHMgZnJvbSBudW1iZXIgdG8gc2lnbmFsIG5hbWUgY29ycmVjdGx5IG9uIEFJWC4KKyAg
UHJldmlvdXNseSBpdCB3b3VsZCBoYXZlIGFsd2F5cyByZXR1cm5lZCB0aGUgJ0VYSVQnIG5h
bWUuCisgIFtidWcgaW50cm9kdWNlZCBpbiBmaWxldXRpbHMtNC4xLjldCisKICAgc3BsaXQg
bm8gbG9uZ2VyIGV4aXRzIHdoZW4gaW52b2NhdGlvbnMgb2YgYSAtLWZpbHRlciByZXR1cm4g
RVBJUEUuCiAgIFtidWcgaW50cm9kdWNlZCBpbiBjb3JldXRpbHMtOC4yNl0KIApkaWZmIC0t
Z2l0IGEvc3JjL29wZXJhbmQyc2lnLmMgYi9zcmMvb3BlcmFuZDJzaWcuYwppbmRleCBkNTlj
Y2I5Li5kYjVjZWVhIDEwMDY0NAotLS0gYS9zcmMvb3BlcmFuZDJzaWcuYworKysgYi9zcmMv
b3BlcmFuZDJzaWcuYwpAQCAtNTMsOCArNTMsMTUgQEAgb3BlcmFuZDJzaWcgKGNoYXIgY29u
c3QgKm9wZXJhbmQsIGNoYXIgKnNpZ25hbWUpCiAgICAgICBjaGFyICplbmRwOwogICAgICAg
bG9uZyBpbnQgbCA9IChlcnJubyA9IDAsIHN0cnRvbCAob3BlcmFuZCwgJmVuZHAsIDEwKSk7
CiAgICAgICBpbnQgaSA9IGw7Ci0gICAgICBzaWdudW0gPSAob3BlcmFuZCA9PSBlbmRwIHx8
ICplbmRwIHx8IGVycm5vIHx8IGkgIT0gbCA/IC0xCi0gICAgICAgICAgICAgICAgOiBXSUZT
SUdOQUxFRCAoaSkgPyBXVEVSTVNJRyAoaSkgOiBpKTsKKyAgICAgIHNpZ251bSA9IChvcGVy
YW5kID09IGVuZHAgfHwgKmVuZHAgfHwgZXJybm8gfHwgaSAhPSBsID8gLTEgOiBpKTsKKwor
ICAgICAgaWYgKHNpZ251bSAhPSAtMSkKKyAgICAgICAgeworICAgICAgICAgIC8qIE5vdGUg
QUlYIHVzZXMgYSBkaWZmZXJlbnQgYml0IHBhdHRlcm4gZm9yIHN0YXR1cyByZXR1cm5lZAor
ICAgICAgICAgICAgIGZyb20gc2hlbGwgYW5kIHdhaXQoKSwgc28gd2UgY2FuJ3QgdXNlIFdU
RVJNU0lHIGV0Yy4gaGVyZS4KKyAgICAgICAgICAgICBBbHNvIGtzaCByZXR1cm5zIDB4RkYg
KyBzaWduYWwgbnVtYmVyLiAgKi8KKyAgICAgICAgICBzaWdudW0gJj0gc2lnbnVtID49IDB4
RkYgPyAweEZGIDogMHg3RjsKKyAgICAgICAgfQogICAgIH0KICAgZWxzZQogICAgIHsKLS0g
CjIuOS4zCgo=
--------------1FFCF82A0DBF1577BC1EDE48--


From MAILER-DAEMON Fri Aug 04 03:47:57 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ddXKv-0004RE-PS
	for mharc-coreutils@gnu.org; Fri, 04 Aug 2017 03:47:57 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43515)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddXKt-0004QV-Is
	for coreutils@gnu.org; Fri, 04 Aug 2017 03:47:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1ddXKp-00073B-1i
	for coreutils@gnu.org; Fri, 04 Aug 2017 03:47:55 -0400
Received: from mx1.redhat.com ([209.132.183.28]:40362)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1ddXKo-00071H-Rd
	for coreutils@gnu.org; Fri, 04 Aug 2017 03:47:50 -0400
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
	[10.5.11.11])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 70F28C04B94B;
	Fri,  4 Aug 2017 07:47:49 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70F28C04B94B
Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BD9D89A83;
	Fri,  4 Aug 2017 07:47:49 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: coreutils@gnu.org
Subject: Re: [PATCH 3/4] copy: make backup files more reliably
Date: Fri, 04 Aug 2017 09:47:55 +0200
Message-ID: <1996487.qmIeWq5Une@kdudka-nb>
User-Agent: KMail/4.14.10 (Linux/4.9.34-gentoo; KDE/4.14.32; x86_64; ; )
In-Reply-To: <0e1ca8f2-3ef5-e494-d99c-299261422084@cs.ucla.edu>
References: <1501460347-19275-1-git-send-email-eggert@cs.ucla.edu>
	<2563463.8lPOtgPHDg@kdudka-nb>
	<0e1ca8f2-3ef5-e494-d99c-299261422084@cs.ucla.edu>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.31]);
	Fri, 04 Aug 2017 07:47:49 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Fri, 04 Aug 2017 07:47:56 -0000

On Thursday, August 03, 2017 13:47:07 Paul Eggert wrote:
> On 08/03/2017 06:02 AM, Kamil Dudka wrote:
> >> I suppose we could change the diagnostic to say "might destroy source"
> >> rather than "would destroy source". That would be more accurate.
> > 
> > Sounds reasonable.
> 
> OK, I installed the attached.

Thanks!

It would have been good to mention where the inaccuracy comes from.  Namely, 
that a fully sequential reproducer exists that triggers the false positive.

Kamil


From MAILER-DAEMON Mon Aug 07 03:49:42 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1decnG-0004GH-7Y
	for mharc-coreutils@gnu.org; Mon, 07 Aug 2017 03:49:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39840)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <silverblood1339@gmail.com>) id 1deX4b-000509-PP
	for coreutils@gnu.org; Sun, 06 Aug 2017 21:43:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <silverblood1339@gmail.com>) id 1deX4a-0001wR-Qm
	for coreutils@gnu.org; Sun, 06 Aug 2017 21:43:13 -0400
Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:34077)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <silverblood1339@gmail.com>)
	id 1deX4a-0001vV-JG
	for coreutils@gnu.org; Sun, 06 Aug 2017 21:43:12 -0400
Received: by mail-wm0-x234.google.com with SMTP id t138so23241098wmt.1
	for <coreutils@gnu.org>; Sun, 06 Aug 2017 18:43:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=/8iIE2/j/mu0M8suGbGW7wZgLG03PH7bSoI0usqEac0=;
	b=j56XxIUMkmLKFZMjuYvUcAhyFcJ7r75w7VcOMOSsgTxiM+qtg3ox98o6vpfl7Ukk8Q
	T9cDxgBfsXQY/D5Ire3qjvDwUZCB30ps1JNovVyYU5Ub/QLOoysmgXbfZf19BXHg7ypF
	h3E0ZSizbcN/oTfgR7XZRVlfYBKgS59Jh0kt1QeF/ofkfN4t1oLJWAKHspfavzXEwa4c
	tL69ulByvsYMBeN2J27FOB4X26p0TCAL+qh1VwyUTtqvi4nE8O8KM3iZgTEahjKGHjDT
	Hmc2T2asKZiuMtjRb4ulO07/B8bpKlcGaRH80uHDGqwVS5gd9x/PSNbXV+D1pgMqORk0
	bqjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=/8iIE2/j/mu0M8suGbGW7wZgLG03PH7bSoI0usqEac0=;
	b=RCnUJL8k3iw+l4cJoMLpHi3RKPcuNLS2JH3fAwZNwIv+bYggUjO23imwpxymqpySug
	V3qFqbnSx6icxBuy36iHQUzc4HxJWjuSz7it9jqNa4ljete+AOny0lcAHY9P8N8j99hv
	0iG8H+ObIp+8pAdRI2T/lRy54x9q4K7K/EDcCSFUS4UIb64CMolgjavTZyDwrSVXQc+w
	d0m7QvLlHRylv/nP4DLxSTkPWfQ2LFRiTByNyUAhdvRZWs2EzvnuIdLSwxYmJZCWaGyk
	VuxIZGzF9t567TDlo3Fva3ugrs4s4yBHUQ/ZTOirqsBuuVfHWK29jjDZeiyBPj7I+Ika
	6YOg==
X-Gm-Message-State: AHYfb5hqkUzcX+OftWnbmLgpu0ZXNk0/Vn2M1MaC5guBd+Wtfx0QHsW8
	auArSYMmFQgAoWHn84w1wMn2HyEuVt4S
X-Received: by 10.80.213.216 with SMTP id g24mr8817891edj.176.1502070189790;
	Sun, 06 Aug 2017 18:43:09 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.80.137.47 with HTTP; Sun, 6 Aug 2017 18:43:09 -0700 (PDT)
From: Jake Silver <silverblood1339@gmail.com>
Date: Sun, 6 Aug 2017 18:43:09 -0700
Message-ID: <CAMTBHLSKAxeu-669MZu+S=KR4Xj1oaUxr2mLYw1ubiYDdriVUQ@mail.gmail.com>
Subject: updates are disabled PLEASE HELP
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2a00:1450:400c:c09::234
X-Mailman-Approved-At: Mon, 07 Aug 2017 03:49:41 -0400
Content-Type: text/plain; charset="UTF-8"
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: Mon, 07 Aug 2017 01:43:15 -0000

i've been digging for two months now. i'm at a major loss and also fear
that my free geek, linux mint, ubuntunu laptop is going to burst into
flames if i am not able to update.

i've googled to the four winds, countless times now and know essentially
nothing about command prompt.

here's the continued error:

The method driver /usr/lib/apt/methods/http could not be found.The method
driver /usr/lib/apt/methods/http could not be found.The method driver
/usr/lib/apt/methods/http could not be found.The method driver
/usr/lib/apt/methods/http could not be found.The method driver
/usr/lib/apt/methods/http could not be found.The method driver
/usr/lib/apt/methods/http could not be found.

PLEASE HELP

From MAILER-DAEMON Wed Aug 09 09:50:03 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dfRN5-0007G1-O9
	for mharc-coreutils@gnu.org; Wed, 09 Aug 2017 09:50:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40921)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dfRN3-0007EC-2Q
	for coreutils@gnu.org; Wed, 09 Aug 2017 09:50:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dfRMz-0000fP-UI
	for coreutils@gnu.org; Wed, 09 Aug 2017 09:50:01 -0400
Received: from mout.kundenserver.de ([212.227.126.133]:55470)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dfRMz-0000dw-HV
	for coreutils@gnu.org; Wed, 09 Aug 2017 09:49:57 -0400
Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de
	(mreue004 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0LeQ93-1dIEaC0EZB-00q78o; Wed, 09 Aug 2017 15:49:53 +0200
Subject: Re: updates are disabled PLEASE HELP
To: Jake Silver <silverblood1339@gmail.com>, coreutils@gnu.org
References: <CAMTBHLSKAxeu-669MZu+S=KR4Xj1oaUxr2mLYw1ubiYDdriVUQ@mail.gmail.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <4bb8712d-1fe6-aac5-1365-e5b1b520d054@bernhard-voelker.de>
Date: Wed, 9 Aug 2017 15:49:52 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <CAMTBHLSKAxeu-669MZu+S=KR4Xj1oaUxr2mLYw1ubiYDdriVUQ@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: de-DE-1901
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:CsTj9DcXU+ZajmXddBeo6+Qy5ub7ST5Bz4Z0EJCJYQE3l2Hf6RR
	LxyayNHf7b5Yvg5KbEW9LdQPOZae2+NXMISc6/R5p+LWyBQ7836xNfTF3V2ybpUNB5yFUva
	JMVwBbNry/dWHsSuMVLvpqG4jBa44EN0kqxUspyk91p1CqlfpIUN1RK0ZPP1aljTSxVJDfs
	x3Rb7JC2Yw0S1V2D4kGsA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:ExrfB7EtUmc=:kmGuf2mHtERoZU3Z2lvCgU
	AwM74fgK4BnEuYhePbNLARWR0I66fogmugRLcTgSZl3AAU89MIgwh13iUATcpp9CR89ziQA7J
	MRLsCJWiVzKib6CCGgJdUo685xgODUmEdQfLUXHEAXmF67hWxFBhvUK3wMf0jacI5P6jcUjJI
	P+5CLddSuD0OzmL/whuiMHO8W330RGzX/2VjEfehKtWEUNZ9d28QUWZWyPc+uX/y+k/tpMZKX
	vrTdBp8o7QazsbLC+chJAyj6iL0PIU4hAMVnJGthBHekLmwUqeq10Rxg5UroQR0JbMu/R1+qm
	CgYyUku38gQOe+OSZlNDIzBRBcGdq27IrrFmolHfshSh+wjD9rfTuYO5V6pUfaSc+jyBgTcY2
	WQHzz04Llj4KnqxZNqwY4w7iMaN4QWbleb7S0ADcHTC+o2vqvlcBWb8nl8x3W+7av3ovsmgRq
	Yj2t/AYLo9U/Wdbu+ACWkA4sdvWqPoFoenxWvh1/BACkOPFToAO3TcqRBw039WIoZPiHW9Y5M
	wnUldOcGIV9W1h+V9C6tEZHLC23hvXxsIXUFMKJ9bx0nUZcBpU8tqC35umHRuCnMmMx/vfhT2
	lJhweqkfDIkcKUSRmtB/QDI7+480h0IW1KyDfXkD5n+rugdU0drOut5/+dXdwXP7u+CR72mEf
	IM2VFUm9oUdjcz5sxlMyaBEvrB5xGwhZIG+jrGqvHTlxA7Rr/fNdp530YoveGEIwORQqLBNuB
	xZPEGrpS99+C/G4gj0iFXhpQFBn47f5MLsYrQyXJf2Zyc33j9hhTWYoNAww=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.133
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, 09 Aug 2017 13:50:02 -0000

On 08/07/2017 03:43 AM, Jake Silver wrote:
> i've been digging for two months now. i'm at a major loss and also fear
> that my free geek, linux mint, ubuntunu laptop is going to burst into
> flames if i am not able to update.
> 
> i've googled to the four winds, countless times now and know essentially
> nothing about command prompt.
> 
> here's the continued error:
> 
> The method driver /usr/lib/apt/methods/http could not be found.The method
> driver /usr/lib/apt/methods/http could not be found.The method driver
> /usr/lib/apt/methods/http could not be found.The method driver
> /usr/lib/apt/methods/http could not be found.The method driver
> /usr/lib/apt/methods/http could not be found.The method driver
> /usr/lib/apt/methods/http could not be found.
> 
> PLEASE HELP

You reached the GNU Coreutils mailing list on which topics are discussed
which are related to the programs of the coreutils suite.
see https://www.gnu.org/software/coreutils/manual/

The situation you describe is totally unrelated to one of these programs.
Therefore, I'm afraid you won't get much help here.
You're better off asking on the right channel for your distribution
(in this case Mint or Ubuntu?).

P.S. Putting your laptop on fire won't help either. ;-)

Have a nice day,
Berny


From MAILER-DAEMON Thu Aug 10 12:26:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dfqHn-0008PM-HJ
	for mharc-coreutils@gnu.org; Thu, 10 Aug 2017 12:26:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54732)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dfqHl-0008IM-DZ
	for coreutils@gnu.org; Thu, 10 Aug 2017 12:26:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dfqHk-0007wX-Dl
	for coreutils@gnu.org; Thu, 10 Aug 2017 12:26:13 -0400
Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]:34118)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dfqHk-0007sg-7V
	for coreutils@gnu.org; Thu, 10 Aug 2017 12:26:12 -0400
Received: by mail-pg0-x22d.google.com with SMTP id u185so4957656pgb.1
	for <coreutils@gnu.org>; Thu, 10 Aug 2017 09:26:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=sender:from:to:subject:date:message-id:mime-version;
	bh=9o/4CBYBTrelvgMbP0/yMDONMLlhGf3MdoSYPKRdEd8=;
	b=W4w4wxC8/5Iz0SCIDdoCHqe4TbO6aZvgS3kINSBwKcmtm4s2OrtoW1DxA3PqxoI83L
	YLEBxmtoqtlCus/wLZRCskI1RdXUOo0dkLf1XVBLfc5UaOsb+A8+v73FhJSPvURi5nLJ
	Vu7lWDWwCAz+eclGpTIu/Yc6giWVeTukv7KLs/iC1lBJfM4NfzC3vxNKlmcvdYl+92E3
	V5KzDLi57h+mV2y/mhStSdAT822+ACVwT0ICixhmGNhNzytU0o5q60V2mU8nThCKHe26
	6GXgs542N7ZHQdaFJkmBpn2FIpKj73Yk0n/yDJ5mMLMo03wasrGJhT5e63nUsAMAiJV+
	zcKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:sender:from:to:subject:date:message-id
	:mime-version;
	bh=9o/4CBYBTrelvgMbP0/yMDONMLlhGf3MdoSYPKRdEd8=;
	b=kkcwSeSEfd3rsObAs8dT9uSbJhdpagFSj5ah+WpFGau1pNK42HGkqtaK6Je2vYw9G9
	UjQXagWJgTmleceqJDp/tDHtru/9xVrAqRgjZk4pNOAXrf9dAJU8AXXFyu0xVlYvU/hp
	l/CNPTcIBbd2X3vsd2RqsjdY3lISDd9UrajVV7uoIQlLEQFwTm1GPD1bvU7dZyG8BJMJ
	0/NRhDIeMR4X6K/YhBahwFvNFUkl2X+YSP/p1tVOnpKTADjMpgUwSggORD2eDUmTBkk1
	W/cVF6xjuzXsIRjtsa6WM0gv0omHhbPQX34Rc/YaqK0p2tKHdfo3ja+v9gNrAtTSbuzm
	Qqow==
X-Gm-Message-State: AHYfb5gUAk+0d/ZDC56cE7VpEq3DqLOeyv530aQA1NX7n5mDBsWnS+FY
	g5YmXE1bgfkbrzSC
X-Received: by 10.84.214.2 with SMTP id h2mr8434200pli.436.1502382369537;
	Thu, 10 Aug 2017 09:26:09 -0700 (PDT)
Received: from dhcp-172-26-112-252.dhcp.thefacebook.com
	([2620:10d:c090:180::1:4d63]) by smtp.gmail.com with ESMTPSA id
	s67sm10561296pgb.13.2017.08.10.09.26.08 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Thu, 10 Aug 2017 09:26:08 -0700 (PDT)
Sender: Jim Meyering <meyering@gmail.com>
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] doc: correct technicality in chroot's --help output
Date: Thu, 10 Aug 2017 09:26:00 -0700
Message-ID: <lubpf3fuczl78n.fsf@meyering.net>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400e:c05::22d
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, 10 Aug 2017 16:26:14 -0000

I noticed a nit in chroot's --help output.
I.e., what if the expansion of $SHELL contains white space or shell
metacharacters? You can argue they'd get what they deserve :-)
But still... we care about robustness, even if it's only in
--help output's implied advice.

* src/chroot.c (usage): Use correct quoting in descriptive diagnostic.
We would run `"$SHELL" -i`, not `${SHELL} -i`.
---
 src/chroot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/chroot.c b/src/chroot.c
index 885048f1e..b8b72586d 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -207,7 +207,7 @@ Run COMMAND with root directory set to NEWROOT.\n\
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
 \n\
-If no command is given, run '${SHELL} -i' (default: '/bin/sh -i').\n\
+If no command is given, run '"$SHELL" -i' (default: '/bin/sh -i').\n\
 "), stdout);
       emit_ancillary_info (PROGRAM_NAME);
     }
-- 
2.13.0



From MAILER-DAEMON Thu Aug 10 21:29:45 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dfyll-0004Sh-3P
	for mharc-coreutils@gnu.org; Thu, 10 Aug 2017 21:29:45 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36700)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <marton.kun.szabo@gmail.com>) id 1dfwMb-0004c9-DV
	for coreutils@gnu.org; Thu, 10 Aug 2017 18:55:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <marton.kun.szabo@gmail.com>) id 1dfwMa-0003yr-8L
	for coreutils@gnu.org; Thu, 10 Aug 2017 18:55:37 -0400
Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]:36194)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <marton.kun.szabo@gmail.com>)
	id 1dfwMa-0003yf-3U
	for coreutils@gnu.org; Thu, 10 Aug 2017 18:55:36 -0400
Received: by mail-it0-x22b.google.com with SMTP id 77so20542411itj.1
	for <coreutils@gnu.org>; Thu, 10 Aug 2017 15:55:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=OjA2qCo//zXmEoRuJHbmxZSW1EecDmcx21KOWF7d0gs=;
	b=uor5kTICpw9HbWd30RbwAt0/+c8sANcVZOx1AbYzWt7Xtay6Pn1y3dAp8UGNms0/Cv
	x1mokrmAZwcPr8O8LvV520jWnl/qC3yy459tUv6VHksH+lN+GstDEU/A61hCV1/Vgslt
	HSXFIb+bVzBseryc2dA1Zgb/zWFcAfjYEBT3wRRvUfGaUYJrhsLZ9K5wbrdBSdixuDec
	4mV3qmZ22KwjvgmP7jk9sxyM7SJCf1zTdqqzBvMWy9P5/klNkbt/HJljw78t5AY2Gh9d
	i8vK3V0gagczHDe1eufu3a6A5uHqIoxt6K0A/NyAJkgMHyKy2HAMmYAye2Fz6wh2rvJg
	byDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=OjA2qCo//zXmEoRuJHbmxZSW1EecDmcx21KOWF7d0gs=;
	b=kX7zJ176KpBdyDGaA699+iB0OIrQbvOq1qpATpLX6bpqkpX3wJQrPcNFbxSVlSIj+f
	ZFZB/y1ZSes8g9RxxJkssH1y1bIREGUn7m5UjvOmfe+Chiu0/EUiQNkbQU2OVknx8t0G
	N+5g8p773zip5Kr0LaBRW14nc6lm5Ue3EymnPFkUdSk0odTX19YX6RIKo6QIKgW3tohI
	TnHUtklJxVw7GUu3KHn0PC1Vucd0Wf+duG3f8aOGCX1O7gdXj2XcEk9ZIQRJWZ0fENY8
	/1RE8gY7ZI+DFBd2kUtpk2oRoZia5k6sWGOrHXzBT5neiztfE737bEwTSQM65qUmSK3/
	G/0g==
X-Gm-Message-State: AHYfb5iE2SENz4Zpff61r/KzYM0abxTtbkdCQrZtPjxrOUy5pZSVDoFM
	Yncc1GmLRTO7ACYgpEB4nccx8qzzyGkj
X-Received: by 10.36.98.139 with SMTP id d133mr11787115itc.115.1502405735243; 
	Thu, 10 Aug 2017 15:55:35 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.50.203.9 with HTTP; Thu, 10 Aug 2017 15:55:34 -0700 (PDT)
From: Marton Kun-Szabo <marton.kun.szabo@gmail.com>
Date: Thu, 10 Aug 2017 15:55:34 -0700
Message-ID: <CANOzD6UHHtB2cSnvjdWa+dPSUAHbk6xmMhjgfwrSuXQ3K2HN-Q@mail.gmail.com>
Subject: test: hidden files
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::22b
X-Mailman-Approved-At: Thu, 10 Aug 2017 21:29:43 -0400
Content-Type: text/plain; charset="UTF-8"
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, 10 Aug 2017 22:55:38 -0000

Dear coreutils-dev,

I'd like to add a new feature to "test" that checks whether a file exists
and is hidden (the first character of the filename is a dot). I think this
is a useful and universal feature that is currently missing from "test" and
is not on the list of rejected features yet.
The "-H' argument is currently unused, the main modification would look
like this:

src/test.c

+    case 'H':           /* File is hidden? */
+      unary_advance ();
+      return (stat (argv[pos - 1], &stat_buf) == 0
+              && (argv[pos - 1][0] == '.'));
+

I would be happy to implement this feature along with all the necessary
documentation (both in coreutils.texi and in the "--help" section) and
submit a patch when everything is done.

Questions:
 1) Is this a useful feature? Or would it end up on the list of rejected
features?
 2) Any planned other use of the "H" argument in the future?
 3) Any comments on the above implementation?

Thanks, regards,
Marton Kun-Szabo

From MAILER-DAEMON Fri Aug 11 20:51:30 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dgKeI-0003xe-Il
	for mharc-coreutils@gnu.org; Fri, 11 Aug 2017 20:51:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33994)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dgKeF-0003wS-Ok
	for coreutils@gnu.org; Fri, 11 Aug 2017 20:51:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dgKeD-0000AU-Co
	for coreutils@gnu.org; Fri, 11 Aug 2017 20:51:26 -0400
Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:36363)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dgKeD-000081-6W
	for coreutils@gnu.org; Fri, 11 Aug 2017 20:51:25 -0400
Received: by mail-pf0-x22a.google.com with SMTP id c28so21599261pfe.3
	for <coreutils@gnu.org>; Fri, 11 Aug 2017 17:51:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=sender:from:to:subject:date:message-id:mime-version;
	bh=i1tUQr/XFBEPU/a7VL6fiJ1iQZJTXpRk3M54wNffYDo=;
	b=LlDsmfnChUSs20svcM7X3QtPUz0HNzFi1UJbJCm4J1BGVapixWxaddBidvQMlnScLU
	kl/k33gDeUUeIGHkxDM32dfPOup2Z90ah2GhqISRF9cfDokbcdwFjyCURosMxaZfFiyk
	5M+pvkai4th31MvOoSxwxczGtv5wXI+cXnwon0YufqnsAUCBKZ3lPh4d0pgLJ5sgD5h3
	VskTj+8T3yZoVZOyXPkksOlVbwWyITYYzzj/N+uGFu0y8vcXfpIWGRUHZZdGtLY9Ezkm
	gnBaKGH5R8fgbRq0qSP0uD3xO+Ra3QBjRLz2Arz6b35+f5JGKiX0LGUxz+o96cR9Oe4y
	Ztbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:sender:from:to:subject:date:message-id
	:mime-version;
	bh=i1tUQr/XFBEPU/a7VL6fiJ1iQZJTXpRk3M54wNffYDo=;
	b=mXAmTUeQVqruZSYr0fXZsQN9RlcTClRz8tBzewe1TzqLBCLjqKipekFco0hG49EXiC
	m337+Ts1nyuiqU3CPkBZnxNLKAC7BeHDYhXeSfvnBuiLa0HV9iYj3B9f78i775lqXwEw
	0EBXcogbOTVRMX3iex97zlKjph0bTfWJTnw8m6XJZp5aXgjbrCkI3jfITPX8pJeI1YUs
	IBvWKA4LBvA1FArIaiLI+dy4yGdxXUCWE1mdfC3ogMGGcvYLxpv9y+eX0LgPUA422n/n
	ytxJRdti9R5F7MWmtMipqgWIi5wQ03inDVagY+EHjtRT1aI6kwtYgP5Y2XcB4T5MI8Cc
	aGuQ==
X-Gm-Message-State: AHYfb5i4RMiYGTm3nQo/dYf9WVA3yL/HUhKqwgFQF5ykMynhTrmyHhM7
	As0BeVlBY2MiSe00
X-Received: by 10.99.111.134 with SMTP id k128mr16879489pgc.431.1502499082145; 
	Fri, 11 Aug 2017 17:51:22 -0700 (PDT)
Received: from dhcp-172-26-112-252.dhcp.thefacebook.com
	([2620:10d:c090:180::1:2f21]) by smtp.gmail.com with ESMTPSA id
	u186sm3713717pfu.82.2017.08.11.17.51.20 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Fri, 11 Aug 2017 17:51:21 -0700 (PDT)
Sender: Jim Meyering <meyering@gmail.com>
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] chroot: fix typo in preceding change: didn't compile
Date: Fri, 11 Aug 2017 17:51:14 -0700
Message-ID: <lubpf3o9rla9rx.fsf@meyering.net>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400e:c00::22a
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, 12 Aug 2017 00:51:28 -0000

I've just made this correction:

* src/chroot.c (usage): Add backslashes.
---
 src/chroot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/chroot.c b/src/chroot.c
index b8b72586d..830e619f7 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -207,7 +207,7 @@ Run COMMAND with root directory set to NEWROOT.\n\
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
 \n\
-If no command is given, run '"$SHELL" -i' (default: '/bin/sh -i').\n\
+If no command is given, run '\"$SHELL\" -i' (default: '/bin/sh -i').\n\
 "), stdout);
       emit_ancillary_info (PROGRAM_NAME);
     }
--
2.13.4


From MAILER-DAEMON Sat Aug 12 17:16:33 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dgdlp-00042t-6v
	for mharc-coreutils@gnu.org; Sat, 12 Aug 2017 17:16:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53805)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dgdlj-00042X-6f
	for coreutils@gnu.org; Sat, 12 Aug 2017 17:16:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dgdle-0003Lq-Jb
	for coreutils@gnu.org; Sat, 12 Aug 2017 17:16:27 -0400
Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]:33391)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dgdle-0003LW-DZ
	for coreutils@gnu.org; Sat, 12 Aug 2017 17:16:22 -0400
Received: by mail-pg0-x22d.google.com with SMTP id u5so27746701pgn.0
	for <coreutils@gnu.org>; Sat, 12 Aug 2017 14:16:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=sender:from:to:subject:date:message-id:mime-version;
	bh=OwRtLZtCdQ27yWqC0DJnJaxwvmDE8fl2fPFHfugqj1k=;
	b=K8Ne4KdC46xU7HyK+rO18e/r51BAnttylYwSRRtBJfEGM8Tp+SF1H43IXnE3w96H+L
	QOPRXQef6FGm0baB3uKsgTpF238DmJL8QjIzEkZRaraklWc/e7pjY65egGoeHfsnxtVp
	5SX5AzoAsAM2W35cgBDHdpglnE0535KlB+tMpbfAqxGyfLcPMOqo6qcMvrjpKJfLFlF0
	61ABaFC9w6TXoPJWhM7FbMFX671SVKrT/Oc3mLHofoBfutHWNm0u8W1nTg0k/apeNAKJ
	8Yp1yoOpq/YPeVc6WNDbWcoCKbAx3ZKv4/Ac0CMLn2+/u7MzvqR+CWKnJw6r5FvdekKn
	rgkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:sender:from:to:subject:date:message-id
	:mime-version;
	bh=OwRtLZtCdQ27yWqC0DJnJaxwvmDE8fl2fPFHfugqj1k=;
	b=gKT1tXAdPEZQQJRhdHMfDPuHOTWTvrZ9L+wJ86wGPhPT9A1FllBIFvui5Lu4At61Vz
	7y+9nl2lj1PPNe8GAsMykG4YEsDGoj+MyK3QgD0RiVw97ad9fYYksh4Irkv3B0E/+v+w
	Qp3u4GsBdHGNTGxKL6iTnY8oEBScDL54vuTmuG546NrZdpKbn9coNxy0CCywwfpM4n38
	REGZBW8wBxRoOZMgW5dPDNzqlejW6mYOUh0whefRefG69ZXW+PluR7Ya0MeWYwIMQduK
	fdb0H31xRtQC8v/GlZqDf21Vb7gjimHZxUXZA0qRXMjaHBtO+oqEV+jgUXkevpIAcy9l
	Sa8Q==
X-Gm-Message-State: AHYfb5htdknGIyXpGCASVAD2rIHU9adK3ZZcyENIVc1IL9ivvKxajXuQ
	8sdcVNRw3bbw0fXi
X-Received: by 10.84.132.46 with SMTP id 43mr22235373ple.409.1502572581071;
	Sat, 12 Aug 2017 14:16:21 -0700 (PDT)
Received: from dhcp-172-26-112-252.dhcp.thefacebook.com
	([2620:10d:c090:180::1:163]) by smtp.gmail.com with ESMTPSA id
	a86sm7387242pfe.181.2017.08.12.14.16.19 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Sat, 12 Aug 2017 14:16:19 -0700 (PDT)
Sender: Jim Meyering <meyering@gmail.com>
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: 2 patches: build with warnings enabled and latest gcc
Date: Sat, 12 Aug 2017 14:16:12 -0700
Message-ID: <lubpf3bmnktrkz.fsf@meyering.net>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400e:c05::22d
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, 12 Aug 2017 21:16:31 -0000

I tried to build coreutils with warnings enabled and using the latest
gcc (built from head of gcc.git) and was irritated to see it fail with
a few of the new warnings evoking apparent false positives, like these:

  lib/human.c: In function 'human_readable':
  lib/human.c:232:24: error: '%.0Lf' directive output between 1 and 4934 \
    bytes may exceed minimum required size of 4095 [-Werror=format-overflow=]
       sprintf (buf, "%.0Lf", adjust_value (inexact_style, damt));

  parse-datetime.y:1626:33: error: ' TZ=' directive output truncated writing \
   4 bytes into a region of size 1 [-Werror=format-truncation=]
  parse-datetime.y:1626:33: note: assuming directive output of 1 byte
  In file included from /usr/include/stdio.h:939:0,
                   from ./lib/stdio.h:43,
                   from parse-datetime.y:68:
  /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output 5 \
     or more bytes (assuming 6) into a destination of size 1
     return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          __bos (__s), __fmt, __va_arg_pack ());
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hoping they'd been addressed in latest gnulib, I tried updating the submodule,
but with that, even bootstrap failed due to inability to apply coreutils'
gl/modules/tempname.diff patch.

I adjusted that .diff file and upgraded gnulib to latest in the first patch
below, but the warning/error issues persisted, so I disabled the offenders
via the second patch.  Now, "make distcheck" nearly completes.

I'll push these soon if no one objects.

>From 0b7fababf893803505e0382f71dc755951c98cc8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Fri, 11 Aug 2017 17:33:15 -0700
Subject: [PATCH 1/2] gnulib: update to latest and adjust
 gl/modules/tempname.diff

* gnulib: Update to latest.
* gl/modules/tempname.diff: This patch failed to apply.
Adjust it to reflect removal of the secure_getenv dependency.
---
 gl/modules/tempname.diff | 3 +--
 gnulib                   | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/gl/modules/tempname.diff b/gl/modules/tempname.diff
index 4aee47c6f..d572734b6 100644
--- a/gl/modules/tempname.diff
+++ b/gl/modules/tempname.diff
@@ -2,12 +2,11 @@ diff --git a/modules/tempname b/modules/tempname
 index 570ea54..f1be8ff 100644
 --- a/modules/tempname
 +++ b/modules/tempname
-@@ -12,7 +12,9 @@ extensions
+@@ -12,6 +12,8 @@
  fcntl-h
  gettimeofday
  lstat
 +randint
- secure_getenv
 +stdbool
  stdint
  sys_stat
diff --git a/gnulib b/gnulib
index ac2fdcad6..0474f8e6a 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit ac2fdcad666d24d51a32a152fe1b3911b610344d
+Subproject commit 0474f8e6a85621c276dfc47099b9863a47f96a0d
--
2.14.1.145.gb3622a4ee


>From 96101eef33b2a56bd169560cd806b4b3237d2430 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Sat, 12 Aug 2017 13:51:19 -0700
Subject: [PATCH 2/2] build: adjust warning options to work with latest GCC

* configure.ac: Disable some new warnings to avoid false positives.
Building with warnings enabled and latest gcc would evoke build
failure without these changes.  Disable the following in coreutils
proper: -Wformat-overflow=2 -Wformat-truncation=2, and
disable these for gnulib: -Wformat-truncation=2 -Wduplicated-branches
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 7c7c8c238..73e445d02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,8 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wswitch-default"         # Too many warnings for now
   nw="$nw -Wstack-protector"        # not worth working around
   nw="$nw -Wtype-limits"            # False alarms for portable code
+  nw="$nw -Wformat-overflow=2"      # False alarms due to GCC bug 80776
+  nw="$nw -Wformat-truncation=2"    # False alarm in ls.c, probably related
   # things I might fix soon:
   nw="$nw -Wfloat-equal"            # sort.c, seq.c
   nw="$nw -Wmissing-format-attribute" # copy.c
@@ -193,6 +195,8 @@ if test "$gl_gcc_warnings" = yes; then
   # We use a slightly smaller set of warning options for lib/.
   # Remove the following and save the result in GNULIB_WARN_CFLAGS.
   nw=
+  nw="$nw -Wduplicated-branches"    # Too many false alarms
+  nw="$nw -Wformat-truncation=2"
   nw="$nw -Wstrict-overflow"
   nw="$nw -Wuninitialized"
   nw="$nw -Wunused-macros"
--
2.14.1.145.gb3622a4ee


From MAILER-DAEMON Sat Aug 12 21:27:07 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dghgI-0004up-SF
	for mharc-coreutils@gnu.org; Sat, 12 Aug 2017 21:27:06 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49412)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dghgG-0004uM-35
	for coreutils@gnu.org; Sat, 12 Aug 2017 21:27:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dghgF-0002Gz-8j
	for coreutils@gnu.org; Sat, 12 Aug 2017 21:27:04 -0400
Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:37879)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dghgF-0002Gc-43
	for coreutils@gnu.org; Sat, 12 Aug 2017 21:27:03 -0400
Received: by mail-vk0-x235.google.com with SMTP id r199so23304491vke.4
	for <coreutils@gnu.org>; Sat, 12 Aug 2017 18:27:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to; bh=piada/p14eKyGn8Myb7GqCDOBWNpwJsnkj7vR0uQCws=;
	b=Pb5qZyunyDi0UGIspBBoT4PIL3OvNbLjVgQieRdba/V2kw2HKsop/kfGEGxIE3VsJL
	LZESmXtGSgTnrkF5UOqbWPTouV7RcrHxaI42oUzQpDLcVnU3TmYbKYB+s2iQt02cZLy7
	zJKxqyfuIPR1c6bLTmygfrS7Ns/gfrFZaEYhpcEmBjbM4wBZ1tM4+qPjb6vEH+5SM/Hf
	os4s46xlV7KQmnRqXyCqMQ1HnUmEo74GhhRFfjfA8H6ckETDemG+95SKKCH2EosOGbAD
	sU4jgCRSaUPQPpliKH4GEUes/i4FzSuyJw9XI2qzwlRc1bTHUUnX+SNrUJO9GAeK4D6d
	snBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to;
	bh=piada/p14eKyGn8Myb7GqCDOBWNpwJsnkj7vR0uQCws=;
	b=JS78IXvmfwbxZW71dH2+PnLGtWlqRRWApx383qxIvEAz5mTOjHmlMzr9yaiZDkeJze
	m8wPXIB4WIYSQlCPjwZ7VW6idUbvAXUvLQ6gGc/vmbky58dmbmY9oIqT97mQATTuInQH
	nDBeuNE9pDxRizOIgJSVL4pXfp1Er9h5wPKVVk3ZcSPlpq9+LE90g4G21sf9OT49PEYM
	GUrc1mzkt3xLtiOJH9/KkzxLGCGH80m/C/88tZKOfHwpmRdh1xUWHSd0ACZuBnFIz1FR
	4LKuVoDNppdu86u4C8K+YiVBoSlgtqTyBwK8i5LFbPoDG3T4hFGUi7tuOBPWgmrUVTln
	TLjg==
X-Gm-Message-State: AHYfb5i+buM94cW/98ynKG8siEqzrR1qOLlgWPuBn/x4shn64dNnkiWY
	4y/zAx1IhIjQ8/Ys/57uUw/ZRrULfQ==
X-Received: by 10.31.48.79 with SMTP id w76mr8877347vkw.51.1502587620404; Sat,
	12 Aug 2017 18:27:00 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.176.75.161 with HTTP; Sat, 12 Aug 2017 18:26:39 -0700 (PDT)
In-Reply-To: <lubpf3bmnktrkz.fsf@meyering.net>
References: <lubpf3bmnktrkz.fsf@meyering.net>
From: Jim Meyering <jim@meyering.net>
Date: Sat, 12 Aug 2017 18:26:39 -0700
X-Google-Sender-Auth: D2sCBNElJZNBmuSBLpdjvMS7eVQ
Message-ID: <CA+8g5KGEeOqkBsceyR8_mXJd5qtUXWu26P_dDK6YyE_mWszMSw@mail.gmail.com>
Subject: Re: 2 patches: build with warnings enabled and latest gcc
To: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c05::235
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, 13 Aug 2017 01:27:05 -0000

On Sat, Aug 12, 2017 at 2:16 PM, Jim Meyering <jim@meyering.net> wrote:
> I tried to build coreutils with warnings enabled and using the latest
> gcc (built from head of gcc.git) and was irritated to see it fail with
> a few of the new warnings evoking apparent false positives, like these:
...
> Now, "make distcheck" nearly completes.
>
> I'll push these soon if no one objects.

Pushed. Btw, while "make distcheck" failed once near the end, with a
warning about an empty coreutils.info, I have so far failed to
reproduce it.


From MAILER-DAEMON Sun Aug 13 04:30:28 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dgoI0-0003GF-70
	for mharc-coreutils@gnu.org; Sun, 13 Aug 2017 04:30:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49797)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dgoHx-0003Fi-KP
	for coreutils@gnu.org; Sun, 13 Aug 2017 04:30:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dgoHu-0005kT-Hf
	for coreutils@gnu.org; Sun, 13 Aug 2017 04:30:25 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:49630)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dgoHu-0005iR-9t
	for coreutils@gnu.org; Sun, 13 Aug 2017 04:30:22 -0400
Received: from localhost.localdomain (unknown [73.93.152.175])
	(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 437D739D0;
	Sun, 13 Aug 2017 09:30:19 +0100 (IST)
Subject: Re: test: hidden files
To: Marton Kun-Szabo <marton.kun.szabo@gmail.com>, coreutils@gnu.org
References: <CANOzD6UHHtB2cSnvjdWa+dPSUAHbk6xmMhjgfwrSuXQ3K2HN-Q@mail.gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <016334a9-60d7-b8d1-54d7-4629d9004c6d@draigBrady.com>
Date: Sun, 13 Aug 2017 01:30:16 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CANOzD6UHHtB2cSnvjdWa+dPSUAHbk6xmMhjgfwrSuXQ3K2HN-Q@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]
	[fuzzy]
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, 13 Aug 2017 08:30:26 -0000

On 10/08/17 15:55, Marton Kun-Szabo wrote:
> Dear coreutils-dev,
>=20
> I'd like to add a new feature to "test" that checks whether a file exis=
ts
> and is hidden (the first character of the filename is a dot). I think t=
his
> is a useful and universal feature that is currently missing from "test"=
 and
> is not on the list of rejected features yet.
> The "-H' argument is currently unused, the main modification would look
> like this:
>=20
> src/test.c
>=20
> +    case 'H':           /* File is hidden? */
> +      unary_advance ();
> +      return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
> +              && (argv[pos - 1][0] =3D=3D '.'));
> +
>=20
> I would be happy to implement this feature along with all the necessary
> documentation (both in coreutils.texi and in the "--help" section) and
> submit a patch when everything is done.
>=20
> Questions:
>  1) Is this a useful feature? Or would it end up on the list of rejecte=
d
> features?
>  2) Any planned other use of the "H" argument in the future?
>  3) Any comments on the above implementation?

Did you know that .blah corresponding to hidden files
was a bug in the initial implementations of ls(1) :)
I.E. the code wanted to skip '.' and '..', so did the equivalent of
  if (filename[0] =3D=3D '.') continue;

Anyway...
I'm not sure about this since it's so easy to achieve in portable shell.
For example:

  startswith() { [ "${2#$1}" !=3D "$2" ]; }

  file=3D'.blah'

  startswith . "$file" && test -e "$file"

cheers,
P=C3=A1draig


From MAILER-DAEMON Sun Aug 13 14:59:22 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dgy6c-0007SG-FV
	for mharc-coreutils@gnu.org; Sun, 13 Aug 2017 14:59:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39291)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1dgy6a-0007Qe-5D
	for coreutils@gnu.org; Sun, 13 Aug 2017 14:59:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1dgy6Z-0002XC-Fr
	for coreutils@gnu.org; Sun, 13 Aug 2017 14:59:20 -0400
Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:34278)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <pengyu.ut@gmail.com>) id 1dgy6Z-0002TZ-B4
	for coreutils@gnu.org; Sun, 13 Aug 2017 14:59:19 -0400
Received: by mail-oi0-x229.google.com with SMTP id x3so68935056oia.1
	for <coreutils@gnu.org>; Sun, 13 Aug 2017 11:59:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=7lRFuE6T4S7MYpcjGlAcPjMxdmrYHilEUQ3VEpp91kM=;
	b=rxS0GkFD+/czi0vfvRvHNYFXF7UHGrZmvbE2lViUAC9o0XvIDRJHH+sqkl5R7I2n7S
	0vhmCR0vh2OaIzFxBtyEBYVDxufhEy7YzFr0vGApqhwfpmC5QrDlE25/G0ZzMfACbvGF
	qhUmAeTV8zqftrenBTqbNz2JJZGkfIyb7kHa2mzwdDa0kwugzCBa3IsToaCfZdlNWtLL
	e1F6mKiGVar3AFrO1ZPX9dcOHLnem5MDn6No/IvDL8SjMnYLwGDfWlsDBgjoN0hHC1HS
	99PlHs2dU6FDTbrCqezK6iZAtre7kRd8C9Jc16PAVR9ZDVTyZjgiAO4PLqoUtSqh2bEv
	vxLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=7lRFuE6T4S7MYpcjGlAcPjMxdmrYHilEUQ3VEpp91kM=;
	b=ZAxtLiVYgCAZuFDAQPmcTsKdCzciHcTT/raqsVly/di0FWw11P85kVkRYcjfDSQbGI
	NGOqPCfE5TDcZ+EE237p62Xsu8KMnyWXm/qEl82LIh9mrRyb9Tq8rCdOHvRgTtG1cMWC
	6r03PP4JmKbNpRFca5hbpRFB9jCkE3ELOeLZo+UT1DcdS+uBtB2rT+VVIGeyATENp09G
	3bS2PM1xtF3WdPl4UKfDFmUmEiiFRmfz/r2QencMLGUEgbNClPXgDwW8cyWOln1tpAeY
	3bsxns0Paz3nVqLERABvIGQNeRGoyCi0qgNqZOfbQsuV0ohcRs0SPjloSttK+8pPzA8C
	pY/g==
X-Gm-Message-State: AHYfb5iOdDM19Ywo4eSJkeTkHs9jzC5yHUw/nCk+4O9QP1kE2/WT7nSI
	v8ZGFsdno7SKkVpSxYLY1W63qiFHNHLmiws=
X-Received: by 10.202.79.11 with SMTP id d11mr26231494oib.201.1502650756631;
	Sun, 13 Aug 2017 11:59:16 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.182.52.229 with HTTP; Sun, 13 Aug 2017 11:59:16 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Date: Sun, 13 Aug 2017 13:59:16 -0500
Message-ID: <CABrM6wm0djOn8f4tiTRfvcrsfPQuaxQL+POGQBti+J+DHwT_xQ@mail.gmail.com>
Subject: How to sort alphabetically?
To: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c06::229
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, 13 Aug 2017 18:59:20 -0000

Hi, "B" is listed before "a". Is there a way to sort alphabetically
(as in an English dictionary)? (I think LC_* might need to be used,
but I am not sure what value it should be.) Thanks.

$ printf '%s\n' a B c | sort
B
a
c

-- 
Regards,
Peng


From MAILER-DAEMON Sun Aug 13 15:15:41 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dgyMP-00068j-42
	for mharc-coreutils@gnu.org; Sun, 13 Aug 2017 15:15:41 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42679)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dgyML-000683-I1
	for coreutils@gnu.org; Sun, 13 Aug 2017 15:15:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dgyMI-0004UA-9C
	for coreutils@gnu.org; Sun, 13 Aug 2017 15:15:37 -0400
Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]:36176)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dgyMI-0004MO-3f
	for coreutils@gnu.org; Sun, 13 Aug 2017 15:15:34 -0400
Received: by mail-io0-x234.google.com with SMTP id g35so33356244ioi.3
	for <coreutils@gnu.org>; Sun, 13 Aug 2017 12:15:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=jK+F+Rca9kDOklwszHIUv2A8ArqkV6dVJRUG6KGv3fo=;
	b=VFzcmd4+ULiW4qLtAxCmGqxfsxSfcyMf3T/ILPqbQJdkTyMamjYv3nr1LJn09DEynT
	NoDs6vw8SYGMoPK4wMcmUWUxq5No2f3a6zDXGjrojz9LkOWsPATCpj5iAQ1PqYIfIDzS
	TOYpPCsRi7xCAwjDiNW/w2c4qIjb7lLh43OLbWT5FaX0BdzElxX8aJie7QAc4TwwAapS
	lg5gKgp4QQQE48duvz8UOWoc/ACsR7su7TIiq6TWN6rKOfh+tPpxnp5RLaXnqOOWE/id
	SRZJa61GVELBmuG8/CZ8oHIgxQWom+vz2d+t3G8rgJA1UL+1H4/Zvo9g/f33He6h1MRJ
	q7GA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=jK+F+Rca9kDOklwszHIUv2A8ArqkV6dVJRUG6KGv3fo=;
	b=ANQCvBXGqDsOio+TLK73LSdLEVkc3GxONUNVYUTIp/YP+M4Xs0PlBNta5liFISToHU
	InL6NgpJDYQxR4I5wkGSDJE7WekGe/C+4QrcTdWr3ngqq2gbddCM98oXzAkd3yNqGyUt
	y8NMq9npEyY2h+MXngRZG9cQxKdtSbFc4GgOdQ5JZ9zgRvU08lHLYRHXwrfvbas3+2hE
	9a4LZEaHZxFMD4IDCZWo8oKo6i/O1v2SHeSpPcWtQxsANkS6TJnEHmilNLoiTj6jVoUt
	GfT/8vfcyNCj4WZoWK/UcYcPNLiriFgP7h3NJhI9wR3myIRZ1knROV3rPFFKhYwvpQau
	XhVg==
X-Gm-Message-State: AIVw113y4cNNfYZDr8uHKZrfVC6fOod0gMfYF+RGIbF6EDPHgDNNDCPz
	5oHK9AK0Jknl3Rwk0pE=
X-Received: by 10.107.145.2 with SMTP id t2mr17513667iod.160.1502651730709;
	Sun, 13 Aug 2017 12:15:30 -0700 (PDT)
Received: from [192.168.88.253] (S010664777daa62d3.cg.shawcable.net.
	[70.72.44.2])
	by smtp.gmail.com with ESMTPSA id d9sm2788678iod.71.2017.08.13.12.15.29
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 13 Aug 2017 12:15:30 -0700 (PDT)
Subject: Re: How to sort alphabetically?
To: Peng Yu <pengyu.ut@gmail.com>, Coreutils <coreutils@gnu.org>
References: <CABrM6wm0djOn8f4tiTRfvcrsfPQuaxQL+POGQBti+J+DHwT_xQ@mail.gmail.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <d4b941fe-d9f8-c661-3e47-e4022d8d7a40@gmail.com>
Date: Sun, 13 Aug 2017 13:15:20 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <CABrM6wm0djOn8f4tiTRfvcrsfPQuaxQL+POGQBti+J+DHwT_xQ@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001: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: Sun, 13 Aug 2017 19:15:39 -0000

Hello,

On 13/08/17 12:59 PM, Peng Yu wrote:
> Hi, "B" is listed before "a". Is there a way to sort alphabetically
> (as in an English dictionary)? (I think LC_* might need to be used,
> but I am not sure what value it should be.) Thanks.
> 
> $ printf '%s\n' a B c | sort
> B
> a
> c
> 

There are two issues at hand: locale and case-sensitivity.

You example appears to be in a C/POSIX locale
where characters are sorted by their ASCII value.
In this case, use "-f/--ignore-case" to ignore the upper/lower case:

  $ printf '%s\n' a B c | LC_ALL=C sort -f
  a
  B
  c

In many other locales, the ordering (often referred to as "collation")
already ignores upper/lower-case letters:

  $ printf '%s\n' a B c | LC_ALL=en_CA.UTF8 sort
  a
  B
  c

Setting LC_ALL affects all locale variables.
Use LC_COLLATE to change only the collation order
(however this is likely to cause confusion). Example:

  LC_NUMERIC=en_US.UTF-8 LC_COLLATE=C sort


If you are writing portable scripts and need consistent sorting
order output regardless of the system's locale, it is best
to set a specific locale (if you know it is available on the system),
or always use "LC_ALL=C" optionally with "sort -f".
Also see other sorting options such as -d/-b/-i which will affect ordering.

regards,
 - assaf




From MAILER-DAEMON Mon Aug 14 09:09:46 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dhF7q-0006P7-DB
	for mharc-coreutils@gnu.org; Mon, 14 Aug 2017 09:09:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39676)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <marton.kun.szabo@gmail.com>) id 1dh9hS-0000Ot-DW
	for coreutils@gnu.org; Mon, 14 Aug 2017 03:22:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <marton.kun.szabo@gmail.com>) id 1dh9hR-0008PV-5K
	for coreutils@gnu.org; Mon, 14 Aug 2017 03:22:10 -0400
Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]:35636)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <marton.kun.szabo@gmail.com>)
	id 1dh9hQ-0008Ot-Vm
	for coreutils@gnu.org; Mon, 14 Aug 2017 03:22:09 -0400
Received: by mail-io0-x22a.google.com with SMTP id m88so36008465iod.2
	for <coreutils@gnu.org>; Mon, 14 Aug 2017 00:22:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=At3Ugr7xK50F3KWDDKrcPM5S78NxZvjHGwgB8v6QZ64=;
	b=hk8TxthtW/EJOrC3BK2lf34EhI2EN3c4P2CXkeSY55Aurtirbnt3GBiKAVdWKkc/7h
	yM6X/OR5lcThtx1zwe8ZsD970yorTmMRzNLNEuVjZWbYKbmlsVKHU+zDdJpq0SjHYG+e
	QzMa+eXO605VzIYASFppkb8nRuFt5YGtY9GB0iMd7iy6ER4Q0UiYq6HF4LXwGQ1KJnuj
	/TBgj7ycwDkJ/jyzTyOe/R69vytWiWwYNmsg8j948Uwhn2i9MOFsYXYa/cZUOXqNs26C
	Y0r0x06wW/PrwpbgXI3dsmrg0rYepb4Gh0qMpC9ZlwJavR9qZsqNI8s1WcM+CtP+ooIr
	bpxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=At3Ugr7xK50F3KWDDKrcPM5S78NxZvjHGwgB8v6QZ64=;
	b=HkVfm3nVUL1SFzfZIJ1DqCSUAkDJNX6dbekmEW+mj1g9Rpiv7u1YhrniT88J/yRXjj
	Fvc/uRejwXGOONH2hgNnCwtbzduI8zRvWR8PRHsosv6bpUWawQltq915e70ULvQWQTnB
	EjjebmtguY8QzJKssPVY96jgrR+Tnfb0mYy8ygEphbqtlULrtSIrymX+lGa52RCy70rs
	+Pyp+jWecTaQquWdZT4q2MxSH86b+D8EMTZh4ggJv7hq5T0t8JSPzYBX4P+1W8r6/c8X
	ItrFa87cvGtYGGWCOuo8bqirdRqWGPTbLiyRAaLc+ujEDXzhUoslxVt64/ChCT5KNtLQ
	/Q0Q==
X-Gm-Message-State: AIVw110wgyVcT7RhxC6bG0A89TP2ityDZIhhOIHjNziLP5qqKOCfrV3/
	pF6J0sSdRu5x/jnuw+Q1SdoKmsOQoQ==
X-Received: by 10.107.11.78 with SMTP id v75mr17460778ioi.301.1502695325860;
	Mon, 14 Aug 2017 00:22:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.50.203.9 with HTTP; Mon, 14 Aug 2017 00:22:05 -0700 (PDT)
Received: by 10.50.203.9 with HTTP; Mon, 14 Aug 2017 00:22:05 -0700 (PDT)
In-Reply-To: <016334a9-60d7-b8d1-54d7-4629d9004c6d@draigBrady.com>
References: <CANOzD6UHHtB2cSnvjdWa+dPSUAHbk6xmMhjgfwrSuXQ3K2HN-Q@mail.gmail.com>
	<016334a9-60d7-b8d1-54d7-4629d9004c6d@draigBrady.com>
From: Marton Kun-Szabo <marton.kun.szabo@gmail.com>
Date: Mon, 14 Aug 2017 00:22:05 -0700
Message-ID: <CANOzD6Uh=28EFPPdrcKViEQmK0mM1ekzzL3Fh+EgM+ipbEs65Q@mail.gmail.com>
Subject: Re: test: hidden files
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::22a
X-Mailman-Approved-At: Mon, 14 Aug 2017 09:09:45 -0400
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: Mon, 14 Aug 2017 07:22:11 -0000

Ok, thanks, I won't bother then.
I didn't get the 'ls' example though; AFAIK 'ls -a' prints everything and
'ls' only prints those files whose name don't start with a dot.
I presume '.' and '..' are named deliberately, in order not to interfere
with programs that are supposed to recursively iterate through the
filesystem starting from a given directory level.

Thanks,
Marton


On Aug 13, 2017 01:30, "P=C3=A1draig Brady" <P@draigbrady.com> wrote:

On 10/08/17 15:55, Marton Kun-Szabo wrote:
> Dear coreutils-dev,
>
> I'd like to add a new feature to "test" that checks whether a file exists
> and is hidden (the first character of the filename is a dot). I think thi=
s
> is a useful and universal feature that is currently missing from "test"
and
> is not on the list of rejected features yet.
> The "-H' argument is currently unused, the main modification would look
> like this:
>
> src/test.c
>
> +    case 'H':           /* File is hidden? */
> +      unary_advance ();
> +      return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
> +              && (argv[pos - 1][0] =3D=3D '.'));
> +
>
> I would be happy to implement this feature along with all the necessary
> documentation (both in coreutils.texi and in the "--help" section) and
> submit a patch when everything is done.
>
> Questions:
>  1) Is this a useful feature? Or would it end up on the list of rejected
> features?
>  2) Any planned other use of the "H" argument in the future?
>  3) Any comments on the above implementation?

Did you know that .blah corresponding to hidden files
was a bug in the initial implementations of ls(1) :)
I.E. the code wanted to skip '.' and '..', so did the equivalent of
  if (filename[0] =3D=3D '.') continue;

Anyway...
I'm not sure about this since it's so easy to achieve in portable shell.
For example:

  startswith() { [ "${2#$1}" !=3D "$2" ]; }

  file=3D'.blah'

  startswith . "$file" && test -e "$file"

cheers,
P=C3=A1draig

From MAILER-DAEMON Wed Aug 16 03:52:51 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dht8F-00083X-DP
	for mharc-coreutils@gnu.org; Wed, 16 Aug 2017 03:52:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53035)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <skisela@redhat.com>) id 1dht8E-00083N-9C
	for coreutils@gnu.org; Wed, 16 Aug 2017 03:52:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <skisela@redhat.com>) id 1dht8B-0003mt-83
	for coreutils@gnu.org; Wed, 16 Aug 2017 03:52:50 -0400
Received: from mail-wr0-f182.google.com ([209.85.128.182]:33081)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <skisela@redhat.com>) id 1dht8B-0003jp-0h
	for coreutils@gnu.org; Wed, 16 Aug 2017 03:52:47 -0400
Received: by mail-wr0-f182.google.com with SMTP id b65so10070352wrd.0
	for <coreutils@gnu.org>; Wed, 16 Aug 2017 00:52:42 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=DZkgsd/SZNjt7Eio1tqL/7JCJ9iGFWdPjd6OlLvIvdw=;
	b=n93Gsw5RK4eAV684bvMpGHojnlbv6wDhdlX32ZFRWtOm/0oRv3zMKUoI7EgnrbChlu
	GCDPBuWwdaLsEtK6aNeMfQyIaS/6/uCPKMOTMc3aRzOnrpL97Elqv/TkNnNauFO+umbF
	bLl6oYESOz/B0bJ6VPOvCyA/umZxhLOwdEgmnHzamgViQGNkr5TzHUZ/2JdxIB3xPMw/
	ODLf+vBTRjDjQdDr7MCD3IY5UZxuVsDUyUNpMEC7MgobCqJmRJYRpxgV7Pyi6U2PkCLq
	lKcPV9c0+u/mbLyLAao8VurxXyIQOb0C5jS5CYk8prAC9L+ittt4QnBCTNYIlYtd5OZl
	vUPw==
X-Gm-Message-State: AHYfb5hztlZqNFB4hyrDjH2c/DDUv3HDEdlGUUPKCvbeT8f2k7Odd1jY
	TVUPqP39LaMXgq59fRsdYkzcwe95c/iprkA=
X-Received: by 10.223.161.131 with SMTP id u3mr548339wru.44.1502869960904;
	Wed, 16 Aug 2017 00:52:40 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.177.139 with HTTP; Wed, 16 Aug 2017 00:52:40 -0700 (PDT)
From: Sebastian Kisela <skisela@redhat.com>
Date: Wed, 16 Aug 2017 09:52:40 +0200
Message-ID: <CAKsWQOox6wYAhn-GQWkiBT+ytmND_xjh3a2zNkiT7EGvJw2Qsw@mail.gmail.com>
Subject: multibyte support (round 4)
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 209.85.128.182
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: Wed, 16 Aug 2017 07:52:51 -0000

Hi,

first of all, thanks for all the notes you made at the websites and the
work you did on the multibyte support for coreutils.

After trying the patch I see a nice progress in the multibyte support.
Obviously there is still much to do.

Is there a way we could split the work so that I could help you?

Thinking of implementing unfinished multibyte cut -d option might be a good
start maybe.

Thanks for replies!
Sebasti=C3=A1n

From MAILER-DAEMON Thu Aug 17 00:29:24 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1diCQu-0007nE-Av
	for mharc-coreutils@gnu.org; Thu, 17 Aug 2017 00:29:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55456)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1diCQs-0007mo-Dt
	for coreutils@gnu.org; Thu, 17 Aug 2017 00:29:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1diCQp-0003Iz-B9
	for coreutils@gnu.org; Thu, 17 Aug 2017 00:29:22 -0400
Received: from mail-io0-x22e.google.com ([2607:f8b0:4001:c06::22e]:34539)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1diCQp-0003In-5i
	for coreutils@gnu.org; Thu, 17 Aug 2017 00:29:19 -0400
Received: by mail-io0-x22e.google.com with SMTP id o9so19728877iod.1
	for <coreutils@gnu.org>; Wed, 16 Aug 2017 21:29:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=nL9ZRqCxMBNlPeCQpHiazqLQZcMMkyiNSai+0waGjSc=;
	b=L4qvGEYMpa2NKIL2TPhZiKv5bP1FjsnFOuJI+5oX2auwPavRepP8b81oeUxajp48os
	3GnGeB92tlm9c3QeNHIwefqQXNnxzbJBlAfD90ZxGdf2wvRfI8HK96ndAbmUaxeC6el2
	vTwG5KK2G6dUtQZ+yXvqcshVvzToMa3J1hty1QONTZNpdDnX6bdQRBRq7fCS7RuLqzcC
	1EQjBqxj95w1IiaEuhP1g9CIAtnNC5+wGWHklqxs9NQTWLhJwayHmyL/wpGqELvTU1cr
	4vpbjza4241uGIK3fe4qROLnRdvu3+ZXX8nyxMaYczHxhz1/OUKwopa+ZNtyu5KFMHdl
	LjlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=nL9ZRqCxMBNlPeCQpHiazqLQZcMMkyiNSai+0waGjSc=;
	b=EFBMwgl92iCu0mCQcnsXNNZPXgF9uElsrdylcerv+wt2viDEgmsG0owRShf5WRsXpN
	0YRW/TiE1/ZHj6uSkKxgFaqVIvS12hjdNGzZeQN/JrqhqvZHjYJcs1C95Z4DJ3JR2QBY
	kuxg4TVVvOEaXpjkP+msmDSeUSkpWR9lu0Lg093Bqdpz5XVM1b1kKT261Jwj7Bqot8fR
	e0ub2jzcBTTviZooF4jiPWigeJq7RyVvrPqmeXF1vcti1NR6uc3X4FJcSg8+zavPv1jR
	BnqGUoATA58iE7Pr2lvKC2/Z4C7/z4Hg1K6eAmofVwISt9SDxaE8fVEnBGNVJsc7gA9g
	S4WQ==
X-Gm-Message-State: AHYfb5hPUBJvyxBrXQ98BaAoPoi+m1tR3zSSMekolYjjHrppZvEg0dVn
	Sxp7TkVQLjFsY8g5C9k=
X-Received: by 10.107.132.77 with SMTP id g74mr3349903iod.88.1502944156799;
	Wed, 16 Aug 2017 21:29:16 -0700 (PDT)
Received: from [192.168.88.253] (S010620aa4bdc284c.cg.shawcable.net.
	[70.77.114.99]) by smtp.gmail.com with ESMTPSA id
	q192sm1257105itc.20.2017.08.16.21.29.15
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Wed, 16 Aug 2017 21:29:16 -0700 (PDT)
Subject: Re: multibyte support (round 4)
To: Sebastian Kisela <skisela@redhat.com>, coreutils@gnu.org
References: <CAKsWQOox6wYAhn-GQWkiBT+ytmND_xjh3a2zNkiT7EGvJw2Qsw@mail.gmail.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <c32138f7-c9e9-5ed5-a1f5-edadfc4f7ac2@gmail.com>
Date: Wed, 16 Aug 2017 22:29:02 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <CAKsWQOox6wYAhn-GQWkiBT+ytmND_xjh3a2zNkiT7EGvJw2Qsw@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::22e
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, 17 Aug 2017 04:29:23 -0000

Hello Sebastián,

On 16/08/17 01:52 AM, Sebastian Kisela wrote:
> Is there a way we could split the work so that I could help you?

Of course - any help would be fantastic.

> Thinking of implementing unfinished multibyte cut -d option might be a good
> start maybe.

Sounds very good.

Few thoughts on "cut -d":

1.
The 'delim' variable:

The current variable 'delim' is "unsigned char".
It likely should not be "wchar_t", as that type can't contain
all possible values on few OSes that use surrogate-paris
(such as cygwin).
Another possibility is using gnulib's 'ucs4_t', but that assumes
unicode, which we can't assume (the locale could be non-unicode).
Yet another option is a string (char*) - the most versatile but also the
least efficient.

Keeping the LC_ALL=C (unibyte locale) as efficient as possible is a
priority, perhaps it's worth having a second variable (e.g. "mb_delim")?

I'm raising this possibility because the current function 'cut_fields()'
uses gnulib's optimized function getndelim2() (which reads input until
one of two delimiters: the field delimiter and/or the line delimiter).
It "just works" for multibyte input with unibyte delimiter -
but won't work for multibyte delimiter.

If anyhow a new function is required (e.g. cut_fields_mb()),
perhaps it could just use a different delimiter variable.

Lastly, the recent multibyte support in expr(1)
uses gnulib's "mbuiter" module to iterate over multibyte strings.
If 'cut_fields_mb' is written a new, perhaps using that module
could handle multibyte delimiters with ease.



2.
Invalid multibyte sequences:
It is important that coreutils programs handle invalid multibyte
sequences without failing (usually passing the input as-is).

However, perhaps it is acceptable to reject invalid multibyte sequences
in the delimiter? that would make processing slightly simpler.

Something like:
    LC_ALL=C cut -d $'\x98 -f 2   # Valid in C locale
versus:
    $ LC_ALL=en_CA.UTF-8 cut -d $'\x98 -f 2
    cut: invalid delimiter character in the current locale



Everyone is very welcomed to chime in about these or other issues.

Please do post any updates or patches,
and I'll update the web page with any further progress.

regards,
 - assaf











From MAILER-DAEMON Thu Aug 17 15:05:13 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1diQ6S-0003cC-Tu
	for mharc-coreutils@gnu.org; Thu, 17 Aug 2017 15:05:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53187)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6Q-0003ZE-7Y
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6L-00016u-AK
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:10 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47768)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1diQ6L-00016J-4t
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:05 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 08AB2160892
	for <coreutils@gnu.org>; Thu, 17 Aug 2017 12:05:03 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id c6NNo0HpqslG; Thu, 17 Aug 2017 12:05:02 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 589AF160895;
	Thu, 17 Aug 2017 12:05:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 3uOhZVcMvTKW; Thu, 17 Aug 2017 12:05:02 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 3A9A616088D;
	Thu, 17 Aug 2017 12:05:02 -0700 (PDT)
From: Paul Eggert <eggert@cs.ucla.edu>
To: coreutils@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH 1/5] build: update gnulib submodule to latest
Date: Thu, 17 Aug 2017 12:04:52 -0700
Message-Id: <20170817190456.31108-1-eggert@cs.ucla.edu>
X-Mailer: git-send-email 2.13.5
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 17 Aug 2017 19:05:11 -0000

---
 gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index 0474f8e6a..daba2833b 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 0474f8e6a85621c276dfc47099b9863a47f96a0d
+Subproject commit daba2833be01f39982742b9bcdbbd1319be157aa
-- 
2.13.5



From MAILER-DAEMON Thu Aug 17 15:05:31 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1diQ6l-00041q-LH
	for mharc-coreutils@gnu.org; Thu, 17 Aug 2017 15:05:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53290)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6d-0003vw-AL
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6Y-0001Ib-Ac
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:23 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47834)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1diQ6Y-0001GG-1k
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:18 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2959816087C
	for <coreutils@gnu.org>; Thu, 17 Aug 2017 12:05:17 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id r9ozmQMiwSj3; Thu, 17 Aug 2017 12:05:15 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9B22216087A;
	Thu, 17 Aug 2017 12:05:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id T4Lnr7VcJ8lu; Thu, 17 Aug 2017 12:05:15 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 78BA3160870;
	Thu, 17 Aug 2017 12:05:15 -0700 (PDT)
From: Paul Eggert <eggert@cs.ucla.edu>
To: coreutils@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH 2/5] sort: file descriptor discipline
Date: Thu, 17 Aug 2017 12:04:53 -0700
Message-Id: <20170817190456.31108-2-eggert@cs.ucla.edu>
X-Mailer: git-send-email 2.13.5
In-Reply-To: <20170817190456.31108-1-eggert@cs.ucla.edu>
References: <20170817190456.31108-1-eggert@cs.ucla.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 17 Aug 2017 19:05:27 -0000

Use O_CLOEXEC when creating file descriptors, so that subsidiary
processes do not inherit file descriptors that they do not need.
This is helpful for =E2=80=98sort=E2=80=99, as it is a multithreaded prog=
ram that
forks and execs.
* bootstrap.conf (gnulib_modules): Add mkostemp, open, pipe2.
* src/sort.c (create_temp_file): Open temporary file with O_CLOEXEC.
(stream_open): Open the stream with O_CLOEXEC.
(pipe_fork): Create the pipe with O_CLOEXEC.
(check_output): Open the output file with O_CLOEXEC.
(main): Use xfopen/xfclose to handle --files0-from, so that
O_CLOEXEC is used properly.  This is simpler anyway.
* tests/misc/sort-files0-from.pl: Adjust to change in diagnostic
wording.
---
 bootstrap.conf                 |  3 +++
 src/sort.c                     | 27 +++++++++++----------------
 tests/misc/sort-files0-from.pl |  2 +-
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index f8f65f746..53c52f28e 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -171,6 +171,7 @@ gnulib_modules=3D"
   mkdir-p
   mkfifo
   mknod
+  mkostemp
   mkstemp
   mktime
   modechange
@@ -180,11 +181,13 @@ gnulib_modules=3D"
   non-recursive-gnulib-prefix-hack
   nproc
   obstack
+  open
   parse-datetime
   pathmax
   perl
   physmem
   pipe-posix
+  pipe2
   posix-shell
   posixtm
   posixver
diff --git a/src/sort.c b/src/sort.c
index ba6ceac27..47b915fcc 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -868,7 +868,7 @@ create_temp_file (int *pfd, bool survive_fd_exhaustio=
n)
=20
   /* Create the temporary file in a critical section, to avoid races.  *=
/
   cs =3D cs_enter ();
-  fd =3D mkstemp (file);
+  fd =3D mkostemp (file, O_CLOEXEC);
   if (0 <=3D fd)
     {
       *temptail =3D node;
@@ -951,7 +951,10 @@ stream_open (char const *file, char const *how)
           fp =3D stdin;
         }
       else
-        fp =3D fopen (file, how);
+        {
+          int fd =3D open (file, O_RDONLY | O_CLOEXEC);
+          fp =3D fd < 0 ? NULL : fdopen (fd, how);
+        }
       fadvise (fp, FADVISE_SEQUENTIAL);
     }
   else if (*how =3D=3D 'w')
@@ -1031,7 +1034,7 @@ pipe_fork (int pipefds[2], size_t tries)
   pid_t pid IF_LINT ( =3D -1);
   struct cs_status cs;
=20
-  if (pipe (pipefds) < 0)
+  if (pipe2 (pipefds, O_CLOEXEC) < 0)
     return -1;
=20
   /* At least NMERGE + 1 subprocesses are needed.  More could be created=
, but
@@ -3764,7 +3767,8 @@ check_output (char const *outfile)
 {
   if (outfile)
     {
-      int outfd =3D open (outfile, O_WRONLY | O_CREAT | O_BINARY, MODE_R=
W_UGO);
+      int oflags =3D O_WRONLY | O_BINARY | O_CLOEXEC | O_CREAT;
+      int outfd =3D open (outfile, oflags, MODE_RW_UGO);
       if (outfd < 0)
         sort_die (_("open failed"), outfile);
       move_fd_or_die (outfd, STDOUT_FILENO);
@@ -4578,8 +4582,6 @@ main (int argc, char **argv)
=20
   if (files_from)
     {
-      FILE *stream;
-
       /* When using --files0-from=3DF, you may not specify any files
          on the command-line.  */
       if (nfiles)
@@ -4590,21 +4592,14 @@ main (int argc, char **argv)
           usage (SORT_FAILURE);
         }
=20
-      if (STREQ (files_from, "-"))
-        stream =3D stdin;
-      else
-        {
-          stream =3D fopen (files_from, "r");
-          if (stream =3D=3D NULL)
-            die (SORT_FAILURE, errno, _("cannot open %s for reading"),
-                 quoteaf (files_from));
-        }
+      FILE *stream =3D xfopen (files_from, "r");
=20
       readtokens0_init (&tok);
=20
-      if (! readtokens0 (stream, &tok) || fclose (stream) !=3D 0)
+      if (! readtokens0 (stream, &tok))
         die (SORT_FAILURE, 0, _("cannot read file names from %s"),
              quoteaf (files_from));
+      xfclose (stream, files_from);
=20
       if (tok.n_tok)
         {
diff --git a/tests/misc/sort-files0-from.pl b/tests/misc/sort-files0-from=
.pl
index 366f59ff3..a7ec676aa 100755
--- a/tests/misc/sort-files0-from.pl
+++ b/tests/misc/sort-files0-from.pl
@@ -37,7 +37,7 @@ my @Tests =3D
=20
    # missing input file
    ['missing', '--files0-from=3Dmissing', {EXIT=3D>2},
-    {ERR =3D> "$prog: cannot open 'missing' for reading: "
+    {ERR =3D> "$prog: open failed: missing: "
      . "No such file or directory\n"}],
=20
    # input file name of '-'
--=20
2.13.5



From MAILER-DAEMON Thu Aug 17 15:05:39 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1diQ6t-0004GL-L2
	for mharc-coreutils@gnu.org; Thu, 17 Aug 2017 15:05:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53500)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6q-0004BV-1a
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6i-0001cg-JZ
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:35 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47892)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1diQ6i-0001bH-7E
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:28 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4911516088D
	for <coreutils@gnu.org>; Thu, 17 Aug 2017 12:05:27 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id wSGJHiAICIxz; Thu, 17 Aug 2017 12:05:25 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 48EF216088A;
	Thu, 17 Aug 2017 12:05:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 0kZ4G6UxjBWu; Thu, 17 Aug 2017 12:05:25 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 265DA160875;
	Thu, 17 Aug 2017 12:05:25 -0700 (PDT)
From: Paul Eggert <eggert@cs.ucla.edu>
To: coreutils@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH 3/5] sort: minor cleanups
Date: Thu, 17 Aug 2017 12:04:54 -0700
Message-Id: <20170817190456.31108-3-eggert@cs.ucla.edu>
X-Mailer: git-send-email 2.13.5
In-Reply-To: <20170817190456.31108-1-eggert@cs.ucla.edu>
References: <20170817190456.31108-1-eggert@cs.ucla.edu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 17 Aug 2017 19:05:38 -0000

* src/sort.c (move_fd): Rename from move_fd_or_die,
since it no longer can die.
---
 src/sort.c | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/sort.c b/src/sort.c
index 47b915fcc..f52b0d3f7 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -374,9 +374,9 @@ static bool debug;
    number are present, temp files will be used. */
 static unsigned int nmerge = NMERGE_DEFAULT;
 
-/* Output an error to stderr using async-signal-safe routines, and _exit().
+/* Output an error to stderr and exit using async-signal-safe routines.
    This can be used safely from signal handlers,
-   and between fork() and exec() of multithreaded processes.  */
+   and between fork and exec of multithreaded processes.  */
 
 static void async_safe_die (int, const char *) ATTRIBUTE_NORETURN;
 static void
@@ -386,7 +386,7 @@ async_safe_die (int errnum, const char *errstr)
 
   /* Even if defined HAVE_STRERROR_R, we can't use it,
      as it may return a translated string etc. and even if not
-     may malloc() which is unsafe.  We might improve this
+     may call malloc which is unsafe.  We might improve this
      by testing for sys_errlist and using that if available.
      For now just report the error number.  */
   if (errnum)
@@ -897,7 +897,7 @@ create_temp_file (int *pfd, bool survive_fd_exhaustion)
    descriptors STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO when
    opening an ordinary FILE.  Return NULL if unsuccessful.
 
-   fadvise() is used to specify an access pattern for input files.
+   Use fadvise to specify an access pattern for input files.
    There are a few hints we could possibly provide,
    and after careful testing it was decided that
    specifying FADVISE_SEQUENTIAL was not detrimental
@@ -920,7 +920,7 @@ create_temp_file (int *pfd, bool survive_fd_exhaustion)
    in a couple of cases:
      Merging
      Sorting with a smaller internal buffer
-   Note this option was seen to shorten the runtime for sort
+   This option was seen to shorten the runtime for sort
    on a multicore system with lots of RAM and other processes
    competing for CPU.  It could be argued that more explicit
    scheduling hints with 'nice' et. al. are more appropriate
@@ -1008,8 +1008,10 @@ xfclose (FILE *fp, char const *file)
     }
 }
 
+/* Move OLDFD to NEWFD.  If OLDFD != NEWFD, NEWFD is not close-on-exec.  */
+
 static void
-move_fd_or_die (int oldfd, int newfd)
+move_fd (int oldfd, int newfd)
 {
   if (oldfd != newfd)
     {
@@ -1020,7 +1022,7 @@ move_fd_or_die (int oldfd, int newfd)
 }
 
 /* Fork a child process for piping to and do common cleanup.  The
-   TRIES parameter tells us how many times to try to fork before
+   TRIES parameter specifies how many times to try to fork before
    giving up.  Return the PID of the child, or -1 (setting errno)
    on failure. */
 
@@ -1126,11 +1128,11 @@ maybe_create_temp (FILE **pfp, bool survive_fd_exhaustion)
         }
       else if (node->pid == 0)
         {
-          /* Being the child of a multithreaded program before exec(),
+          /* Being the child of a multithreaded program before exec,
              we're restricted to calling async-signal-safe routines here.  */
           close (pipefds[1]);
-          move_fd_or_die (tempfd, STDOUT_FILENO);
-          move_fd_or_die (pipefds[0], STDIN_FILENO);
+          move_fd (tempfd, STDOUT_FILENO);
+          move_fd (pipefds[0], STDIN_FILENO);
 
           execlp (compress_program, compress_program, (char *) NULL);
 
@@ -1186,11 +1188,11 @@ open_temp (struct tempnode *temp)
       break;
 
     case 0:
-      /* Being the child of a multithreaded program before exec(),
+      /* Being the child of a multithreaded program before exec,
          we're restricted to calling async-signal-safe routines here.  */
       close (pipefds[0]);
-      move_fd_or_die (tempfd, STDIN_FILENO);
-      move_fd_or_die (pipefds[1], STDOUT_FILENO);
+      move_fd (tempfd, STDIN_FILENO);
+      move_fd (pipefds[1], STDOUT_FILENO);
 
       execlp (compress_program, compress_program, "-d", (char *) NULL);
 
@@ -1802,7 +1804,7 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file)
             {
               /* Delimit the line with NUL. This eliminates the need to
                  temporarily replace the last byte with NUL when calling
-                 xmemcoll(), which increases performance.  */
+                 xmemcoll, which increases performance.  */
               *p = '\0';
               ptr = p + 1;
               line--;
@@ -2491,7 +2493,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only)
     }
 
   /* Warn about ignored global options flagged above.
-     Note if gkey is the only one in the list, all flags are cleared.  */
+     This clears all flags if UGKEY is the only one in the list.  */
   if (!default_key_compare (&ugkey)
       || (ugkey.reverse && (stable || unique) && keylist))
     {
@@ -2745,7 +2747,7 @@ compare (struct line const *a, struct line const *b)
     diff = 1;
   else if (hard_LC_COLLATE)
     {
-      /* Note xmemcoll0 is a performance enhancement as
+      /* xmemcoll0 is a performance enhancement as
          it will not unconditionally write '\0' after the
          passed in buffers, which was seen to give around
          a 3% increase in performance for short lines.  */
@@ -3739,8 +3741,8 @@ avoid_trashing_input (struct sortfile *files, size_t ntemps,
 /* Scan the input files to ensure all are accessible.
    Otherwise exit with a diagnostic.
 
-   Note this will catch common issues with permissions etc.
-   but will fail to notice issues where you can open() but not read(),
+   This will catch common issues with permissions etc.
+   but will fail to notice issues where you can open but not read,
    like when a directory is specified on some systems.
    Catching these obscure cases could slow down performance in
    common cases.  */
@@ -3771,7 +3773,7 @@ check_output (char const *outfile)
       int outfd = open (outfile, oflags, MODE_RW_UGO);
       if (outfd < 0)
         sort_die (_("open failed"), outfile);
-      move_fd_or_die (outfd, STDOUT_FILENO);
+      move_fd (outfd, STDOUT_FILENO);
     }
 }
 
-- 
2.13.5



From MAILER-DAEMON Thu Aug 17 15:05:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1diQ6t-0004GW-QD
	for mharc-coreutils@gnu.org; Thu, 17 Aug 2017 15:05:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53509)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6q-0004C0-KK
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6p-0001n6-5P
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:36 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47928)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1diQ6o-0001kj-My
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:35 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id C5DD0160891
	for <coreutils@gnu.org>; Thu, 17 Aug 2017 12:05:33 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id rbiIYBNbO1gW; Thu, 17 Aug 2017 12:05:32 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id E65B4160892;
	Thu, 17 Aug 2017 12:05:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id RyXkWtOIvyuA; Thu, 17 Aug 2017 12:05:32 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C4D2A16088A;
	Thu, 17 Aug 2017 12:05:32 -0700 (PDT)
From: Paul Eggert <eggert@cs.ucla.edu>
To: coreutils@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH 4/5] sort: use pthread_sigmask, not sigprocmask
Date: Thu, 17 Aug 2017 12:04:55 -0700
Message-Id: <20170817190456.31108-4-eggert@cs.ucla.edu>
X-Mailer: git-send-email 2.13.5
In-Reply-To: <20170817190456.31108-1-eggert@cs.ucla.edu>
References: <20170817190456.31108-1-eggert@cs.ucla.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 17 Aug 2017 19:05:38 -0000

POSIX says sigprocmask has unspecified behavior in a multithreaded
program like =E2=80=98sort=E2=80=99.
* src/sort.c (pthread_sigmask) [GNULIB_defined_pthread_functions]:
New macro, for use when =E2=80=98sort=E2=80=99 is not multithreaded.
(cs_enter, cs_leave): Use it.  Pass address, not value, as
this is typically a tad faster.  All callers changed.
---
 src/sort.c | 37 +++++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/sort.c b/src/sort.c
index f52b0d3f7..ccdd2309e 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -83,6 +83,11 @@ struct rlimit { size_t rlim_cur; };
 # endif
 #endif
=20
+#if GNULIB_defined_pthread_functions
+# undef pthread_sigmask
+# define pthread_sigmask(how, set, oset) sigprocmask (how, set, oset)
+#endif
+
 #if !defined OPEN_MAX && defined NR_OPEN
 # define OPEN_MAX NR_OPEN
 #endif
@@ -638,22 +643,21 @@ struct cs_status
 };
=20
 /* Enter a critical section.  */
-static struct cs_status
-cs_enter (void)
+static void
+cs_enter (struct cs_status *status)
 {
-  struct cs_status status;
-  status.valid =3D (sigprocmask (SIG_BLOCK, &caught_signals, &status.sig=
s) =3D=3D 0);
-  return status;
+  int ret =3D pthread_sigmask (SIG_BLOCK, &caught_signals, &status->sigs=
);
+  status->valid =3D ret =3D=3D 0;
 }
=20
 /* Leave a critical section.  */
 static void
-cs_leave (struct cs_status status)
+cs_leave (struct cs_status const *status)
 {
-  if (status.valid)
+  if (status->valid)
     {
       /* Ignore failure when restoring the signal mask. */
-      sigprocmask (SIG_SETMASK, &status.sigs, NULL);
+      pthread_sigmask (SIG_SETMASK, &status->sigs, NULL);
     }
 }
=20
@@ -832,9 +836,10 @@ exit_cleanup (void)
     {
       /* Clean up any remaining temporary files in a critical section so
          that a signal handler does not try to clean them too.  */
-      struct cs_status cs =3D cs_enter ();
+      struct cs_status cs;
+      cs_enter (&cs);
       cleanup ();
-      cs_leave (cs);
+      cs_leave (&cs);
     }
=20
   close_stdout ();
@@ -867,7 +872,7 @@ create_temp_file (int *pfd, bool survive_fd_exhaustio=
n)
     temp_dir_index =3D 0;
=20
   /* Create the temporary file in a critical section, to avoid races.  *=
/
-  cs =3D cs_enter ();
+  cs_enter (&cs);
   fd =3D mkostemp (file, O_CLOEXEC);
   if (0 <=3D fd)
     {
@@ -875,7 +880,7 @@ create_temp_file (int *pfd, bool survive_fd_exhaustio=
n)
       temptail =3D &node->next;
     }
   saved_errno =3D errno;
-  cs_leave (cs);
+  cs_leave (&cs);
   errno =3D saved_errno;
=20
   if (fd < 0)
@@ -1053,7 +1058,7 @@ pipe_fork (int pipefds[2], size_t tries)
     {
       /* This is so the child process won't delete our temp files
          if it receives a signal before exec-ing.  */
-      cs =3D cs_enter ();
+      cs_enter (&cs);
       saved_temphead =3D temphead;
       temphead =3D NULL;
=20
@@ -1062,7 +1067,7 @@ pipe_fork (int pipefds[2], size_t tries)
       if (pid)
         temphead =3D saved_temphead;
=20
-      cs_leave (cs);
+      cs_leave (&cs);
       errno =3D saved_errno;
=20
       if (0 <=3D pid || errno !=3D EAGAIN)
@@ -1247,11 +1252,11 @@ zaptemp (char const *name)
=20
   /* Unlink the temporary file in a critical section to avoid races.  */
   next =3D node->next;
-  cs =3D cs_enter ();
+  cs_enter (&cs);
   unlink_status =3D unlink (name);
   unlink_errno =3D errno;
   *pnode =3D next;
-  cs_leave (cs);
+  cs_leave (&cs);
=20
   if (unlink_status !=3D 0)
     error (0, unlink_errno, _("warning: cannot remove: %s"), quotef (nam=
e));
--=20
2.13.5



From MAILER-DAEMON Thu Aug 17 15:05:43 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1diQ6x-0004QW-2Z
	for mharc-coreutils@gnu.org; Thu, 17 Aug 2017 15:05:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53584)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6u-0004KF-LV
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1diQ6t-0001to-MY
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:40 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47970)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1diQ6t-0001s0-3r
	for coreutils@gnu.org; Thu, 17 Aug 2017 15:05:39 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 39ADD16088A
	for <coreutils@gnu.org>; Thu, 17 Aug 2017 12:05:38 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id KTzKaTRVVaBR; Thu, 17 Aug 2017 12:05:37 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 85DCC160891;
	Thu, 17 Aug 2017 12:05:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id qXTjA46Cc-If; Thu, 17 Aug 2017 12:05:37 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 66ED116088D;
	Thu, 17 Aug 2017 12:05:37 -0700 (PDT)
From: Paul Eggert <eggert@cs.ucla.edu>
To: coreutils@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH 5/5] nohup: simplify by using fcntl
Date: Thu, 17 Aug 2017 12:04:56 -0700
Message-Id: <20170817190456.31108-5-eggert@cs.ucla.edu>
X-Mailer: git-send-email 2.13.5
In-Reply-To: <20170817190456.31108-1-eggert@cs.ucla.edu>
References: <20170817190456.31108-1-eggert@cs.ucla.edu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 17 Aug 2017 19:05:41 -0000

* src/nohup.c: Do not include cloexec.h.
(main): Use fcntl rather than dup + set_cloexec_flag.
---
 src/nohup.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/nohup.c b/src/nohup.c
index 1641dc784..53ec17f96 100644
--- a/src/nohup.c
+++ b/src/nohup.c
@@ -24,7 +24,6 @@
 
 #include "system.h"
 
-#include "cloexec.h"
 #include "error.h"
 #include "filenamecat.h"
 #include "fd-reopen.h"
@@ -182,12 +181,8 @@ main (int argc, char **argv)
          if execve fails.  It's no big deal if this dup fails.  It might
          not change anything, and at worst, it'll lead to suppression of
          the post-failed-execve diagnostic.  */
-      saved_stderr_fd = dup (STDERR_FILENO);
-
-      if (0 <= saved_stderr_fd
-          && set_cloexec_flag (saved_stderr_fd, true) != 0)
-        error (exit_internal_failure, errno,
-               _("failed to set the copy of stderr to close on exec"));
+      saved_stderr_fd = fcntl (STDERR_FILENO, F_DUPFD_CLOEXEC,
+                               STDERR_FILENO + 1);
 
       if (!redirecting_stdout)
         error (0, 0,
-- 
2.13.5



From MAILER-DAEMON Sat Aug 19 10:00:27 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dj4Id-0006JI-Lc
	for mharc-coreutils@gnu.org; Sat, 19 Aug 2017 10:00:27 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52661)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ciro.santilli@gmail.com>) id 1dj0Vm-00047u-4N
	for coreutils@gnu.org; Sat, 19 Aug 2017 05:57:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ciro.santilli@gmail.com>) id 1dj0Vl-0006X0-D5
	for coreutils@gnu.org; Sat, 19 Aug 2017 05:57:46 -0400
Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]:37272)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <ciro.santilli@gmail.com>)
	id 1dj0Vl-0006Wq-8W
	for coreutils@gnu.org; Sat, 19 Aug 2017 05:57:45 -0400
Received: by mail-it0-x229.google.com with SMTP id 76so15929110ith.0
	for <coreutils@gnu.org>; Sat, 19 Aug 2017 02:57:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=cnwyOqszxB3tf97tPtecmdVAykz41IasatDOk3RHPsY=;
	b=ZtwrNwy4GLPLfZLklNGtTAobSTDOwnNnoM/DluvTti7kBQlYjncm6yMeUwCAvJ8OvQ
	6dpYkrkgpnXZh0tBKd8Wt6qzFGCmpGp9y5Cn5uxsEYJltxklSqkL/qcQWl6gAKSyET//
	tcGjeKiQZ8q2Rv6WEKIRHFubXaj6qlVO9W8QERvuAaGyMZ/ARGjRQjTRjO4khqYq3WAK
	FiWUSGypFavuoC62NVl9CVSObuiy8LOxUxQnkMgsP5SjhAFS3o3THGvkMqrnS/bzSBRp
	ihJgcy2+khfTH/5dMZU9H/y++i5E513xArlj4rXMVIE8qDQ+IZ1NT/Uk5bDRz/2mEOdm
	x8fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=cnwyOqszxB3tf97tPtecmdVAykz41IasatDOk3RHPsY=;
	b=KfmPFpwbWtWSJeAmCFKVnMCEhQwnsVjaYQ9WSDqakwbHjiW/gl/sstVGYyZ3qU7Unj
	IuEecwXmoeUr7uFd4ugG3eIaif28LKfdTGX/gyjw2fUZfzJs8z2Oz4tBpAbZIyX9qdIC
	s2nkQRHxCAYulA7absiIBRKXxMBeQPaHRJxy0Uef/VM1VEld2o6bSip6ElLekdKicC9D
	4Cp3krZVW/NtkCcMxMwgMMtdd7qwYVdFuMHS8X5rpvSOinKEWYLVNZm3FOBx+/JZvHWe
	Fxx22wNCp/vTmRILsvEhJ6m0HbGgbyq2GBwhJlB5rOQssLz0rIR7t7ePFuFg4T+yZWgh
	56ow==
X-Gm-Message-State: AHYfb5hWXZmRqRftt4ckOVqe/cpdjONDe9DBUZiHxqG3kr4Qhgj+EYA2
	Y7xslx9HQPBkxLkmz6DYRe9VYfxRgGwY
X-Received: by 10.36.194.197 with SMTP id i188mr710651itg.122.1503136662925;
	Sat, 19 Aug 2017 02:57:42 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.162.217 with HTTP; Sat, 19 Aug 2017 02:57:22 -0700 (PDT)
From: Ciro Santilli <ciro.santilli@gmail.com>
Date: Sat, 19 Aug 2017 10:57:22 +0100
Message-ID: <CAFXrp_dBgSo9UeXAOyZAmJ6AFs8C8whFjZGEbwGJRuBrQkSB8A@mail.gmail.com>
Subject: sort by hex numeric value
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::229
X-Mailman-Approved-At: Sat, 19 Aug 2017 10:00:26 -0400
Content-Type: text/plain; charset="UTF-8"
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: Sat, 19 Aug 2017 09:57:47 -0000

Is it possible to sort by hex values, with or without the 0x prefix? If
not, feature request!

8.25 behavior:

$ printf '0a\n1\n' | sort -n
0a
1
$ printf '0x0a\n0x1\n' | sort -n

0x0a
0x1
$ printf '09\n1\n' | sort -n
1
09

Not sure what is the best approach about backwards compatibility. Maybe
allow a base number after -n e.g.:

sort -n16

or add a new option:

sort -H

https://unix.stackexchange.com/questions/139801/sort-by-hex-value

From MAILER-DAEMON Sat Aug 19 10:26:33 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dj4ht-0000KL-3w
	for mharc-coreutils@gnu.org; Sat, 19 Aug 2017 10:26:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54432)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dj4hq-0000JI-IK
	for coreutils@gnu.org; Sat, 19 Aug 2017 10:26:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dj4hl-0000qI-Je
	for coreutils@gnu.org; Sat, 19 Aug 2017 10:26:30 -0400
Received: from mail-it0-x230.google.com ([2607:f8b0:4001:c0b::230]:36322)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dj4hl-0000oj-EF
	for coreutils@gnu.org; Sat, 19 Aug 2017 10:26:25 -0400
Received: by mail-it0-x230.google.com with SMTP id 77so17536967itj.1
	for <coreutils@gnu.org>; Sat, 19 Aug 2017 07:26:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=nXgXydrDd92TLvcgG63htAB/V1Jlf9Udai1eXkneADE=;
	b=mkELtk4Lah9L8QZhlvqTwOpA1oC6kUBQxg3XaiLSW8SMXlHB6pHy6sZ5zwIBYlEev2
	aprhN9x7JP6kARvJrvLpm0yLzgI5TqJx4JyBhKrvBaEDOaHE+j4oj/0PCmPhZMPUllLy
	esBNOJ/IBpqnajHgPC/pryt5rddFaPFYs9sVcYuugGXlffE+kqnAvUJlJkYSAgLCcJHG
	7FIVjvUGCPIZbJU/98x+5H9B+3cfyKVhIyUmrRGj5EfsK03GgoWsksRnejLc8wWODr3w
	948OWzfhc3diaVD+AWnaW4cfnP6uwTI3jMvcIWMPWYGSY0zhsn+cOlOvJIP1YDbsawi3
	hojg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=nXgXydrDd92TLvcgG63htAB/V1Jlf9Udai1eXkneADE=;
	b=CbimvMEjRROjGtrZA0zNtAOajoT/iC676sdjC8H5wE9Vv+EOHLpr0d0CkyPP7J/yc6
	zq1+Zjrlgxyo/vGje8dYdYAt5IJZVt2RgAV8OL0lOVRMRx3uES6lETujz9e+3jU0fzhR
	bRdT/NFc+sYMrDtcdV1rSPQdq5eM4kQYP6kqEtRnkMkkVxrfozUEGOOWQ5Cd2DI6ftBB
	2mo3+MNaQc13HKHOs6gJjA8Z4ItS6MApoP4lcJnpZtgCucvmO2fcodYU+pZpSj5n45FP
	3BCpkoWDrPXEMJnsdSywILtgMy6o8MraaHjZKhrtG36VbWk0lchLZwXcfzSie/zDBqQn
	Du+w==
X-Gm-Message-State: AHYfb5g2yrZHg6rDio1iSEqkvspYgxzU7kKlFwds/YT5S2VCWZEBw9vm
	lkSZ05XcLx/mSI/W3EM6ZA==
X-Received: by 10.36.103.203 with SMTP id u194mr1371704itc.27.1503152784449;
	Sat, 19 Aug 2017 07:26:24 -0700 (PDT)
Received: from [192.168.88.239] ([184.68.105.38])
	by smtp.gmail.com with ESMTPSA id
	z12sm3743190ioe.83.2017.08.19.07.26.23
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sat, 19 Aug 2017 07:26:23 -0700 (PDT)
Subject: Re: sort by hex numeric value
To: Ciro Santilli <ciro.santilli@gmail.com>, coreutils@gnu.org
References: <CAFXrp_dBgSo9UeXAOyZAmJ6AFs8C8whFjZGEbwGJRuBrQkSB8A@mail.gmail.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <71ce3be2-fa3b-bb7a-0fa9-0f348f2fca90@gmail.com>
Date: Sat, 19 Aug 2017 08:26:31 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <CAFXrp_dBgSo9UeXAOyZAmJ6AFs8C8whFjZGEbwGJRuBrQkSB8A@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::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, 19 Aug 2017 14:26:31 -0000

Hello,

On 19/08/17 03:57 AM, Ciro Santilli wrote:
> Is it possible to sort by hex values, with or without the 0x prefix? If
> not, feature request!

Not currently possible with 'sort' alone, but easily done
if combined with awk:

> $ printf '0x0a\n0x1\n' | sort -n
> 

    $ printf '0a\n1\n' \
         | gawk '{ print $0, strtonum("0x" $1) }' \
         | sort -k2,2n | gawk '{NF--;print $0}'
    1
    0a

Note 'strtonum' is GNU gawk (gawk) function, not a standard awk
function (e.g. the default on Debian systems is mawk, gawk needs
to be installed specifically).

This pattern is referred to as "decorate-sort-undecorate".
"decorate" here means "add a column by converting the input
to something sort does recognize" and undecorate
means "remove the column after sorting".

See other similar past requests:
Sort with file extension:
 https://lists.gnu.org/archive/html/bug-coreutils/2017-05/msg00003.html

Sort by IP address:
 https://lists.gnu.org/archive/html/bug-coreutils/2015-06/msg00076.html
(this post also discusses the possibility of extending 'sort' to support
generic decoration internally.

Sort by line length:
 https://lists.gnu.org/archive/html/bug-coreutils/2009-07/msg00107.html


> Not sure what is the best approach about backwards compatibility.
> Maybe allow a base number after -n e.g.:
>  sort -n16
> or add a new option:
>  sort -H

As there are many different needs and requests to some by different
things, the approach will likely be similar to the one
discussed in the 'sort by IP address', above.
(that is, if sort(1) is to be modified at all).


regards,
 - assaf




From MAILER-DAEMON Sat Aug 19 23:56:20 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1djHLY-0005Nb-Ey
	for mharc-coreutils@gnu.org; Sat, 19 Aug 2017 23:56:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45391)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1djHLV-0005Me-MH
	for coreutils@gnu.org; Sat, 19 Aug 2017 23:56:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1djHLR-0006Ll-RD
	for coreutils@gnu.org; Sat, 19 Aug 2017 23:56:17 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:32866)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1djHLR-0006LK-L5
	for coreutils@gnu.org; Sat, 19 Aug 2017 23:56:13 -0400
Received: from localhost.localdomain (unknown [73.93.155.95])
	(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 D906C4A83
	for <coreutils@gnu.org>; Sun, 20 Aug 2017 04:56:08 +0100 (IST)
To: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Subject: notes on parallel processing with split etc.
Message-ID: <2152fc40-b149-a8e3-13bd-5f6a64826cb3@draigBrady.com>
Date: Sat, 19 Aug 2017 20:56:01 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
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]
	[fuzzy]
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, 20 Aug 2017 03:56:18 -0000

I did a comparision of wc -l and turbo-linecount
with various multi-processing methods
http://www.pixelbeat.org/docs/unix-parallel-tools.html

cheers
P=C3=A1draig


From MAILER-DAEMON Mon Aug 21 07:28:49 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1djksz-0004R5-S4
	for mharc-coreutils@gnu.org; Mon, 21 Aug 2017 07:28:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43027)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1djksv-0004PJ-7U
	for coreutils@gnu.org; Mon, 21 Aug 2017 07:28:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1djksr-0006vn-Pb
	for coreutils@gnu.org; Mon, 21 Aug 2017 07:28:45 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:43184)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1djksr-0006v8-AX
	for coreutils@gnu.org; Mon, 21 Aug 2017 07:28:41 -0400
Received: from localhost.localdomain (unknown [73.93.152.127])
	(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 1F76C4B1C;
	Mon, 21 Aug 2017 12:28:37 +0100 (IST)
Subject: Re: Feature request: ls --hyperlink
To: Egmont Koblinger <egmont@gmail.com>, coreutils@gnu.org
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
Date: Mon, 21 Aug 2017 04:28:35 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------4CCB215C6C4D2D1D25F2AA09"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 21 Aug 2017 11:28:48 -0000

This is a multi-part message in MIME format.
--------------4CCB215C6C4D2D1D25F2AA09
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 05/05/17 14:05, P=C3=A1draig Brady wrote:
> On 04/05/17 13:14, Egmont Koblinger wrote:
>> Hi,
>>
>> Recently two popular terminal emulators, GNOME Terminal and iTerm2
>> have implemented a brand new feature: explicit hyperlinks.
>>
>> Unlike the existing functionality of most terminal emulators of
>> automatically detecting URLs that appear on the screen, this time it's
>> like hyperlinks on web pages: the link target is specified by the OSC
>> 8 escape sequence and the visible text can be an arbitrary piece of
>> text.
>>
>> As I've played with this feature, I found a really compelling use
>> case: listing files in a way that all of them are hyperlinks to
>> "file://...". It makes it as easy and convenient as a Ctrl+click to
>> open them in their preferred graphical application.
>>
>> (For even more fun, there's a pending demo patch to GNOME Terminal to
>> display a preview of certain local files on mouseover. We're uncertain
>> yet if we'll finalize and ship it or not.)
>>
>> I've created a quick proof of concept patch for a new cmdline option
>> "ls --hyperlink=3Dalways/auto/never", have set it up in my "ls" alias,
>> and been using that happily for a few weeks now. Please find it at
>> https://bugzilla.gnome.org/show_bug.cgi?id=3D779734#c126. Note that it
>> contains a couple of issues, e.g. I forgot to free some data, and it
>> does stupid things around symlinks. As said, it's a demo, not a fully
>> polished patch.
>>
>> I'd be curious to hear if you like this idea, and would be happy to
>> see this option appearing in mainstream coreutils.
>>
>> Please see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3=
cb5feda
>> for details about the feature.
>>
>> Let me know if you have any questions, concerns etc. (cc me, I'm not
>> subscribed).
>=20
> Interesting.
> This could apply to any util really that displays file names,
> though ls would be the most useful.
> Generally it also seems useful to the case where a file has a non repre=
sentable name
> (well not cleanly at least without $'shell quoting').

I've attached an implementation for ls --hyperlink.

Some notes:

I used canonicalize_filename_mode for consistency with other tools,
and to relax the canonicalization with CAN_MISSING.
I did this because access may be possible outside current shell context,
and also we don't want to diagnose perm issues that would
either not otherwise need diagnosing, or would be diagnosed
independently by stat() etc.

--dired is handled appropriately, since the terminal codes
are similar to non displayed color codes and can be skipped similarly.

I used more stringent escaping as per rfc3986
because I think there are security issues with the more lax
encoding described at https://gist.github.com/egmontkob/eb114294efbcd5adb=
1944c9f3cb5feda
and I don't see any advantage of using that more lax encoding.
If terminals provided a copy link functionality, or
the links otherwise got outside the terminal context
then there could be problematic handling of non encoded items.
For example if you didn't encode '?' and the link was passed
to a browser, then anything after that would be ignored.
Also '%' needs to be encoded for the same reasons where
files other than intended could be resolved.

This should work on windows where c: is separated from the
hostname appropriately and '\' are converted to '/',
though I haven't tested there.

I've tested with valgrind with multiple specified dirs
and there are no leaks.

I was tempted to add --hyperlink to realpath, though I'm not sure it's ne=
eded.

I was tempted to add a --hyperlink=3Draw option to output just the file:/=
/...
portion without the terminal codes, as older terminals highlight/process
those fine and they might be otherwise usefule.  Though again I wasn't su=
re.

cheers,
P=C3=A1draig.

--------------4CCB215C6C4D2D1D25F2AA09
Content-Type: text/x-patch;
 name="ls--hyperlink.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="ls--hyperlink.patch"

=46rom 47a727efdaf58a3e439d394bd047de5771d8e518 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D <P@draigBrady.com>
Date: Mon, 21 Aug 2017 03:53:36 -0700
Subject: [PATCH] ls: support --hyperlink to output file:// URIs

Terminals such as iTerm2 and VTE based terminals
(as of version 0.49.1), support hyperlinks when
passed terminals codes as described at:
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

* src/ls.c (gobble_file): Allocate an absolute file name to output.
(quote_name): Output the absolute name with the appropriate codes.
(file_escape): A new function to encode file names as per rfc8089.
(main): Handle the new option and call the file_escape_init() helper.
(print_dir): Get the absolute file name here too, so that the
directory name can be linkified.
* NEWS: Mention the new feature.
* tests/ls/hyperlink.sh: Add a new test.
* tests/local.mk: Reference the new test.
* doc/coreutils.texi (ls invocation): Describe --hyperlink.
---
 NEWS                  |   3 +
 doc/coreutils.texi    |  26 ++++++++-
 src/ls.c              | 148 +++++++++++++++++++++++++++++++++++++++++++-=
------
 tests/local.mk        |   1 +
 tests/ls/hyperlink.sh |  60 ++++++++++++++++++++
 5 files changed, 216 insertions(+), 22 deletions(-)
 create mode 100755 tests/ls/hyperlink.sh

diff --git a/NEWS b/NEWS
index 6b6cafd..c796fb5 100644
--- a/NEWS
+++ b/NEWS
@@ -77,6 +77,9 @@ GNU coreutils NEWS                                    -=
*- outline -*-
   by prefixing the last specified number like --tabs=3D1,+8 which is
   useful for visualizing diff output for example.
=20
+  ls supports a new --hyperlink[=3Dwhen] option to output file://
+  format links to files, supported by some terminals.
+
   split supports a new --hex-suffixes[=3Dfrom] option to create files wi=
th
   lower case hexadecimal suffixes, similar to the --numeric-suffixes opt=
ion.
=20
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8f1cb4c..173f064 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7857,9 +7857,8 @@ may be omitted, or one of:
 @end itemize
 Specifying @option{--color} and no @var{when} is equivalent to
 @option{--color=3Dalways}.
-Piping a colorized listing through a pager like @command{more} or
-@command{less} usually produces unreadable results.  However, using
-@code{more -f} does seem to work.
+If piping a colorized listing through a pager like @command{less},
+use the @option{-R} option to pass the color codes to the terminal.
=20
 @vindex LS_COLORS
 @vindex SHELL @r{environment variable, and color}
@@ -7905,6 +7904,27 @@ command line unless the @option{--dereference-comm=
and-line} (@option{-H}),
 Append a character to each file name indicating the file type.  This is
 like @option{-F}, except that executables are not marked.
=20
+@item --hyperlink [=3D@var{when}]
+@opindex --hyperlink
+@cindex hyperlink, linking to files
+Output codes recognized by some terminals to link
+to files using the @samp{file://} URI format.
+@var{when} may be omitted, or one of:
+@itemize @bullet
+@item none
+@vindex none @r{hyperlink option}
+- Do not use hyperlinks at all.  This is the default.
+@item auto
+@vindex auto @r{hyperlink option}
+@cindex terminal, using hyperlink iff
+- Only use hyperlinks if standard output is a terminal.
+@item always
+@vindex always @r{hyperlink option}
+- Always use hyperlinks.
+@end itemize
+Specifying @option{--hyperlink} and no @var{when} is equivalent to
+@option{--hyperlink=3Dalways}.
+
 @item --indicator-style=3D@var{word}
 @opindex --indicator-style
 Append a character indicator with style @var{word} to entry names,
diff --git a/src/ls.c b/src/ls.c
index 4802d92..11fb417 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -110,6 +110,9 @@
 #include "areadlink.h"
 #include "mbsalign.h"
 #include "dircolors.h"
+#include "xgethostname.h"
+#include "c-ctype.h"
+#include "canonicalize.h"
=20
 /* Include <sys/capability.h> last to avoid a clash of <sys/types.h>
    include guards with some premature versions of libcap.
@@ -200,6 +203,9 @@ struct fileinfo
     /* For symbolic link, name of the file linked to, otherwise zero.  *=
/
     char *linkname;
=20
+    /* For terminal hyperlinks. */
+    char *absolute_name;
+
     struct stat stat;
=20
     enum filetype filetype;
@@ -248,7 +254,8 @@ static size_t quote_name (char const *name,
                           struct quoting_options const *options,
                           int needs_general_quoting,
                           const struct bin_str *color,
-                          bool allow_pad, struct obstack *stack);
+                          bool allow_pad, struct obstack *stack,
+                          char const *absolute_name);
 static size_t quote_name_buf (char **inbuf, size_t bufsize, char *name,
                               struct quoting_options const *options,
                               int needs_general_quoting, size_t *width,
@@ -346,6 +353,8 @@ static size_t sorted_file_alloc;
=20
 static bool color_symlink_as_referent;
=20
+static char const *hostname;
+
 /* mode of appropriate file for colorization */
 #define FILE_OR_LINK_MODE(File) \
     ((color_symlink_as_referent && (File)->linkok) \
@@ -548,6 +557,8 @@ ARGMATCH_VERIFY (indicator_style_args, indicator_styl=
e_types);
=20
 static bool print_with_color;
=20
+static bool print_hyperlink;
+
 /* Whether we used any colors in the output so far.  If so, we will
    need to restore the default color later.  If not, we will need to
    call prep_non_filename_text before using color for the first time. */=

@@ -814,6 +825,7 @@ enum
   FULL_TIME_OPTION,
   GROUP_DIRECTORIES_FIRST_OPTION,
   HIDE_OPTION,
+  HYPERLINK_OPTION,
   INDICATOR_STYLE_OPTION,
   QUOTING_STYLE_OPTION,
   SHOW_CONTROL_CHARS_OPTION,
@@ -864,6 +876,7 @@ static struct option const long_options[] =3D
   {"time", required_argument, NULL, TIME_OPTION},
   {"time-style", required_argument, NULL, TIME_STYLE_OPTION},
   {"color", optional_argument, NULL, COLOR_OPTION},
+  {"hyperlink", optional_argument, NULL, HYPERLINK_OPTION},
   {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION},
   {"context", no_argument, 0, 'Z'},
   {"author", no_argument, NULL, AUTHOR_OPTION},
@@ -1066,6 +1079,14 @@ first_percent_b (char const *fmt)
   return NULL;
 }
=20
+static char RFC3986[256];
+static void
+file_escape_init (void)
+{
+  for (int i =3D 0; i < 256; i++)
+    RFC3986[i] |=3D c_isalnum (i) || i =3D=3D '~' || i =3D=3D '-' || i =3D=
=3D '.' || i =3D=3D '_';
+}
+
 /* Read the abbreviated month names from the locale, to align them
    and to determine the max width of the field and to truncate names
    greater than our max allowed.
@@ -1500,6 +1521,17 @@ main (int argc, char **argv)
       obstack_init (&subdired_obstack);
     }
=20
+  if (print_hyperlink)
+    {
+      file_escape_init ();
+
+      hostname =3D xgethostname ();
+      /* The hostname is generally ignored,
+         so ignore failures obtaining it.  */
+      if (! hostname)
+        hostname =3D "";
+    }
+
   cwd_n_alloc =3D 100;
   cwd_file =3D xnmalloc (cwd_n_alloc, sizeof *cwd_file);
   cwd_n_used =3D 0;
@@ -1783,6 +1815,7 @@ decode_switches (int argc, char **argv)
             format =3D (isatty (STDOUT_FILENO) ? many_per_line : one_per=
_line);
           print_block_size =3D false;	/* disable -s */
           print_with_color =3D false;	/* disable --color */
+          print_hyperlink =3D false;	/* disable --hyperlink */
           break;
=20
         case FILE_TYPE_INDICATOR_OPTION: /* --file-type */
@@ -2005,6 +2038,22 @@ decode_switches (int argc, char **argv)
             break;
           }
=20
+        case HYPERLINK_OPTION:
+          {
+            int i;
+            if (optarg)
+              i =3D XARGMATCH ("--hyperlink", optarg, color_args, color_=
types);
+            else
+              /* Using --hyperlink with no argument is equivalent to usi=
ng
+                 --hyperlink=3Dalways.  */
+              i =3D color_always;
+
+            print_hyperlink =3D (i =3D=3D color_always
+                               || (i =3D=3D color_if_tty
+                                   && isatty (STDOUT_FILENO)));
+            break;
+          }
+
         case INDICATOR_STYLE_OPTION:
           indicator_style =3D XARGMATCH ("--indicator-style", optarg,
                                        indicator_style_args,
@@ -2715,8 +2764,16 @@ print_dir (char const *name, char const *realname,=
 bool command_line_arg)
       first =3D false;
       DIRED_INDENT ();
=20
+      char const *absolute_name =3D NULL;
+      if (print_hyperlink)
+        {
+          absolute_name =3D canonicalize_filename_mode (name, CAN_MISSIN=
G);
+          if (! absolute_name)
+            file_failure (command_line_arg,
+                          _("error canonicalizing %s"), name);
+        }
       quote_name (realname ? realname : name, dirname_quoting_options, -=
1,
-                  NULL, true, &subdired_obstack);
+                  NULL, true, &subdired_obstack, absolute_name);
=20
       DIRED_FPUTS_LITERAL (":\n", stdout);
     }
@@ -2909,6 +2966,7 @@ free_ent (struct fileinfo *f)
 {
   free (f->name);
   free (f->linkname);
+  free (f->absolute_name);
   if (f->scontext !=3D UNKNOWN_SECURITY_CONTEXT)
     {
       if (is_smack_enabled ())
@@ -3072,6 +3130,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
     }
=20
   if (command_line_arg
+      || print_hyperlink
       || format_needs_stat
       /* When coloring a directory (we may know the type from
          direct.d_type), we have to stat it in order to indicate
@@ -3110,22 +3169,31 @@ gobble_file (char const *name, enum filetype type=
, ino_t inode,
=20
     {
       /* Absolute name of this file.  */
-      char *absolute_name;
+      char *full_name;
       bool do_deref;
       int err;
=20
       if (name[0] =3D=3D '/' || dirname[0] =3D=3D 0)
-        absolute_name =3D (char *) name;
+        full_name =3D (char *) name;
       else
         {
-          absolute_name =3D alloca (strlen (name) + strlen (dirname) + 2=
);
-          attach (absolute_name, dirname, name);
+          full_name =3D alloca (strlen (name) + strlen (dirname) + 2);
+          attach (full_name, dirname, name);
+        }
+
+      if (print_hyperlink)
+        {
+          f->absolute_name =3D canonicalize_filename_mode (full_name,
+                                                         CAN_MISSING);
+          if (! f->absolute_name)
+            file_failure (command_line_arg,
+                          _("error canonicalizing %s"), full_name);
         }
=20
       switch (dereference)
         {
         case DEREF_ALWAYS:
-          err =3D stat (absolute_name, &f->stat);
+          err =3D stat (full_name, &f->stat);
           do_deref =3D true;
           break;
=20
@@ -3134,7 +3202,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
           if (command_line_arg)
             {
               bool need_lstat;
-              err =3D stat (absolute_name, &f->stat);
+              err =3D stat (full_name, &f->stat);
               do_deref =3D true;
=20
               if (dereference =3D=3D DEREF_COMMAND_LINE_ARGUMENTS)
@@ -3147,14 +3215,14 @@ gobble_file (char const *name, enum filetype type=
, ino_t inode,
                 break;
=20
               /* stat failed because of ENOENT, maybe indicating a dangl=
ing
-                 symlink.  Or stat succeeded, ABSOLUTE_NAME does not ref=
er to a
+                 symlink.  Or stat succeeded, FULL_NAME does not refer t=
o a
                  directory, and --dereference-command-line-symlink-to-di=
r is
                  in effect.  Fall through so that we call lstat instead.=
  */
             }
           FALLTHROUGH;
=20
         default: /* DEREF_NEVER */
-          err =3D lstat (absolute_name, &f->stat);
+          err =3D lstat (full_name, &f->stat);
           do_deref =3D false;
           break;
         }
@@ -3165,7 +3233,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
              an exit status of 2.  For other files, stat failure
              provokes an exit status of 1.  */
           file_failure (command_line_arg,
-                        _("cannot access %s"), absolute_name);
+                        _("cannot access %s"), full_name);
           if (command_line_arg)
             return 0;
=20
@@ -3180,13 +3248,13 @@ gobble_file (char const *name, enum filetype type=
, ino_t inode,
       /* Note has_capability() adds around 30% runtime to 'ls --color'  =
*/
       if ((type =3D=3D normal || S_ISREG (f->stat.st_mode))
           && print_with_color && is_colored (C_CAP))
-        f->has_capability =3D has_capability_cache (absolute_name, f);
+        f->has_capability =3D has_capability_cache (full_name, f);
=20
       if (format =3D=3D long_format || print_scontext)
         {
           bool have_scontext =3D false;
           bool have_acl =3D false;
-          int attr_len =3D getfilecon_cache (absolute_name, f, do_deref)=
;
+          int attr_len =3D getfilecon_cache (full_name, f, do_deref);
           err =3D (attr_len < 0);
=20
           if (err =3D=3D 0)
@@ -3210,7 +3278,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
=20
           if (err =3D=3D 0 && format =3D=3D long_format)
             {
-              int n =3D file_has_acl_cache (absolute_name, f);
+              int n =3D file_has_acl_cache (full_name, f);
               err =3D (n < 0);
               have_acl =3D (0 < n);
             }
@@ -3223,7 +3291,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
           any_has_acl |=3D f->acl_type !=3D ACL_T_NONE;
=20
           if (err)
-            error (0, errno, "%s", quotef (absolute_name));
+            error (0, errno, "%s", quotef (full_name));
         }
=20
       if (S_ISLNK (f->stat.st_mode)
@@ -3231,8 +3299,8 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
         {
           struct stat linkstats;
=20
-          get_link_name (absolute_name, f, command_line_arg);
-          char *linkname =3D make_link_name (absolute_name, f->linkname)=
;
+          get_link_name (full_name, f, command_line_arg);
+          char *linkname =3D make_link_name (full_name, f->linkname);
=20
           /* Avoid following symbolic links when possible, ie, when
              they won't be traced and when no indicator is needed.  */
@@ -4368,10 +4436,33 @@ quote_name_width (const char *name, struct quotin=
g_options const *options,
   return width;
 }
=20
+/* %XX escape any input out of range as defined in RFC3986,
+   and also if PATH, convert all path separators to '/'.  */
+static char *
+file_escape (const char *str, bool path)
+{
+  char *esc =3D xnmalloc (3, strlen (str) + 1);
+  char *p =3D esc;
+  while (*str)
+    {
+      if (path && ISSLASH (*str))
+        {
+          *p++ =3D '/';
+          str++;
+        }
+      else if (RFC3986[to_uchar (*str)])
+        *p++ =3D *str++;
+      else
+        p +=3D sprintf (p, "%%%02x", to_uchar (*str++));
+    }
+  *p =3D '\0';
+  return esc;
+}
+
 static size_t
 quote_name (char const *name, struct quoting_options const *options,
             int needs_general_quoting, const struct bin_str *color,
-            bool allow_pad, struct obstack *stack)
+            bool allow_pad, struct obstack *stack, char const *absolute_=
name)
 {
   char smallbuf[BUFSIZ];
   char *buf =3D smallbuf;
@@ -4387,6 +4478,17 @@ quote_name (char const *name, struct quoting_optio=
ns const *options,
   if (color)
     print_color_indicator (color);
=20
+  size_t link_len =3D 0;
+  if (absolute_name)
+    {
+      char *h =3D file_escape (hostname, /* path=3D */ false);
+      char *n =3D file_escape (absolute_name, /* path=3D */ true);
+      link_len =3D printf ("\033]8;;file://%s%s%s\a", h, *n =3D=3D '/' ?=
 "" : "/", n);
+      free (h);
+      free (n);
+    }
+  dired_pos +=3D link_len;
+
   if (stack)
     PUSH_CURRENT_DIRED_POS (stack);
=20
@@ -4400,6 +4502,10 @@ quote_name (char const *name, struct quoting_optio=
ns const *options,
   if (stack)
     PUSH_CURRENT_DIRED_POS (stack);
=20
+  if (absolute_name)
+    link_len =3D printf ("\033]8;;\a");
+  dired_pos +=3D link_len;
+
   return len + pad;
 }
=20
@@ -4418,7 +4524,7 @@ print_name_with_quoting (const struct fileinfo *f,
                                && (color || is_colored (C_NORM)));
=20
   size_t len =3D quote_name (name, filename_quoting_options, f->quoted,
-                           color, !symlink_target, stack);
+                           color, !symlink_target, stack, f->absolute_na=
me);
=20
   process_signals ();
   if (used_color_this_time)
@@ -5064,6 +5170,10 @@ Sort entries alphabetically if none of -cftuvSUX n=
or --sort is specified.\n\
                                (overridden by -a or -A)\n\
 "), stdout);
       fputs (_("\
+      --hyperlink[=3DWHEN]     hyperlink file names; WHEN can be 'always=
'\n\
+                               (default if omitted), 'auto', or 'never'\=
n\
+"), stdout);
+      fputs (_("\
       --indicator-style=3DWORD  append indicator with style WORD to entr=
y names:\
 \n\
                                none (default), slash (-p),\n\
diff --git a/tests/local.mk b/tests/local.mk
index 8fc48c4..f96ccef 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -606,6 +606,7 @@ all_tests =3D					\
   tests/ls/symlink-slash.sh			\
   tests/ls/time-style-diag.sh			\
   tests/ls/x-option.sh				\
+  tests/ls/hyperlink.sh				\
   tests/mkdir/p-1.sh				\
   tests/mkdir/p-2.sh				\
   tests/mkdir/p-3.sh				\
diff --git a/tests/ls/hyperlink.sh b/tests/ls/hyperlink.sh
new file mode 100755
index 0000000..025d4a2
--- /dev/null
+++ b/tests/ls/hyperlink.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+# Test --hyperlink processing
+
+# Copyright (C) 2017 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=3D.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ ls realpath
+
+hostname=3D$(hostname) || skip_ 'unable to determine hostname'
+
+# lookup based on first letter
+encode() {
+ printf '%s\n' \
+  'sp%20ace' 'ques%3ftion' 'back%5cslash' 'encoded%253Fquestion' 'testdi=
r' \
+  "$1" |
+ sort -k1,1.1 -s | uniq -w1 -d
+}
+
+ls_encoded() {
+  ef=3D$(encode "$1")
+  echo "$ef" | grep -q 'dir$' && dir=3D: || dir=3D''
+  printf '\033]8;;file://%s%s/%s\a%s\033]8;;\a%s\n' \
+    $hostname $basepath $ef "$1" "$dir"
+}
+
+mkdir testdir || framework_failure_
+basepath=3D$(realpath -m .) || framework_failure_
+(
+cd testdir
+ls_encoded "testdir" > ../exp.t || framework_failure_
+basepath=3D"$basepath/testdir"
+for f in 'back\slash' 'encoded%3Fquestion' 'ques?tion' 'sp ace'; do
+  touch "$f" || framework_failure_
+  ls_encoded "$f" >> ../exp.t || framework_failure_
+done
+)
+ln -s testdir testdirl || framework_failure_
+(cat exp.t; echo; sed 's/[^\/]testdir/&l/' exp.t) > exp || framework_fai=
lure_
+ls --hyper testdir testdirl >out || fail=3D1
+compare exp out || fail=3D1
+
+ln -s '/probably/missing' testlink || framework_failure_
+target=3D$(realpath -m testlink) || framework_failure_
+ls -l --hyper testlink > out || fail=3D1
+grep "file://.*$target" out || fail=3D1
+
+Exit $fail
--=20
2.9.3


--------------4CCB215C6C4D2D1D25F2AA09--


From MAILER-DAEMON Mon Aug 21 09:35:31 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1djmra-0007yq-W6
	for mharc-coreutils@gnu.org; Mon, 21 Aug 2017 09:35:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43450)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fulkhani@gmail.com>) id 1djhCS-0005x5-Ug
	for coreutils@gnu.org; Mon, 21 Aug 2017 03:32:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fulkhani@gmail.com>) id 1djhCS-0008GY-Bl
	for coreutils@gnu.org; Mon, 21 Aug 2017 03:32:40 -0400
Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:38799)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <fulkhani@gmail.com>) id 1djhCS-0008Ev-57
	for coreutils@gnu.org; Mon, 21 Aug 2017 03:32:40 -0400
Received: by mail-wr0-x229.google.com with SMTP id p8so26916222wrf.5
	for <coreutils@gnu.org>; Mon, 21 Aug 2017 00:32:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to
	:content-transfer-encoding;
	bh=gJLU3s/ic0/m92EyJrLu5wkoLGa9+vJNS04zfCx/BMU=;
	b=rJNBB5KgzoZjx4SDG/DoWG1nHG8i7dOGMYX4wwHKz2/PI/YnP4ubyNHKj3HhvjTN4v
	DYcX4oKGxDv7tNymr+DYLlfvhQ3zQ1JqudQn8zGt+tnhV72WHZSwZrwzT5InkrnD37DO
	gAs52zO2PF5nu+iMlzCNfBwYEo/YKEYQ5gcJ3XBtIzHPcW+ShqJPeBKI8i0MFr/Bdnq7
	NMVcK1E59ppTOZbQAzCHnAO0SoMEBHMRlZu1mr6HTuJONuz5NXiSs8g1TrE6L1Xd3/u5
	Z5yjBQeBqYm8LzasHAFrhi8e5mGDiMq8UYVnHlOX/gBoaZuBZ/N3r41hoyvBxP5uEPCm
	GdNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to
	:content-transfer-encoding;
	bh=gJLU3s/ic0/m92EyJrLu5wkoLGa9+vJNS04zfCx/BMU=;
	b=Vg+SFyWyvzg4zuMm++GGF+FV14k+B+m85YO6WFX/zeJ2KoGiE75yI/AFTqKoJxwKdh
	Lxx67qsQzR2OJVnHTBvxSVtIGZlnMzyM9CJYA9xjMtb7tf2J9nQMZrXhcZM5VtYTD680
	QqXdZHc3xDJicZW89UDQVS9RXFHwmA9Z10xA9cvleDjqRaxfDiFWLWxPGbeqfuUrJGYn
	KK9bgVKakofz2pECu+4OUHEDrcgiBli+YLeaf5iIjAPKeyRfe0ylb7h9ZCFHyvwnq3C8
	lxAn/EzAdJnB+RWCR2qOOHo5KOh1sqeGaqTC14mEpDe80+x2UNfYd/UzBtM8zfG6knIm
	VH0g==
X-Gm-Message-State: AHYfb5g5OqWl3EvvfRqiQvri5WtRguHLabAlLnG6jH1/m2AncHU6T+uD
	Oi7JRDAAmwKqwChCPu83CZcfcCaVlQ==
X-Received: by 10.28.144.197 with SMTP id s188mr5219870wmd.144.1503300756452; 
	Mon, 21 Aug 2017 00:32:36 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.28.111.194 with HTTP; Mon, 21 Aug 2017 00:32:35 -0700 (PDT)
From: Sayed Mulkhan Fulkhani <fulkhani@gmail.com>
Date: Mon, 21 Aug 2017 14:32:35 +0700
Message-ID: <CADtYDdUGWDqFe1siKOPH+N20Df_0si8TnK8GOrmhBuuH+MO_hA@mail.gmail.com>
Subject: tail: unrecognized file system type 0x53464846
To: coreutils@gnu.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2a00:1450:400c:c0c::229
X-Mailman-Approved-At: Mon, 21 Aug 2017 09:35:30 -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, 21 Aug 2017 07:32:41 -0000

tail: unrecognized file system type 0x53464846 for =E2=80=98make.txt=E2=80=
=99. please
report this to bug-coreutils@gnu.org. reverting to polling


From MAILER-DAEMON Mon Aug 21 17:14:37 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dju1t-0003tx-7e
	for mharc-coreutils@gnu.org; Mon, 21 Aug 2017 17:14:37 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33347)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dju1r-0003sI-4O
	for coreutils@gnu.org; Mon, 21 Aug 2017 17:14:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dju1q-0006zW-5H
	for coreutils@gnu.org; Mon, 21 Aug 2017 17:14:35 -0400
Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:38748)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dju1p-0006xu-WB
	for coreutils@gnu.org; Mon, 21 Aug 2017 17:14:34 -0400
Received: by mail-it0-x236.google.com with SMTP id x187so16023717ite.1
	for <coreutils@gnu.org>; Mon, 21 Aug 2017 14:14:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=YER2JPd1Kgff18wbPW9H9034MiNPDC3pxRnZwJC9tBE=;
	b=peVCF4OiOsKqYDQNUcYPJorwe0tiWqH+PNdk1fd3S8qrxt5P034ooukgBWYQrn+oac
	InnVLk79uXTSZNOvT5r4reE3MsB7o/IYfXOf/WGCiPoEVN6pY6BY6T2J898wckZRKygO
	mPIbQhkI6vRTjT3pfiDmIhzFstQDEo3Q8avp9zJmkrcis7MRHmiK3GDcstoWEtSTYHG6
	g6IwP+e5Y+ci2BexZtrsldlg8EsU4JLGC/VBw9nISABAmWloTEsZBwyBjjInZsnntedH
	ygZRQVQl9XLHb7x4xEX+vfDH4Gm7xcsEvoQS0+yMqZBKiLhANQRN0Qo4P5QJpYsj8pXk
	Na8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=YER2JPd1Kgff18wbPW9H9034MiNPDC3pxRnZwJC9tBE=;
	b=hx20KnRPE9n11WqSxd11GcXaCSwyf3lsuPNbyBBF+0ov0ZW8+iVx3riob5TbcOJrTn
	39IiHUH0YhNETd44nmzqM9YGE35/pvMz3uAnxBgWTk47XNURJ9IM1GSU9qALqYPiRzv6
	3RK1LORQm88LAWuEd4DHtG+nStFx7ohZs2cnOzW2V3yurfWhWcilOWp5jfEcGlgqUgE9
	ozZLHPpR22o9WueVjMU3olz7UpbCqwgQjfa+MqCTfMi0MZAKpHSoCrPd4/HU27i9aOiY
	9VFG/5oEuWUg9iL2/LHZ61QSi7ay4pmoSwBfZ+RTmFF7O4mZhHwZDkiG9fq8amxJzcs4
	sWtw==
X-Gm-Message-State: AHYfb5hPJrcwrhZ5o3Y4f4lvlyAkEvOq9DI9pGicadetmGKmtguOaZdf
	M2ZnvMztjobBwGe8dwcDr9rTubT4uw==
X-Received: by 10.36.150.71 with SMTP id z68mr6767543itd.6.1503350072100; Mon,
	21 Aug 2017 14:14:32 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Mon, 21 Aug 2017 14:13:51 -0700 (PDT)
In-Reply-To: <d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Mon, 21 Aug 2017 23:13:51 +0200
Message-ID: <CAGWcZkL0SK15tBgiVEiroWARdbfwnC790KoF5UPOAVaT+e689Q@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::236
Content-Type: text/plain; charset="UTF-8"
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: Mon, 21 Aug 2017 21:14:36 -0000

Hi,

Thanks a lot! I'll take a closer look when I return from my vacation. A few
comments below:

I used more stringent escaping as per rfc3986
>

Indeed I was way too sloppy here (and elsewhere too), my patch was clearly
proof-of-concept quality :) Obviously '?' and '#' need to be escaped so
that the browser doesn't terminate the URL there, and '%' because the
escape character always needs to be escaped.

(I had no idea what browsers did on a '?' character in a "file:" URL, since
in http that character is special for the server only, not for the browser
as far as I know. But at least Firefox strips the rest.)

I was tempted to add --hyperlink to realpath, though I'm not sure it's
> needed.
>
> I was tempted to add a --hyperlink=raw option to output just the file://...
>

For both: I share your doubts. IMO these would be more for feature
completeness rather than actual usable features. Maybe stat(1) could be a
more useful target. But perhaps we should first see how the "ls" feature
goes, and wait until someone requests these :)

cheers,
egmont

From MAILER-DAEMON Tue Aug 22 00:07:35 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dk0TX-0002dF-8O
	for mharc-coreutils@gnu.org; Tue, 22 Aug 2017 00:07:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52715)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dk0TV-0002cm-Kn
	for coreutils@gnu.org; Tue, 22 Aug 2017 00:07:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dk0TS-0008K9-Fi
	for coreutils@gnu.org; Tue, 22 Aug 2017 00:07:33 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:48840)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dk0TS-0008Jc-9Y
	for coreutils@gnu.org; Tue, 22 Aug 2017 00:07:30 -0400
Received: from localhost.localdomain (unknown [73.93.153.25])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id C224E14F;
	Tue, 22 Aug 2017 05:07:27 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tail: reinstate inotify use with FIFOs
Date: Mon, 21 Aug 2017 21:07:09 -0700
Message-Id: <20170822040709.21504-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 22 Aug 2017 04:07:34 -0000

commit v8.27-44-g18f6b22 was too aggressive in
only allowing inotify use with regular files. This will
support responsive processing of `tail -f fifo | ...`

* src/tail.c (any_non_regular): Adjust to allow FIFOs
since inotify supports these well.
* tests/tail-2/inotify-only-regular.sh: Adjust comment.
---
 src/tail.c                           | 8 ++++----
 tests/tail-2/inotify-only-regular.sh | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/tail.c b/src/tail.c
index ce34886..316e72e 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1332,15 +1332,15 @@ any_symlinks (const struct File_spec *f, size_t n_files)
 }
 
 /* Return true if any of the N_FILES files in F is not
-   a regular file.  This is used to avoid adding inotify
+   a regular file or fifo.  This is used to avoid adding inotify
    watches on a device file for example, which inotify
    will accept, but not give any events for.  */
 
 static bool
-any_non_regular (const struct File_spec *f, size_t n_files)
+any_non_regular_fifo (const struct File_spec *f, size_t n_files)
 {
   for (size_t i = 0; i < n_files; i++)
-    if (0 <= f[i].fd && ! S_ISREG (f[i].mode))
+    if (0 <= f[i].fd && ! S_ISREG (f[i].mode) && ! S_ISFIFO (f[i].mode))
       return true;
   return false;
 }
@@ -2460,7 +2460,7 @@ main (int argc, char **argv)
                                || any_remote_file (F, n_files)
                                || ! any_non_remote_file (F, n_files)
                                || any_symlinks (F, n_files)
-                               || any_non_regular (F, n_files)
+                               || any_non_regular_fifo (F, n_files)
                                || (!ok && follow_mode == Follow_descriptor)))
         disable_inotify = true;
 
diff --git a/tests/tail-2/inotify-only-regular.sh b/tests/tail-2/inotify-only-regular.sh
index 4d106fb..9f8da94 100755
--- a/tests/tail-2/inotify-only-regular.sh
+++ b/tests/tail-2/inotify-only-regular.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# ensure that tail -f only uses inotify for regular files
+# ensure that tail -f only uses inotify for regular files or fifos
 
 # Copyright (C) 2017 Free Software Foundation, Inc.
 
-- 
2.9.3



From MAILER-DAEMON Tue Aug 22 01:02:56 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dk1L6-0001iR-TV
	for mharc-coreutils@gnu.org; Tue, 22 Aug 2017 01:02:56 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33725)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dk1L5-0001i8-1f
	for coreutils@gnu.org; Tue, 22 Aug 2017 01:02:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dk1L0-0002Fm-60
	for coreutils@gnu.org; Tue, 22 Aug 2017 01:02:55 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:51936)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dk1Kz-0002Fc-W9
	for coreutils@gnu.org; Tue, 22 Aug 2017 01:02:50 -0400
Received: from localhost.localdomain (unknown [73.93.153.25])
	(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 59D8F94AE;
	Tue, 22 Aug 2017 06:02:47 +0100 (IST)
To: Coreutils <coreutils@gnu.org>
Cc: Bruno Haible <bruno@clisp.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Subject: coreutils-8.28 impending release
Message-ID: <31de062d-36a4-9e9e-e5ab-82bdb7ef186b@draigBrady.com>
Date: Mon, 21 Aug 2017 22:02:45 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
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]
	[fuzzy]
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: Tue, 22 Aug 2017 05:02:55 -0000

FYI, I'm planning to do a testing release in a few days,
with coreutils-8.28 to be released next week hopefully.

I intend to include ls --hyperlink in that,
and update to the latest gnulib.

If there is anything else outstanding please yell.

thanks,
P=C3=A1draig.


From MAILER-DAEMON Thu Aug 24 03:29:01 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dkmZY-00075A-Tu
	for mharc-coreutils@gnu.org; Thu, 24 Aug 2017 03:29:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50513)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dkmZV-000753-Ua
	for coreutils@gnu.org; Thu, 24 Aug 2017 03:28:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dkmZS-00086G-GQ
	for coreutils@gnu.org; Thu, 24 Aug 2017 03:28:57 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:44054)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dkmZS-00085E-9e
	for coreutils@gnu.org; Thu, 24 Aug 2017 03:28:54 -0400
Received: from localhost.localdomain (unknown [73.93.155.169])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 317399497;
	Thu, 24 Aug 2017 08:28:49 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] ls: consistently quote symlink targets
Date: Thu, 24 Aug 2017 00:28:40 -0700
Message-Id: <20170824072840.29129-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 24 Aug 2017 07:28:59 -0000

* src/ls.c (gobble_file): Disable the optimization to avoid quoting
if the symlink target itself needs quoting.  This was introduced
with the quoting alignment adjustments in v8.25-106-g01971c0
* tests/ls/symlink-quote.sh: Add a test.
* tests/local.mk: Reference the test.
* NEWS: Mention the fix.
---
 NEWS                      |  4 ++++
 src/ls.c                  |  5 +++++
 tests/local.mk            |  1 +
 tests/ls/symlink-quote.sh | 30 ++++++++++++++++++++++++++++++
 4 files changed, 40 insertions(+)
 create mode 100755 tests/ls/symlink-quote.sh

diff --git a/NEWS b/NEWS
index c796fb5..622c862 100644
--- a/NEWS
+++ b/NEWS
@@ -45,6 +45,10 @@ GNU coreutils NEWS                                    -*- outline -*-
   Previously it would have always returned the 'EXIT' name.
   [bug introduced in fileutils-4.1.9]
 
+  ls now quotes symlink targets when consistently.  Previously it may not
+  have quoted the target name if the link name itself didn't need quoting.
+  [bug introduced in coreutils-8.26]
+
   split no longer exits when invocations of a --filter return EPIPE.
   [bug introduced in coreutils-8.26]
 
diff --git a/src/ls.c b/src/ls.c
index 1d39904..85b7604 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3304,6 +3304,11 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
           get_link_name (full_name, f, command_line_arg);
           char *linkname = make_link_name (full_name, f->linkname);
 
+          /* Use the slower quoting path for this entry, though
+             don't update CWD_SOME_QUOTED since alignment not affected.  */
+          if (linkname && f->quoted == 0 && needs_quoting (f->linkname))
+            f->quoted = 1;
+
           /* Avoid following symbolic links when possible, ie, when
              they won't be traced and when no indicator is needed.  */
           if (linkname
diff --git a/tests/local.mk b/tests/local.mk
index f96ccef..732ec99 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -603,6 +603,7 @@ all_tests =					\
   tests/ls/stat-free-color.sh			\
   tests/ls/stat-free-symlinks.sh		\
   tests/ls/stat-vs-dirent.sh			\
+  tests/ls/symlink-quote.sh			\
   tests/ls/symlink-slash.sh			\
   tests/ls/time-style-diag.sh			\
   tests/ls/x-option.sh				\
diff --git a/tests/ls/symlink-quote.sh b/tests/ls/symlink-quote.sh
new file mode 100755
index 0000000..d792d96
--- /dev/null
+++ b/tests/ls/symlink-quote.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Ensure symlinks are quoted appropriately
+
+# Copyright (C) 2017 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_ ls
+
+ln -s 'needs quoting' symlink || framework_failure_
+
+ls -l --quoting-style='shell-escape' symlink >out || fail=1
+
+# Coreutils v8.26 and 8.27 failed to quote the target name
+grep -q "symlink -> 'needs quoting'\$" out ||
+  { cat out; fail=1; }
+
+Exit $fail
-- 
2.9.3



From MAILER-DAEMON Thu Aug 24 13:59:47 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dkwPz-0000QA-2g
	for mharc-coreutils@gnu.org; Thu, 24 Aug 2017 13:59:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58665)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dkwPw-0000Pr-L3
	for coreutils@gnu.org; Thu, 24 Aug 2017 13:59:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dkwPs-0000b1-Lb
	for coreutils@gnu.org; Thu, 24 Aug 2017 13:59:44 -0400
Received: from mx1.redhat.com ([209.132.183.28]:37746)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eblake@redhat.com>) id 1dkwPs-0000ar-CM
	for coreutils@gnu.org; Thu, 24 Aug 2017 13:59:40 -0400
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
	[10.5.11.11])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id E039C8047F;
	Thu, 24 Aug 2017 17:59:38 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E039C8047F
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=eblake@redhat.com
Received: from [10.10.123.71] (ovpn-123-71.rdu2.redhat.com [10.10.123.71])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 003C07D95A;
	Thu, 24 Aug 2017 17:59:37 +0000 (UTC)
Subject: Re: bug#28224: Need to know technical support for GnuWin32: CoreUtils
	5.3.0 versions
To: Ravinder <yugandharbhoomi@gmail.com>, 28224-done@debbugs.gnu.org,
	coreutils@gnu.org
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
Cc: Ravinder.padigela@in.ibm.com
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <078c88e8-78cf-055e-3b5f-ffe0baf5c3a8@redhat.com>
Date: Thu, 24 Aug 2017 12:59:36 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="ArGVVOx0FObFkmAvimNSRaKD3vFQ8di5S"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.28]);
	Thu, 24 Aug 2017 17:59:39 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Thu, 24 Aug 2017 17:59:45 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--ArGVVOx0FObFkmAvimNSRaKD3vFQ8di5S
From: Eric Blake <eblake@redhat.com>
To: Ravinder <yugandharbhoomi@gmail.com>, 28224-done@debbugs.gnu.org,
 coreutils@gnu.org
Cc: Ravinder.padigela@in.ibm.com
Message-ID: <078c88e8-78cf-055e-3b5f-ffe0baf5c3a8@redhat.com>
Subject: Re: bug#28224: Need to know technical support for GnuWin32: CoreUtils
 5.3.0 versions
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
In-Reply-To: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

tag 28224 notabug
thanks

On 08/24/2017 06:24 AM, Ravinder wrote:
> Hi,
>=20
> We are using GnuWin32: CoreUtils 5.3.0 versions in our project, so
> requesting you to know whether the technical support is still giving fo=
r
> these versions, so that we will plan our project to use the latest vers=
ion
> of GnuWin32: CoreUtils.

This site does not maintain GnuWin32.  You'll have to ask the GnuWin32
folks how long they plan to support something, and I doubt that anyone
working on GnuWin32 reads this list.  As such, I'm closing this issue in
the upstream coreutils bug database, as it is not an upstream bug, so
much as a support question to your choice of vendor, which should
therefore be directed to your vendor.

As it is, 5.3.0 is ancient, compared to current upstream 8.27.  Using
software that is more than 12 years old is rather risky on your part,
since even some of the longest Enterprise contracts you can purchase
tend not to last that long.  So if I had to guess, I'd state that
GnuWin32 is unsupported.

>=20
> Kindly feel free & revert me ASAP.

"revert me" doesn't make much sense; did you mean "reply to me"?

--=20
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

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

iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlmfFAgACgkQp6FrSiUn
Q2pfQwf5AbCNJ7OecX4FFMpxHk9hBpw80IFe99uOjUhawCsI3WbnTZVRLSb7iqwL
wLPxN21FQJaJsUT5U6c8NJZRLeFSPeHqRD/rv3N5TwPnyodmX4CklJ/CBnARMq8I
FenC1IomgjMOrJp8m3VYeq2kaEz/I9zUjb46NJTUCoJlXhWQLnLjJDSnD7w82yEZ
uccuFRSVoLx44ylyQ4cJwruRMxmtw5swW37TdL/SCLoqwR2diRkwqWvzt0ajK0nW
lZBWjrmrXMecEOjTdDdobeileTjX1HxTsGivb6jrvVDnT/HSf7aFn1pyeb+vaNWM
JhBhRILAhRgQA1fgK3Majm+fn9bAkw==
=k7Fr
-----END PGP SIGNATURE-----

--ArGVVOx0FObFkmAvimNSRaKD3vFQ8di5S--


From MAILER-DAEMON Thu Aug 24 21:30:54 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dl3SY-0002dA-B9
	for mharc-coreutils@gnu.org; Thu, 24 Aug 2017 21:30:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52766)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dl3SW-0002cC-N8
	for coreutils@gnu.org; Thu, 24 Aug 2017 21:30:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dl3SV-0000rO-Kd
	for coreutils@gnu.org; Thu, 24 Aug 2017 21:30:52 -0400
Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:38722)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dl3SV-0000ql-HD
	for coreutils@gnu.org; Thu, 24 Aug 2017 21:30:51 -0400
Received: by mail-qk0-x22d.google.com with SMTP id o184so5603862qkc.5
	for <coreutils@gnu.org>; Thu, 24 Aug 2017 18:30:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=bh7iTZLL3SKULlhYAdoiLmxwvY87HtKqnJlQv/X7KXA=;
	b=l/Y/j6hr6TJ/Hg0I5gFC4tIse4/6pooQr247zCu9TpWMTpRCpFwIxISReWDAPQNRNG
	V2Cj7faAQiJt829C2N7pZWAc81XrnLa0IVJFnqO+1TDWcVVMzMkz8RyHg8l3rYMQ/wlk
	ye/HFxz+gJ7O4oU6FgCn9vW4GGAMrgksKwZYNStncEJb1Xe1htSMCYscd21gLxVTGK95
	AoV0fyi8Yo6gDJh2g0FpU3IXFIy1QmkPADQXaNt0Uj3MmZqAEP7plSTc80C2liL8PBkW
	BsKZzTojJAexsy/fihevC0iP05Dyetp984rgLILBRaBTCGFjhmXZi+vje1Uv4Ee2HhAM
	gQ9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=bh7iTZLL3SKULlhYAdoiLmxwvY87HtKqnJlQv/X7KXA=;
	b=CbRj00FNWnteoeirjdtb+w7QytKuktm1d0g9HkZvl9oVSlzth5Tt4nUmBNGTeGRnbl
	bwsbecAU+7nItYisAaNLjzhjTgba+JksDFEAzKzp9C3mxyLyWu2tOha2OvXsYQkfZJCa
	sV9wXHlLSG5lEYlJwVtkGRBv6njL5ae2o6kWNGGEkUrVIqtfnGQ4cfgp8RA7rLheHXv7
	lAc1XcteCDz9a2WPsFKZmNBPYtv6gf4RZsG9v0urCu6vr+A7s/3GuQwKEAqA/ZJmrj7S
	7mUpZGLVxhPNu34ySeBQfjilkbAAmjVyRyNRM9hTROXG03LtYUuw7AEbhDj4Iv7eGV9Y
	pwsw==
X-Gm-Message-State: AHYfb5hNTMX4cD79fXxOJ+G2ztgCMbhaoG1by+8v2ZOdj5NGVLyOAlbe
	EGBRrDPuUKg+75q6d+OxYQstQ3V5kA==
X-Received: by 10.55.220.3 with SMTP id v3mr12044040qki.102.1503624649647;
	Thu, 24 Aug 2017 18:30:49 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.55.46.66 with HTTP; Thu, 24 Aug 2017 18:30:28 -0700 (PDT)
In-Reply-To: <20170824072840.29129-1-P@draigBrady.com>
References: <20170824072840.29129-1-P@draigBrady.com>
From: Jim Meyering <jim@meyering.net>
Date: Thu, 24 Aug 2017 18:30:28 -0700
X-Google-Sender-Auth: VXcsZxhEleV4MoLoaAbCR9ZIFf4
Message-ID: <CA+8g5KH7g1R1p+UWzf7OSSgjxqU10SPkOvT6MCg3ZeuSuksytQ@mail.gmail.com>
Subject: Re: [PATCH] ls: consistently quote symlink targets
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400d:c09::22d
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, 25 Aug 2017 01:30:53 -0000

On Thu, Aug 24, 2017 at 12:28 AM, P=C3=A1draig Brady <P@draigbrady.com> wro=
te:
> * src/ls.c (gobble_file): Disable the optimization to avoid quoting
> if the symlink target itself needs quoting.  This was introduced
> with the quoting alignment adjustments in v8.25-106-g01971c0
> * tests/ls/symlink-quote.sh: Add a test.
> * tests/local.mk: Reference the test.
> * NEWS: Mention the fix.

> +++ b/NEWS
...
> +  ls now quotes symlink targets when consistently.  Previously it may no=
t
> +  have quoted the target name if the link name itself didn't need quotin=
g.
> +  [bug introduced in coreutils-8.26]

News nit: you probably want to remove that stray "when": s/when //
Fix looks fine. Thanks!


From MAILER-DAEMON Fri Aug 25 03:12:23 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dl8n1-00055k-JL
	for mharc-coreutils@gnu.org; Fri, 25 Aug 2017 03:12:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46812)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dl8mw-00055a-Gu
	for coreutils@gnu.org; Fri, 25 Aug 2017 03:12:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dl8mt-00016P-1b
	for coreutils@gnu.org; Fri, 25 Aug 2017 03:12:18 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:35854)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dl8ms-00015H-G3
	for coreutils@gnu.org; Fri, 25 Aug 2017 03:12:14 -0400
Received: from localhost.localdomain (unknown [73.93.153.11])
	(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 CAD3E9915;
	Fri, 25 Aug 2017 08:12:11 +0100 (IST)
Subject: Re: Feature request: ls --hyperlink
To: Egmont Koblinger <egmont@gmail.com>, coreutils@gnu.org
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
Date: Fri, 25 Aug 2017 00:12:09 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------4786820EEBECBFD7511AE19A"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 25 Aug 2017 07:12:22 -0000

This is a multi-part message in MIME format.
--------------4786820EEBECBFD7511AE19A
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 21/08/17 04:28, P=C3=A1draig Brady wrote:
> On 05/05/17 14:05, P=C3=A1draig Brady wrote:
>> On 04/05/17 13:14, Egmont Koblinger wrote:
>>> Hi,
>>>
>>> Recently two popular terminal emulators, GNOME Terminal and iTerm2
>>> have implemented a brand new feature: explicit hyperlinks.
>>>
>>> Unlike the existing functionality of most terminal emulators of
>>> automatically detecting URLs that appear on the screen, this time it'=
s
>>> like hyperlinks on web pages: the link target is specified by the OSC
>>> 8 escape sequence and the visible text can be an arbitrary piece of
>>> text.
>>>
>>> As I've played with this feature, I found a really compelling use
>>> case: listing files in a way that all of them are hyperlinks to
>>> "file://...". It makes it as easy and convenient as a Ctrl+click to
>>> open them in their preferred graphical application.
>>>
>>> (For even more fun, there's a pending demo patch to GNOME Terminal to
>>> display a preview of certain local files on mouseover. We're uncertai=
n
>>> yet if we'll finalize and ship it or not.)
>>>
>>> I've created a quick proof of concept patch for a new cmdline option
>>> "ls --hyperlink=3Dalways/auto/never", have set it up in my "ls" alias=
,
>>> and been using that happily for a few weeks now. Please find it at
>>> https://bugzilla.gnome.org/show_bug.cgi?id=3D779734#c126. Note that i=
t
>>> contains a couple of issues, e.g. I forgot to free some data, and it
>>> does stupid things around symlinks. As said, it's a demo, not a fully
>>> polished patch.
>>>
>>> I'd be curious to hear if you like this idea, and would be happy to
>>> see this option appearing in mainstream coreutils.
>>>
>>> Please see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f=
3cb5feda
>>> for details about the feature.
>>>
>>> Let me know if you have any questions, concerns etc. (cc me, I'm not
>>> subscribed).
>>
>> Interesting.
>> This could apply to any util really that displays file names,
>> though ls would be the most useful.
>> Generally it also seems useful to the case where a file has a non repr=
esentable name
>> (well not cleanly at least without $'shell quoting').
>=20
> I've attached an implementation for ls --hyperlink.
>=20
> Some notes:
>=20
> I used canonicalize_filename_mode for consistency with other tools,
> and to relax the canonicalization with CAN_MISSING.
> I did this because access may be possible outside current shell context=
,
> and also we don't want to diagnose perm issues that would
> either not otherwise need diagnosing, or would be diagnosed
> independently by stat() etc.
>=20
> --dired is handled appropriately, since the terminal codes
> are similar to non displayed color codes and can be skipped similarly.
>=20
> I used more stringent escaping as per rfc3986
> because I think there are security issues with the more lax
> encoding described at https://gist.github.com/egmontkob/eb114294efbcd5a=
db1944c9f3cb5feda
> and I don't see any advantage of using that more lax encoding.
> If terminals provided a copy link functionality, or
> the links otherwise got outside the terminal context
> then there could be problematic handling of non encoded items.
> For example if you didn't encode '?' and the link was passed
> to a browser, then anything after that would be ignored.
> Also '%' needs to be encoded for the same reasons where
> files other than intended could be resolved.
>=20
> This should work on windows where c: is separated from the
> hostname appropriately and '\' are converted to '/',
> though I haven't tested there.
>=20
> I've tested with valgrind with multiple specified dirs
> and there are no leaks.
>=20
> I was tempted to add --hyperlink to realpath, though I'm not sure it's =
needed.
>=20
> I was tempted to add a --hyperlink=3Draw option to output just the file=
://...
> portion without the terminal codes, as older terminals highlight/proces=
s
> those fine and they might be otherwise usefule.  Though again I wasn't =
sure.
>=20

Version 2 attached which fixes a small mem leak,
ensures that URLs are aligned in padded output,
and disables --dired with --hyperlink since it didn't work in testing
and precluded the URL alignment method used (which excludes quotes from t=
he URL).
It might be useful to support //DIRED-OPTIONS// --hyperlink to identify
the URI portion to emacs, but we can do that separately if useful.

cheers,
P=C3=A1draig.


--------------4786820EEBECBFD7511AE19A
Content-Type: text/x-patch;
 name="ls--hyperlink.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="ls--hyperlink.patch"

=46rom 7cca5fc3279cb5bf54bb37344164078dbee53b00 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D <P@draigBrady.com>
Date: Mon, 21 Aug 2017 03:53:36 -0700
Subject: [PATCH] ls: support --hyperlink to output file:// URIs

Terminals such as iTerm2 and VTE based terminals
(as of version 0.49.1), support hyperlinks when
passed terminals codes as described at:
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

* src/ls.c (gobble_file): Allocate an absolute file name to output.
(quote_name): Output the absolute name with the appropriate codes.
(file_escape): A new function to encode file names as per rfc8089.
(main): Handle the new option and call the file_escape_init() helper.
Disable --dired when --hyperlink is specified.
(print_dir): Get the absolute file name here too, so that the
directory name can be linkified.
* NEWS: Mention the new feature.
* tests/ls/hyperlink.sh: Add a new test.
* tests/local.mk: Reference the new test.
* doc/coreutils.texi (ls invocation): Describe --hyperlink.
---
 NEWS                  |   3 +
 doc/coreutils.texi    |  26 ++++++-
 src/ls.c              | 198 ++++++++++++++++++++++++++++++++++++++++----=
------
 tests/local.mk        |   1 +
 tests/ls/hyperlink.sh |  61 ++++++++++++++++
 5 files changed, 248 insertions(+), 41 deletions(-)
 create mode 100755 tests/ls/hyperlink.sh

diff --git a/NEWS b/NEWS
index d37195e..00bfe5a 100644
--- a/NEWS
+++ b/NEWS
@@ -81,6 +81,9 @@ GNU coreutils NEWS                                    -=
*- outline -*-
   by prefixing the last specified number like --tabs=3D1,+8 which is
   useful for visualizing diff output for example.
=20
+  ls supports a new --hyperlink[=3Dwhen] option to output file://
+  format links to files, supported by some terminals.
+
   split supports a new --hex-suffixes[=3Dfrom] option to create files wi=
th
   lower case hexadecimal suffixes, similar to the --numeric-suffixes opt=
ion.
=20
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8f1cb4c..173f064 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7857,9 +7857,8 @@ may be omitted, or one of:
 @end itemize
 Specifying @option{--color} and no @var{when} is equivalent to
 @option{--color=3Dalways}.
-Piping a colorized listing through a pager like @command{more} or
-@command{less} usually produces unreadable results.  However, using
-@code{more -f} does seem to work.
+If piping a colorized listing through a pager like @command{less},
+use the @option{-R} option to pass the color codes to the terminal.
=20
 @vindex LS_COLORS
 @vindex SHELL @r{environment variable, and color}
@@ -7905,6 +7904,27 @@ command line unless the @option{--dereference-comm=
and-line} (@option{-H}),
 Append a character to each file name indicating the file type.  This is
 like @option{-F}, except that executables are not marked.
=20
+@item --hyperlink [=3D@var{when}]
+@opindex --hyperlink
+@cindex hyperlink, linking to files
+Output codes recognized by some terminals to link
+to files using the @samp{file://} URI format.
+@var{when} may be omitted, or one of:
+@itemize @bullet
+@item none
+@vindex none @r{hyperlink option}
+- Do not use hyperlinks at all.  This is the default.
+@item auto
+@vindex auto @r{hyperlink option}
+@cindex terminal, using hyperlink iff
+- Only use hyperlinks if standard output is a terminal.
+@item always
+@vindex always @r{hyperlink option}
+- Always use hyperlinks.
+@end itemize
+Specifying @option{--hyperlink} and no @var{when} is equivalent to
+@option{--hyperlink=3Dalways}.
+
 @item --indicator-style=3D@var{word}
 @opindex --indicator-style
 Append a character indicator with style @var{word} to entry names,
diff --git a/src/ls.c b/src/ls.c
index bb97e98..9ed4913 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -110,6 +110,9 @@
 #include "areadlink.h"
 #include "mbsalign.h"
 #include "dircolors.h"
+#include "xgethostname.h"
+#include "c-ctype.h"
+#include "canonicalize.h"
=20
 /* Include <sys/capability.h> last to avoid a clash of <sys/types.h>
    include guards with some premature versions of libcap.
@@ -200,6 +203,9 @@ struct fileinfo
     /* For symbolic link, name of the file linked to, otherwise zero.  *=
/
     char *linkname;
=20
+    /* For terminal hyperlinks. */
+    char *absolute_name;
+
     struct stat stat;
=20
     enum filetype filetype;
@@ -248,7 +254,8 @@ static size_t quote_name (char const *name,
                           struct quoting_options const *options,
                           int needs_general_quoting,
                           const struct bin_str *color,
-                          bool allow_pad, struct obstack *stack);
+                          bool allow_pad, struct obstack *stack,
+                          char const *absolute_name);
 static size_t quote_name_buf (char **inbuf, size_t bufsize, char *name,
                               struct quoting_options const *options,
                               int needs_general_quoting, size_t *width,
@@ -346,6 +353,8 @@ static size_t sorted_file_alloc;
=20
 static bool color_symlink_as_referent;
=20
+static char const *hostname;
+
 /* mode of appropriate file for colorization */
 #define FILE_OR_LINK_MODE(File) \
     ((color_symlink_as_referent && (File)->linkok) \
@@ -548,17 +557,19 @@ ARGMATCH_VERIFY (indicator_style_args, indicator_st=
yle_types);
=20
 static bool print_with_color;
=20
+static bool print_hyperlink;
+
 /* Whether we used any colors in the output so far.  If so, we will
    need to restore the default color later.  If not, we will need to
    call prep_non_filename_text before using color for the first time. */=

=20
 static bool used_color =3D false;
=20
-enum color_type
+enum when_type
   {
-    color_never,		/* 0: default or --color=3Dnever */
-    color_always,		/* 1: --color=3Dalways */
-    color_if_tty		/* 2: --color=3Dtty */
+    when_never,		/* 0: default or --color=3Dnever */
+    when_always,	/* 1: --color=3Dalways */
+    when_if_tty		/* 2: --color=3Dtty */
   };
=20
 enum Dereference_symlink
@@ -814,6 +825,7 @@ enum
   FULL_TIME_OPTION,
   GROUP_DIRECTORIES_FIRST_OPTION,
   HIDE_OPTION,
+  HYPERLINK_OPTION,
   INDICATOR_STYLE_OPTION,
   QUOTING_STYLE_OPTION,
   SHOW_CONTROL_CHARS_OPTION,
@@ -864,6 +876,7 @@ static struct option const long_options[] =3D
   {"time", required_argument, NULL, TIME_OPTION},
   {"time-style", required_argument, NULL, TIME_STYLE_OPTION},
   {"color", optional_argument, NULL, COLOR_OPTION},
+  {"hyperlink", optional_argument, NULL, HYPERLINK_OPTION},
   {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION},
   {"context", no_argument, 0, 'Z'},
   {"author", no_argument, NULL, AUTHOR_OPTION},
@@ -904,20 +917,20 @@ static enum time_type const time_types[] =3D
 };
 ARGMATCH_VERIFY (time_args, time_types);
=20
-static char const *const color_args[] =3D
+static char const *const when_args[] =3D
 {
   /* force and none are for compatibility with another color-ls version =
*/
   "always", "yes", "force",
   "never", "no", "none",
   "auto", "tty", "if-tty", NULL
 };
-static enum color_type const color_types[] =3D
+static enum when_type const when_types[] =3D
 {
-  color_always, color_always, color_always,
-  color_never, color_never, color_never,
-  color_if_tty, color_if_tty, color_if_tty
+  when_always, when_always, when_always,
+  when_never, when_never, when_never,
+  when_if_tty, when_if_tty, when_if_tty
 };
-ARGMATCH_VERIFY (color_args, color_types);
+ARGMATCH_VERIFY (when_args, when_types);
=20
 /* Information about filling a column.  */
 struct column_info
@@ -1066,6 +1079,14 @@ first_percent_b (char const *fmt)
   return NULL;
 }
=20
+static char RFC3986[256];
+static void
+file_escape_init (void)
+{
+  for (int i =3D 0; i < 256; i++)
+    RFC3986[i] |=3D c_isalnum (i) || i =3D=3D '~' || i =3D=3D '-' || i =3D=
=3D '.' || i =3D=3D '_';
+}
+
 /* Read the abbreviated month names from the locale, to align them
    and to determine the max width of the field and to truncate names
    greater than our max allowed.
@@ -1500,6 +1521,17 @@ main (int argc, char **argv)
       obstack_init (&subdired_obstack);
     }
=20
+  if (print_hyperlink)
+    {
+      file_escape_init ();
+
+      hostname =3D xgethostname ();
+      /* The hostname is generally ignored,
+         so ignore failures obtaining it.  */
+      if (! hostname)
+        hostname =3D "";
+    }
+
   cwd_n_alloc =3D 100;
   cwd_file =3D xnmalloc (cwd_n_alloc, sizeof *cwd_file);
   cwd_n_used =3D 0;
@@ -1783,6 +1815,7 @@ decode_switches (int argc, char **argv)
             format =3D (isatty (STDOUT_FILENO) ? many_per_line : one_per=
_line);
           print_block_size =3D false;	/* disable -s */
           print_with_color =3D false;	/* disable --color */
+          print_hyperlink =3D false;	/* disable --hyperlink */
           break;
=20
         case FILE_TYPE_INDICATOR_OPTION: /* --file-type */
@@ -1985,14 +2018,14 @@ decode_switches (int argc, char **argv)
           {
             int i;
             if (optarg)
-              i =3D XARGMATCH ("--color", optarg, color_args, color_type=
s);
+              i =3D XARGMATCH ("--color", optarg, when_args, when_types)=
;
             else
               /* Using --color with no argument is equivalent to using
                  --color=3Dalways.  */
-              i =3D color_always;
+              i =3D when_always;
=20
-            print_with_color =3D (i =3D=3D color_always
-                                || (i =3D=3D color_if_tty
+            print_with_color =3D (i =3D=3D when_always
+                                || (i =3D=3D when_if_tty
                                     && isatty (STDOUT_FILENO)));
=20
             if (print_with_color)
@@ -2005,6 +2038,22 @@ decode_switches (int argc, char **argv)
             break;
           }
=20
+        case HYPERLINK_OPTION:
+          {
+            int i;
+            if (optarg)
+              i =3D XARGMATCH ("--hyperlink", optarg, when_args, when_ty=
pes);
+            else
+              /* Using --hyperlink with no argument is equivalent to usi=
ng
+                 --hyperlink=3Dalways.  */
+              i =3D when_always;
+
+            print_hyperlink =3D (i =3D=3D when_always
+                               || (i =3D=3D when_if_tty
+                                   && isatty (STDOUT_FILENO)));
+            break;
+          }
+
         case INDICATOR_STYLE_OPTION:
           indicator_style =3D XARGMATCH ("--indicator-style", optarg,
                                        indicator_style_args,
@@ -2102,7 +2151,7 @@ decode_switches (int argc, char **argv)
   /* --dired is meaningful only with --format=3Dlong (-l).
      Otherwise, ignore it.  FIXME: warn about this?
      Alternatively, make --dired imply --format=3Dlong?  */
-  if (dired && format !=3D long_format)
+  if (dired && (format !=3D long_format || print_hyperlink))
     dired =3D false;
=20
   /* If -c or -u is specified and not -l (or any other option that impli=
es -l),
@@ -2715,8 +2764,18 @@ print_dir (char const *name, char const *realname,=
 bool command_line_arg)
       first =3D false;
       DIRED_INDENT ();
=20
+      char *absolute_name =3D NULL;
+      if (print_hyperlink)
+        {
+          absolute_name =3D canonicalize_filename_mode (name, CAN_MISSIN=
G);
+          if (! absolute_name)
+            file_failure (command_line_arg,
+                          _("error canonicalizing %s"), name);
+        }
       quote_name (realname ? realname : name, dirname_quoting_options, -=
1,
-                  NULL, true, &subdired_obstack);
+                  NULL, true, &subdired_obstack, absolute_name);
+
+      free (absolute_name);
=20
       DIRED_FPUTS_LITERAL (":\n", stdout);
     }
@@ -2909,6 +2968,7 @@ free_ent (struct fileinfo *f)
 {
   free (f->name);
   free (f->linkname);
+  free (f->absolute_name);
   if (f->scontext !=3D UNKNOWN_SECURITY_CONTEXT)
     {
       if (is_smack_enabled ())
@@ -3072,6 +3132,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
     }
=20
   if (command_line_arg
+      || print_hyperlink
       || format_needs_stat
       /* When coloring a directory (we may know the type from
          direct.d_type), we have to stat it in order to indicate
@@ -3110,22 +3171,31 @@ gobble_file (char const *name, enum filetype type=
, ino_t inode,
=20
     {
       /* Absolute name of this file.  */
-      char *absolute_name;
+      char *full_name;
       bool do_deref;
       int err;
=20
       if (name[0] =3D=3D '/' || dirname[0] =3D=3D 0)
-        absolute_name =3D (char *) name;
+        full_name =3D (char *) name;
       else
         {
-          absolute_name =3D alloca (strlen (name) + strlen (dirname) + 2=
);
-          attach (absolute_name, dirname, name);
+          full_name =3D alloca (strlen (name) + strlen (dirname) + 2);
+          attach (full_name, dirname, name);
+        }
+
+      if (print_hyperlink)
+        {
+          f->absolute_name =3D canonicalize_filename_mode (full_name,
+                                                         CAN_MISSING);
+          if (! f->absolute_name)
+            file_failure (command_line_arg,
+                          _("error canonicalizing %s"), full_name);
         }
=20
       switch (dereference)
         {
         case DEREF_ALWAYS:
-          err =3D stat (absolute_name, &f->stat);
+          err =3D stat (full_name, &f->stat);
           do_deref =3D true;
           break;
=20
@@ -3134,7 +3204,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
           if (command_line_arg)
             {
               bool need_lstat;
-              err =3D stat (absolute_name, &f->stat);
+              err =3D stat (full_name, &f->stat);
               do_deref =3D true;
=20
               if (dereference =3D=3D DEREF_COMMAND_LINE_ARGUMENTS)
@@ -3147,14 +3217,14 @@ gobble_file (char const *name, enum filetype type=
, ino_t inode,
                 break;
=20
               /* stat failed because of ENOENT, maybe indicating a dangl=
ing
-                 symlink.  Or stat succeeded, ABSOLUTE_NAME does not ref=
er to a
+                 symlink.  Or stat succeeded, FULL_NAME does not refer t=
o a
                  directory, and --dereference-command-line-symlink-to-di=
r is
                  in effect.  Fall through so that we call lstat instead.=
  */
             }
           FALLTHROUGH;
=20
         default: /* DEREF_NEVER */
-          err =3D lstat (absolute_name, &f->stat);
+          err =3D lstat (full_name, &f->stat);
           do_deref =3D false;
           break;
         }
@@ -3165,7 +3235,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
              an exit status of 2.  For other files, stat failure
              provokes an exit status of 1.  */
           file_failure (command_line_arg,
-                        _("cannot access %s"), absolute_name);
+                        _("cannot access %s"), full_name);
           if (command_line_arg)
             return 0;
=20
@@ -3180,13 +3250,13 @@ gobble_file (char const *name, enum filetype type=
, ino_t inode,
       /* Note has_capability() adds around 30% runtime to 'ls --color'  =
*/
       if ((type =3D=3D normal || S_ISREG (f->stat.st_mode))
           && print_with_color && is_colored (C_CAP))
-        f->has_capability =3D has_capability_cache (absolute_name, f);
+        f->has_capability =3D has_capability_cache (full_name, f);
=20
       if (format =3D=3D long_format || print_scontext)
         {
           bool have_scontext =3D false;
           bool have_acl =3D false;
-          int attr_len =3D getfilecon_cache (absolute_name, f, do_deref)=
;
+          int attr_len =3D getfilecon_cache (full_name, f, do_deref);
           err =3D (attr_len < 0);
=20
           if (err =3D=3D 0)
@@ -3210,7 +3280,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
=20
           if (err =3D=3D 0 && format =3D=3D long_format)
             {
-              int n =3D file_has_acl_cache (absolute_name, f);
+              int n =3D file_has_acl_cache (full_name, f);
               err =3D (n < 0);
               have_acl =3D (0 < n);
             }
@@ -3223,7 +3293,7 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
           any_has_acl |=3D f->acl_type !=3D ACL_T_NONE;
=20
           if (err)
-            error (0, errno, "%s", quotef (absolute_name));
+            error (0, errno, "%s", quotef (full_name));
         }
=20
       if (S_ISLNK (f->stat.st_mode)
@@ -3231,8 +3301,8 @@ gobble_file (char const *name, enum filetype type, =
ino_t inode,
         {
           struct stat linkstats;
=20
-          get_link_name (absolute_name, f, command_line_arg);
-          char *linkname =3D make_link_name (absolute_name, f->linkname)=
;
+          get_link_name (full_name, f, command_line_arg);
+          char *linkname =3D make_link_name (full_name, f->linkname);
=20
           /* Use the slower quoting path for this entry, though
              don't update CWD_SOME_QUOTED since alignment not affected. =
 */
@@ -4373,10 +4443,33 @@ quote_name_width (const char *name, struct quotin=
g_options const *options,
   return width;
 }
=20
+/* %XX escape any input out of range as defined in RFC3986,
+   and also if PATH, convert all path separators to '/'.  */
+static char *
+file_escape (const char *str, bool path)
+{
+  char *esc =3D xnmalloc (3, strlen (str) + 1);
+  char *p =3D esc;
+  while (*str)
+    {
+      if (path && ISSLASH (*str))
+        {
+          *p++ =3D '/';
+          str++;
+        }
+      else if (RFC3986[to_uchar (*str)])
+        *p++ =3D *str++;
+      else
+        p +=3D sprintf (p, "%%%02x", to_uchar (*str++));
+    }
+  *p =3D '\0';
+  return esc;
+}
+
 static size_t
 quote_name (char const *name, struct quoting_options const *options,
             int needs_general_quoting, const struct bin_str *color,
-            bool allow_pad, struct obstack *stack)
+            bool allow_pad, struct obstack *stack, char const *absolute_=
name)
 {
   char smallbuf[BUFSIZ];
   char *buf =3D smallbuf;
@@ -4392,19 +4485,44 @@ quote_name (char const *name, struct quoting_opti=
ons const *options,
   if (color)
     print_color_indicator (color);
=20
+  /* If we're padding, then don't include the outer quotes in
+     the --hyperlink, to improve the alignment of those links.  */
+  bool skip_quotes =3D false;
+
+  if (absolute_name)
+    {
+      if (align_variable_outer_quotes && cwd_some_quoted && ! pad)
+        {
+          skip_quotes =3D true;
+          putchar (*buf);
+        }
+      char *h =3D file_escape (hostname, /* path=3D */ false);
+      char *n =3D file_escape (absolute_name, /* path=3D */ true);
+      printf ("\033]8;;file://%s%s%s\a", h, *n =3D=3D '/' ? "" : "/", n)=
;
+      free (h);
+      free (n);
+    }
+
   if (stack)
     PUSH_CURRENT_DIRED_POS (stack);
=20
-  fwrite (buf, 1, len, stdout);
-
-  if (buf !=3D smallbuf && buf !=3D name)
-    free (buf);
+  fwrite (buf + skip_quotes, 1, len - skip_quotes, stdout);
=20
   dired_pos +=3D len;
=20
   if (stack)
     PUSH_CURRENT_DIRED_POS (stack);
=20
+  if (absolute_name)
+    {
+      fputs ("\033]8;;\a", stdout);
+      if (skip_quotes)
+        putchar (*(buf + len - 1));
+    }
+
+  if (buf !=3D smallbuf && buf !=3D name)
+    free (buf);
+
   return len + pad;
 }
=20
@@ -4423,7 +4541,7 @@ print_name_with_quoting (const struct fileinfo *f,
                                && (color || is_colored (C_NORM)));
=20
   size_t len =3D quote_name (name, filename_quoting_options, f->quoted,
-                           color, !symlink_target, stack);
+                           color, !symlink_target, stack, f->absolute_na=
me);
=20
   process_signals ();
   if (used_color_this_time)
@@ -5069,6 +5187,10 @@ Sort entries alphabetically if none of -cftuvSUX n=
or --sort is specified.\n\
                                (overridden by -a or -A)\n\
 "), stdout);
       fputs (_("\
+      --hyperlink[=3DWHEN]     hyperlink file names; WHEN can be 'always=
'\n\
+                               (default if omitted), 'auto', or 'never'\=
n\
+"), stdout);
+      fputs (_("\
       --indicator-style=3DWORD  append indicator with style WORD to entr=
y names:\
 \n\
                                none (default), slash (-p),\n\
diff --git a/tests/local.mk b/tests/local.mk
index fd4713d..732ec99 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -607,6 +607,7 @@ all_tests =3D					\
   tests/ls/symlink-slash.sh			\
   tests/ls/time-style-diag.sh			\
   tests/ls/x-option.sh				\
+  tests/ls/hyperlink.sh				\
   tests/mkdir/p-1.sh				\
   tests/mkdir/p-2.sh				\
   tests/mkdir/p-3.sh				\
diff --git a/tests/ls/hyperlink.sh b/tests/ls/hyperlink.sh
new file mode 100755
index 0000000..bc13311
--- /dev/null
+++ b/tests/ls/hyperlink.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+# Test --hyperlink processing
+
+# Copyright (C) 2017 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=3D.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ ls realpath
+
+hostname=3D$(hostname) || skip_ 'unable to determine hostname'
+
+# lookup based on first letter
+encode() {
+ printf '%s\n' \
+  'sp%20ace' 'ques%3ftion' 'back%5cslash' 'encoded%253Fquestion' 'testdi=
r' \
+  "$1" |
+ sort -k1,1.1 -s | uniq -w1 -d
+}
+
+ls_encoded() {
+  ef=3D$(encode "$1")
+  echo "$ef" | grep -q 'dir$' && dir=3D: || dir=3D''
+  printf '\033]8;;file://%s%s/%s\a%s\033]8;;\a%s\n' \
+    $hostname $basepath $ef "$1" "$dir"
+}
+
+mkdir testdir || framework_failure_
+basepath=3D$(realpath -m .) || framework_failure_
+(
+cd testdir
+ls_encoded "testdir" > ../exp.t || framework_failure_
+basepath=3D"$basepath/testdir"
+for f in 'back\slash' 'encoded%3Fquestion' 'ques?tion' 'sp ace'; do
+  touch "$f" || framework_failure_
+  ls_encoded "$f" >> ../exp.t || framework_failure_
+done
+)
+ln -s testdir testdirl || framework_failure_
+(cat exp.t && echo && sed 's/[^\/]testdir/&l/' exp.t) > exp \
+  || framework_failure_
+ls --hyper testdir testdirl >out || fail=3D1
+compare exp out || fail=3D1
+
+ln -s '/probably/missing' testlink || framework_failure_
+target=3D$(realpath -m testlink) || framework_failure_
+ls -l --hyper testlink > out || fail=3D1
+grep "file://.*$target" out || fail=3D1
+
+Exit $fail
--=20
2.9.3


--------------4786820EEBECBFD7511AE19A--


From MAILER-DAEMON Fri Aug 25 16:01:58 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlKnm-0007La-8x
	for mharc-coreutils@gnu.org; Fri, 25 Aug 2017 16:01:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39698)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlKnj-0007Jg-HA
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:01:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlKni-000406-LF
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:01:55 -0400
Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]:37716)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dlKni-0003xz-Fn
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:01:54 -0400
Received: by mail-it0-x229.google.com with SMTP id 77so4164158itj.0
	for <coreutils@gnu.org>; Fri, 25 Aug 2017 13:01:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=4b4m8ArfPFzOe1N0sb/oy8Uiv+zLsA/5eEQOutvwf6w=;
	b=fQeGdbBc/H46k4GWNEACk5IVlh0Bqux7cOJJTvogj+n+kYpBlss05Am4u8J07iRkfC
	3eKPZ3WzHxU27CRjv8Y93Bc1frp4FaDV0P4g7zTfVGLbHi5TowiAZlc/i0gAxwVoO7B8
	KPIsQIzScI45mx9saZRAidITijSfHyDd9rALe0HVCLL+/wnKMlj+Udip88L5BWd0Fqqo
	AKwtnowZj8ZfLjkuH1a9g+wJENKmZCE50cBXYzDrcaDrwdTzBdfJ/CvSsFQkP2UjIPZJ
	X5gGpjNaKJx8Tfwxk/T3j/QDAubAWBc3sJ5BVmrtkFZbnxBD3p07NP4vvxPq9UiMO5Fi
	XpEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=4b4m8ArfPFzOe1N0sb/oy8Uiv+zLsA/5eEQOutvwf6w=;
	b=KBECSLJcY/I/sglJ4f80AcAR78w3sBBLUJuxzTf3+IZIPu9ATWbw2Orp3bo28Yqi6M
	GV6Lo6HjZwZ2Mqd/TOk3YUi0ew+04J6PMubMEXIxr/tEwAvt8xVlbkfjHkqlDy/bK16E
	/R6cCpao7CNsizy5kqdumNDIG8dUqM9k49poI+JyX3YlbpXXj+vHkfIEBeYfbW01tYI3
	atxuiYWYQKT3fEhlDcyFYO8kSgY3Xu3Vl4YXdmVTdEGnsNlEevLMIxGx1OQ/oOI/QaXq
	rlG81tnoQ9INILqHf9eJEqVbI06PvJEHVcYKYp/rFAG2cpfB4Yr7N5UvxGczIOgFl5l6
	Cvhg==
X-Gm-Message-State: AHYfb5hjUZu4tCO/mq7hH10BA5P1A2H3i8fMwjSfub1GzoxGvSZqGDdh
	XsfLkTHqyIxQFFKUq0i5+n1d55hUV5Tl
X-Received: by 10.36.31.142 with SMTP id d136mr544262itd.168.1503691312534;
	Fri, 25 Aug 2017 13:01:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Fri, 25 Aug 2017 13:01:11 -0700 (PDT)
In-Reply-To: <08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Fri, 25 Aug 2017 22:01:11 +0200
Message-ID: <CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::229
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: Fri, 25 Aug 2017 20:01:56 -0000

Hi,

> Version 2 [...]
> ensures that URLs are aligned in padded output,

I'm not sure I like this change (the outer pair of single quotes no longer
belonging to the URL).

First, these single quotes are colored according to the file type. With
this change, coloring and URLizing became less consistent compared to each
other.

Second, there might be inner apostrophes as well, e.g. on encountering
unprintable (e.g. invalid UTF-8) bytes in the filename. These are not
nested apostrophes if I understand correctly, but similarly to bash's
syntax they are opening-closing alternatively, am I right? In which case
matching pairs aren't consistent if they're URLized or not.

Er... even worse... wait a sec...

I've created a file named latin1=C3=A1.txt in Latin-1 environment and liste=
d in
UTF-8. Without hyperlink I get

'latin1'$'\341''.txt'

which is plausible. However, with hyperlinks, I get

'latin1'$'\341''.txt''

that is, an extra apostrophe at the end, and an odd number of apostrophes
in total. And a correspondingly broken indentation of subsequent columns.
Seems like the hyperlink option erroneously adds an extra single quote.
(This is with your v2 patch, I haven't checked your v1 in this regard.)


cheers,
egmont

From MAILER-DAEMON Fri Aug 25 16:15:14 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlL0c-0003gQ-CZ
	for mharc-coreutils@gnu.org; Fri, 25 Aug 2017 16:15:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42874)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlL0a-0003gK-R5
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:15:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlL0a-0003oY-1O
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:15:12 -0400
Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:38557)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dlL0Z-0003o1-Sb
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:15:11 -0400
Received: by mail-it0-x236.google.com with SMTP id n5so4289845itb.1
	for <coreutils@gnu.org>; Fri, 25 Aug 2017 13:15:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=3BPAifFlYC4Cl9bnKokxu9Xa+KnTAwtrQcHMLVlPaa8=;
	b=XE3T+V4naz3c78X0DWNVRfAr3pw/Pk38+bw0W3g1AvJIg4QHpStPWF4GS7UoCcxF/h
	bIKeHc6G/RYZTHrTjxoVA3O/VHWEo281JrlXm8sbqSAma2bbAhirExLGUwzRrUJFKTJB
	F6TLG1uiN/GdCpL3jA37o19NEgt1AQBI9V2vij8Q9fss0vl8mIM0WCGw4zaUWAPg9BxC
	LHpMuJzn64Vuzz74rKJgdhhjve35V/DHZ56I/kJmb+Mlvb3r7g+xf6arHWXsLZkahbYa
	Vd7vShDB0HfvwXg7oCykv3GSklsloWAvXpdL+B/gYgt4UNEOoOaRMtpTSUzjFYJB/Oi4
	36dQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=3BPAifFlYC4Cl9bnKokxu9Xa+KnTAwtrQcHMLVlPaa8=;
	b=bzTZa1E/dxXc6wWb49CaNvx7D8FCQ/Lkb3o4ObmKNYg58X5wWnr2bSRhsYoi6nFfAM
	84HOsSLB6lO9mn2vpcD9u6s1SrvzeDQbiMS2ErO9Rrksz+rlb1ArNK2qd5REzfkNz/9k
	wjHboOiw1/Lxzoi9t2YiDQ5KXUmrPyaDzeZ5tGvSEXuf4cyvAm7ctVj+a+16q3PjJMUF
	doiRToKruHduz2+nUIDhqzqq78rBrXidJDfwBouegkBK2Kr2Uo0riQ3s24yzF7fOSU0G
	FqAiGCQokq/5DfLIMfEtEWONqSjhMh7OjVKxzNBZkiTVe88vZmrLL2BQYa1GUVDKtxyM
	cyFg==
X-Gm-Message-State: AHYfb5hrcc4P+QtjJ29adDhyvOgJSYIAO0Lnm38aD9L/xeavNk6pVRZP
	2NYuwEdYXvb7U5uyMe88ZTzS0NR8AQ==
X-Received: by 10.36.150.71 with SMTP id z68mr592549itd.6.1503692111096; Fri,
	25 Aug 2017 13:15:11 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Fri, 25 Aug 2017 13:14:30 -0700 (PDT)
In-Reply-To: <CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Fri, 25 Aug 2017 22:14:30 +0200
Message-ID: <CAGWcZkLcRAD4NG0TgwRWg=kEWSW2Veicu1-g2QGitMfQoV3BzA@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::236
Content-Type: text/plain; charset="UTF-8"
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: Fri, 25 Aug 2017 20:15:13 -0000

> that is, an extra apostrophe at the end, and an odd number of apostrophes
> in total. And a correspondingly broken indentation of subsequent columns.
> Seems like the hyperlink option erroneously adds an extra single quote.
> (This is with your v2 patch, I haven't checked your v1 in this regard.)
>

Interestingly,

no hyperlink (colors either on or off) => everything's okay
hyperlink but no colors => extra apostrophe, but next column's indentation
is okay
hyperlink and colors => extra apostrophe plus broken indentation


e.

From MAILER-DAEMON Fri Aug 25 16:44:42 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlLT8-0002oL-Or
	for mharc-coreutils@gnu.org; Fri, 25 Aug 2017 16:44:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48767)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlLT4-0002nt-KC
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:44:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlLT2-0000Rf-FP
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:44:38 -0400
Received: from mail-it0-x230.google.com ([2607:f8b0:4001:c0b::230]:38117)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dlLT2-0000RS-7z
	for coreutils@gnu.org; Fri, 25 Aug 2017 16:44:36 -0400
Received: by mail-it0-x230.google.com with SMTP id n5so263161itb.1
	for <coreutils@gnu.org>; Fri, 25 Aug 2017 13:44:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=b5jDfP1GOltIU/5KI9P7xpOr9PuLoHTErIzZsYMga8M=;
	b=W4uwDVSi1+W1JCubkdh64uJ0UPRREHmOpv7A6S1fBPmJOgKts7MMi7GOZPbBF9U/yO
	z3nCCCX8ZQR9mnLcpq54xBJQ2a++bCWEnIGYSvtjEIWZgaACve0bLjEVVOPnZBxeeAcQ
	PAlIeKXbZLonisyQ8M0CiSdWqa4UtPKGFOdR/7B1jz149amMG1Uyq/CtVMmSShunn6nT
	+TddsOoTzpJjEcxAp7/XbbR+nS4yi0QDJzzUgZfGL+o1K1tYFLV+eInurxvMTIOAfO1q
	bsJohld9R95tTgT7axLDEMUVlM+bMDYSz/0JHgD+FgAnQZuEzwzMsTSAmkr/qr3IdLh4
	DrtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=b5jDfP1GOltIU/5KI9P7xpOr9PuLoHTErIzZsYMga8M=;
	b=m87ivQsAIGXZ+dHInBkBjd6wXjy5np8uiDOjA5cbPKa2zoy3cLRUnHgbUZRBk6ZfrC
	GGr5zzwhLPB///bL8hPM3jTCWjcFKccvmUH/sP//2MxpOg+n50OwBSNrgShnmLRcjClg
	qUf3HbY/eZE3vPIoiLpsNCdar+ASgcyFdl6yR3+CVuZwlx4XCOe8fVehnZRD6FCDRkgR
	IrNHTVLo/EgTE9DO8mOgWuW2FfeRFFfRVpELzRokFdKgcTX5EAo+P3nk/cgu8lZJD4lE
	mS2vdIAumBPmgqlM1XIKxT5AlXJ/nIA2GweUQUr2FcX8ZQCB8Vlw7q2PsW3WM3Qrt3q5
	W67A==
X-Gm-Message-State: AHYfb5i2yX9Drp+tCon4dKuZ2QqiQjMvfX0VY2U05EKaaLyowA0sBoEC
	zSzuTy+EtqLamJAzYAQJIvPiQbi/Ng==
X-Received: by 10.36.203.65 with SMTP id u62mr668810itg.159.1503693875418;
	Fri, 25 Aug 2017 13:44:35 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Fri, 25 Aug 2017 13:43:54 -0700 (PDT)
In-Reply-To: <08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Fri, 25 Aug 2017 22:43:54 +0200
Message-ID: <CAGWcZkKoo7mhKoGUqkY-KxSPGsLyu+d60NbgaP_tYcox=yoEOw@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::230
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: Fri, 25 Aug 2017 20:44:41 -0000

Hi,

Something I've been wondering for a while, and I'm not sure what to do, so
your input is welcome:

What to do on symlinks?

In your version (and I my one too as far as I remember) the hyperlink
points to the target of the symlink. In my draft patch this was by no means
the intent, it just happened this way :)

With the simplest ls (no colors or file type), this means that turning on
the hyperlink option results in all the files getting lstat()ed. Since this
option will probably mostly be used by interactive ls commands, maybe this
price is okay to pay (and probably are enabled anyways in these cases, so
this price is already being paid). With dired and emacs integration (if
implemented one day), I'm afraid there might be a few people out there with
weird setups for whom this would be a noticeable performance regression.

It's also a weird user experience that (let's say I have an AA -> BB
symlink) executing "ls --hyperlink" prints AA, but as I mouse over,
gnome-terminal's tooltip says file://blah/blah/BB.

I'm wondering if it would make sense for the entry to URLize the symlink
itself instead. This would probably mean some more refactoring to the code,
but would probably make it more effective. Instead of lstat()ing or
realpath()ing every file of a directory, it could be done once for the
containing directory only, and each filename just appended to this path.
(Maybe even URI-escaping the directory path only once, but this might be
too much micro-optimization.)

"." and ".." need to be special cased though, plus if a filename is
explicitly present in the command line then that's another story again.

In the output of "ls -l", after the "->" sign, though, it could be the
target that's realpath()ed. This approach would make it more consistent
with coloring, since on the left of the "->" sign it's a generic symlink
color that's used, on the right it's according to the target. The two URLs
would similarly refer to the source and the target, too. (Or maybe I
wouldn't mind not hyperlinking the target.)

This is probably also the behavior that would be most robustly just doing
what's expected if the directory contents change after you've executed ls
(e.g. you modified a symlink's target), but you scroll back in your
terminal and click on an older hyperlink. You could of course say it's an
absolutely non-goal and I couldn't really argue with that. Also, since the
target of a symlink may always contain ".." components which should be
eliminated from the generated hyperlinks, and dangling symlinks even
further complicate the game, you can never guarantee for sure that you
create a URI that remains valid after the files and symlinks are modified.

As for the source of the symlink to be hyperlinked to the source entry, and
the target to the target... your call if you think it's worth it; it might
be just too much work to get all such details "right" (in a definitely
questionable definition of what's right). Or maybe just postpone it for a
while, release the current version now and improve later based on feedback.

I'd love to hear what you think about this story :)


cheers,
e.


On Fri, Aug 25, 2017 at 9:12 AM, P=C3=A1draig Brady <P@draigbrady.com> wrot=
e:

> On 21/08/17 04:28, P=C3=A1draig Brady wrote:
> > On 05/05/17 14:05, P=C3=A1draig Brady wrote:
> >> On 04/05/17 13:14, Egmont Koblinger wrote:
> >>> Hi,
> >>>
> >>> Recently two popular terminal emulators, GNOME Terminal and iTerm2
> >>> have implemented a brand new feature: explicit hyperlinks.
> >>>
> >>> Unlike the existing functionality of most terminal emulators of
> >>> automatically detecting URLs that appear on the screen, this time it'=
s
> >>> like hyperlinks on web pages: the link target is specified by the OSC
> >>> 8 escape sequence and the visible text can be an arbitrary piece of
> >>> text.
> >>>
> >>> As I've played with this feature, I found a really compelling use
> >>> case: listing files in a way that all of them are hyperlinks to
> >>> "file://...". It makes it as easy and convenient as a Ctrl+click to
> >>> open them in their preferred graphical application.
> >>>
> >>> (For even more fun, there's a pending demo patch to GNOME Terminal to
> >>> display a preview of certain local files on mouseover. We're uncertai=
n
> >>> yet if we'll finalize and ship it or not.)
> >>>
> >>> I've created a quick proof of concept patch for a new cmdline option
> >>> "ls --hyperlink=3Dalways/auto/never", have set it up in my "ls" alias=
,
> >>> and been using that happily for a few weeks now. Please find it at
> >>> https://bugzilla.gnome.org/show_bug.cgi?id=3D779734#c126. Note that i=
t
> >>> contains a couple of issues, e.g. I forgot to free some data, and it
> >>> does stupid things around symlinks. As said, it's a demo, not a fully
> >>> polished patch.
> >>>
> >>> I'd be curious to hear if you like this idea, and would be happy to
> >>> see this option appearing in mainstream coreutils.
> >>>
> >>> Please see https://gist.github.com/egmontkob/
> eb114294efbcd5adb1944c9f3cb5feda
> >>> for details about the feature.
> >>>
> >>> Let me know if you have any questions, concerns etc. (cc me, I'm not
> >>> subscribed).
> >>
> >> Interesting.
> >> This could apply to any util really that displays file names,
> >> though ls would be the most useful.
> >> Generally it also seems useful to the case where a file has a non
> representable name
> >> (well not cleanly at least without $'shell quoting').
> >
> > I've attached an implementation for ls --hyperlink.
> >
> > Some notes:
> >
> > I used canonicalize_filename_mode for consistency with other tools,
> > and to relax the canonicalization with CAN_MISSING.
> > I did this because access may be possible outside current shell context=
,
> > and also we don't want to diagnose perm issues that would
> > either not otherwise need diagnosing, or would be diagnosed
> > independently by stat() etc.
> >
> > --dired is handled appropriately, since the terminal codes
> > are similar to non displayed color codes and can be skipped similarly.
> >
> > I used more stringent escaping as per rfc3986
> > because I think there are security issues with the more lax
> > encoding described at https://gist.github.com/egmontkob/
> eb114294efbcd5adb1944c9f3cb5feda
> > and I don't see any advantage of using that more lax encoding.
> > If terminals provided a copy link functionality, or
> > the links otherwise got outside the terminal context
> > then there could be problematic handling of non encoded items.
> > For example if you didn't encode '?' and the link was passed
> > to a browser, then anything after that would be ignored.
> > Also '%' needs to be encoded for the same reasons where
> > files other than intended could be resolved.
> >
> > This should work on windows where c: is separated from the
> > hostname appropriately and '\' are converted to '/',
> > though I haven't tested there.
> >
> > I've tested with valgrind with multiple specified dirs
> > and there are no leaks.
> >
> > I was tempted to add --hyperlink to realpath, though I'm not sure it's
> needed.
> >
> > I was tempted to add a --hyperlink=3Draw option to output just the
> file://...
> > portion without the terminal codes, as older terminals highlight/proces=
s
> > those fine and they might be otherwise usefule.  Though again I wasn't
> sure.
> >
>
> Version 2 attached which fixes a small mem leak,
> ensures that URLs are aligned in padded output,
> and disables --dired with --hyperlink since it didn't work in testing
> and precluded the URL alignment method used (which excludes quotes from
> the URL).
> It might be useful to support //DIRED-OPTIONS// --hyperlink to identify
> the URI portion to emacs, but we can do that separately if useful.
>
> cheers,
> P=C3=A1draig.
>
>

From MAILER-DAEMON Fri Aug 25 21:27:49 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlPt7-0005k3-Mv
	for mharc-coreutils@gnu.org; Fri, 25 Aug 2017 21:27:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35707)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dlPt5-0005jY-0C
	for coreutils@gnu.org; Fri, 25 Aug 2017 21:27:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dlPt1-0007NL-Rn
	for coreutils@gnu.org; Fri, 25 Aug 2017 21:27:47 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:47800)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dlPt1-0007Mh-LF
	for coreutils@gnu.org; Fri, 25 Aug 2017 21:27:43 -0400
Received: from localhost.localdomain (unknown [73.93.152.143])
	(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 9584F9A1A;
	Sat, 26 Aug 2017 02:27:40 +0100 (IST)
Subject: Re: Feature request: ls --hyperlink
To: Egmont Koblinger <egmont@gmail.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <aa8b9c50-9f51-07d4-cd07-e6b7d3483410@draigBrady.com>
Date: Fri, 25 Aug 2017 18:27:38 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@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]
	[fuzzy]
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, 26 Aug 2017 01:27:48 -0000

On 25/08/17 13:01, Egmont Koblinger wrote:
> Hi,
>=20
>> Version 2 [...]
>> ensures that URLs are aligned in padded output,
>=20
> I'm not sure I like this change (the outer pair of single quotes no lon=
ger belonging to the URL).
>=20
> First, these single quotes are colored according to the file type. With=
 this change, coloring and URLizing became less consistent compared to ea=
ch other.
>=20
> Second, there might be inner apostrophes as well, e.g. on encountering =
unprintable (e.g. invalid UTF-8) bytes in the filename. These are not nes=
ted apostrophes if I understand correctly, but similarly to bash's syntax=
 they are opening-closing alternatively, am I right? In which case matchi=
ng pairs aren't consistent if they're URLized or not.
>=20
> Er... even worse... wait a sec...
>=20
> I've created a file named latin1=C3=A1.txt in Latin-1 environment and l=
isted in UTF-8. Without hyperlink I get
>=20
> 'latin1'$'\341''.txt'
>=20
> which is plausible. However, with hyperlinks, I get
>=20
> 'latin1'$'\341''.txt''
>=20
> that is, an extra apostrophe at the end, and an odd number of apostroph=
es in total. And a correspondingly broken indentation of subsequent colum=
ns. Seems like the hyperlink option erroneously adds an extra single quot=
e. (This is with your v2 patch, I haven't checked your v1 in this regard.=
)

Oops, it needs this change:

diff --git a/src/ls.c b/src/ls.c
index 9ed4913..c1e05a3 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4506,7 +4506,7 @@ quote_name (char const *name, struct quoting_option=
s const *options,
   if (stack)
     PUSH_CURRENT_DIRED_POS (stack);

-  fwrite (buf + skip_quotes, 1, len - skip_quotes, stdout);
+  fwrite (buf + skip_quotes, 1, len - (skip_quotes * 2), stdout);

   dired_pos +=3D len;

In general you may be right that I'm over engineering this.
I suppose if the terminals were sensible and only underlined upon hover
then this would be a non issue really.  I'd like to test though.
What's the handiest way for me to get a terminal to test with?
I notice that rawhide doesn't have this change yet.

Re symlinks, it's plausible to encode the link rather than the target,
but that would push the symlink resolution to the consumer
(firefox for example will resolve the symlink and change to the target in=
 the URL),
so it wouldn't gain much and may lose some control. I'll think about it.

Thanks for the careful review!
P=C3=A1draig


From MAILER-DAEMON Sat Aug 26 03:57:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlVyM-0000tU-KT
	for mharc-coreutils@gnu.org; Sat, 26 Aug 2017 03:57:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34062)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlVyK-0000rx-G4
	for coreutils@gnu.org; Sat, 26 Aug 2017 03:57:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlVyJ-0007EW-Fj
	for coreutils@gnu.org; Sat, 26 Aug 2017 03:57:36 -0400
Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]:37481)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dlVyJ-0007EG-9P
	for coreutils@gnu.org; Sat, 26 Aug 2017 03:57:35 -0400
Received: by mail-it0-x231.google.com with SMTP id 77so5101697itj.0
	for <coreutils@gnu.org>; Sat, 26 Aug 2017 00:57:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=t8qKPj7hun52U3xGVQYuabJ/TlZY1UPtzHgc5lniq9w=;
	b=VGQ0Wy3Z+XVRP7OVeXeBdiidAtVXx1VwLs7hltRGkp7F4ozKAlmCMwdN0kDVOcB9lO
	fwlpfKMdH/4uj4SEft0nWfUizcddC8FwbTUKCvwvqCkSXMvyTsQe8+Jj77FAgUuuytwA
	jHsVNCDgrIbD7tThrPJG9VWtnHl4BvnUvtq8/0aAzmRDskniIvR8v2RG2HZ2sNGmBvLg
	gVO+taBDzoaQNsTaQpXpjj4SHQ21DHnK7EQjCRzKiR9BuoRh/XT7uRfPfn2Ve6NRkJQh
	M2PpD/vZW9n2a7Yf8+nfHTs3SqzTTrSdA3DznUCUnCP8VDRsrDQOXwfT13f4ttHJ7bPX
	MknA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=t8qKPj7hun52U3xGVQYuabJ/TlZY1UPtzHgc5lniq9w=;
	b=irLDhxn8x4H07x/XQ3T+D73Oc6hn5UvSme8knwVI+4c0piKo6vpEuB0O3OKdYUFvGV
	xIBr3I5IizOFw6jV8V/pFSJdL1U6VcjCk8fq+KpVXhm2y62TkET2LyEIeiC380EtCG6P
	G5xMxNh+oX3bKCkk3nJzzV4cKBED/UtMYuRCdBGPJR3xN+udf2hVp8VUGj+Bf3ffEI/A
	NBYn850tD/TuoCQDv+VBu1p5qZ5wIJwgFfbgMNqCy8+XB77crGCIJ28dDkHx4yE7vVlQ
	4IRg+XxWOlghz90WajAK9dqCfdJ/z353Y/IXi31jeYZhR92fmMB1m3phR8UYGHZ6Y/yA
	69FQ==
X-Gm-Message-State: AHYfb5j+WFYzJFYh667aIAWZPZURhoXju1oQHBu0QPO75TAp0rL2ozj1
	6fXbWeU75kOY5fdVRUgHr+O4NAPHPw==
X-Received: by 10.107.19.78 with SMTP id b75mr1007415ioj.45.1503734254244;
	Sat, 26 Aug 2017 00:57:34 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Sat, 26 Aug 2017 00:56:53 -0700 (PDT)
In-Reply-To: <aa8b9c50-9f51-07d4-cd07-e6b7d3483410@draigBrady.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
	<aa8b9c50-9f51-07d4-cd07-e6b7d3483410@draigBrady.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Sat, 26 Aug 2017 09:56:53 +0200
Message-ID: <CAGWcZk+cMj9s16W9pxjTkZ0cj96QYunFQW1jqTOR24D=PdK18A@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::231
Content-Type: text/plain; charset="UTF-8"
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: Sat, 26 Aug 2017 07:57:37 -0000

> What's the handiest way for me to get a terminal to test with?
>

The simplest/quickest:

Get VTE from
  tarball: ftp://ftp.gnome.org/pub/GNOME/sources/vte/
or
  git clone git://git.gnome.org/vte

Compile the usual autoconf way (./configure or ./autogen.sh; make). Feel
free to pass --enable-vala=no or --disable-vala or something like this if
you're having trouble with vala.

Start as ./src/testvte -- You'll get the underlining experience, plus the
URL printed to stderr on right-click.


The full featured (with the usual gnome-terminal UI and Ctrl+click opening
the link in browser):

Carefully choose --libdir for VTE, compile and install (make install). Then
repeat the same with gnome-terminal (taking care of --prefix and
--libexecdir), making sure pkgconfig finds the new VTE. (I personally just
install both packages to the location of the distro's package, overwriting
those files. In case of unexpected unlikely trouble, the worst case I open
an xterm and reinstall the distro packages from there. Otherwise it's just
too much pain always pointing to the test version.) Then quit all
gnome-terminal windows at once and restart it (or start the server and
client with a different app-id as shown at
https://wiki.gnome.org/Apps/Terminal/Debugging (without the gdb bits)).


e.

From MAILER-DAEMON Sat Aug 26 04:11:14 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlWBW-0006i1-H6
	for mharc-coreutils@gnu.org; Sat, 26 Aug 2017 04:11:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38542)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlWBR-0006gt-SS
	for coreutils@gnu.org; Sat, 26 Aug 2017 04:11:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dlWBQ-0004N5-NF
	for coreutils@gnu.org; Sat, 26 Aug 2017 04:11:09 -0400
Received: from mail-it0-x22e.google.com ([2607:f8b0:4001:c0b::22e]:37963)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dlWBQ-0004Mp-Ga
	for coreutils@gnu.org; Sat, 26 Aug 2017 04:11:08 -0400
Received: by mail-it0-x22e.google.com with SMTP id n5so5228225itb.1
	for <coreutils@gnu.org>; Sat, 26 Aug 2017 01:11:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=zQAIt6EGRtczyivv9o2USX5Qf2RE3wFMg+cNaPlMclM=;
	b=eQfDphAqy8sJzWFv/T1DbDVvRTAX6FBM/8g9t7Ff7qB23oJTzQ3DK8yMR1o0fH19L9
	qPO5qjXgn0ysQP6EmG3X7RWH7dSBhHaoT4WrG2g40HcfKP1zCyNG6qpbu+nYkMDmxK9T
	EAVhXPxGsBpMlEsrdiwOZhqMZGzVmHBPxoBy1X2LogO1+K1OKRNE7s+9o+uJaIjm3ZmO
	1e73hcqLDwjZbAkkqutav5tJSLLI/MIXqiis5wbQx4sxOffnLY5WiBWYc2Xa6DfOvpLk
	Gm4u57O8saaXmv/dfrxmbmq4Uc2yqhYWI9wwvPAjqPpdNnrYlEeWvKS3ki4C3ll7wcGx
	tTFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=zQAIt6EGRtczyivv9o2USX5Qf2RE3wFMg+cNaPlMclM=;
	b=k9Tk/TGIX0zOI19Oj0Vo1Lm+g3/TWrkJ2S8OVZSuI6HNx8UbjjmfkxhyvbZasc1X0g
	oMJiWyjWesPmDjAhBwDoIWRO4xUVaiSTqJcrAMJjkSEzPID9XkvY4BKwlaEgSc9QGMb3
	AGkkgJuYcc1GKcv63bO8PW1cniwvePFaonLPow0UebaaD5WF45+k8zuT4tptQZg0beMW
	gbNHgeSFOSmFzbOcHjQVwT/XVbKJtpJZzU+IovYrD6LYucOF3QWkzDkNtzsMH/FQ0UIm
	w4J7Cyo5dCLLTcKUq/DxeGuYY5yLvuYUvyLP8ZrujG4SxlW8+qiH3RPdhimM7+JNgfZu
	JXyA==
X-Gm-Message-State: AHYfb5hPg2TWmqsoGa+Dt4JIw2jqPF8pQR2JFdiYRedM476Qj6gsxUAR
	Jd3MRE1O3ubVtGvYRr4s5wTBMqWOtg==
X-Received: by 10.107.17.133 with SMTP id 5mr744402ior.33.1503735067930; Sat,
	26 Aug 2017 01:11:07 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Sat, 26 Aug 2017 01:10:27 -0700 (PDT)
In-Reply-To: <CAGWcZk+cMj9s16W9pxjTkZ0cj96QYunFQW1jqTOR24D=PdK18A@mail.gmail.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
	<aa8b9c50-9f51-07d4-cd07-e6b7d3483410@draigBrady.com>
	<CAGWcZk+cMj9s16W9pxjTkZ0cj96QYunFQW1jqTOR24D=PdK18A@mail.gmail.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Sat, 26 Aug 2017 10:10:27 +0200
Message-ID: <CAGWcZkL0SthhcJfyPU2Wvd7xMV4P5v2xc0D+spsJxTMr=FSaMQ@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::22e
Content-Type: text/plain; charset="UTF-8"
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: Sat, 26 Aug 2017 08:11:14 -0000

... Or, if you're familiar with quickly recompiling RPMs from .spec files,
it's most likely as simple as bumping the version number in the vte291 and
then gnome-terminal packages.

e.

On Sat, Aug 26, 2017 at 9:56 AM, Egmont Koblinger <egmont@gmail.com> wrote:

>
> What's the handiest way for me to get a terminal to test with?
>>
>
> The simplest/quickest:
>
> Get VTE from
>   tarball: ftp://ftp.gnome.org/pub/GNOME/sources/vte/
> or
>   git clone git://git.gnome.org/vte
>
> Compile the usual autoconf way (./configure or ./autogen.sh; make). Feel
> free to pass --enable-vala=no or --disable-vala or something like this if
> you're having trouble with vala.
>
> Start as ./src/testvte -- You'll get the underlining experience, plus the
> URL printed to stderr on right-click.
>
>
> The full featured (with the usual gnome-terminal UI and Ctrl+click opening
> the link in browser):
>
> Carefully choose --libdir for VTE, compile and install (make install).
> Then repeat the same with gnome-terminal (taking care of --prefix and
> --libexecdir), making sure pkgconfig finds the new VTE. (I personally just
> install both packages to the location of the distro's package, overwriting
> those files. In case of unexpected unlikely trouble, the worst case I open
> an xterm and reinstall the distro packages from there. Otherwise it's just
> too much pain always pointing to the test version.) Then quit all
> gnome-terminal windows at once and restart it (or start the server and
> client with a different app-id as shown at https://wiki.gnome.org/Apps/
> Terminal/Debugging (without the gdb bits)).
>
>
> e.
>

From MAILER-DAEMON Sat Aug 26 16:56:28 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dli84-000059-46
	for mharc-coreutils@gnu.org; Sat, 26 Aug 2017 16:56:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41002)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlfXX-0008FM-QF
	for coreutils@gnu.org; Sat, 26 Aug 2017 14:10:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlfXU-0000FQ-Ji
	for coreutils@gnu.org; Sat, 26 Aug 2017 14:10:35 -0400
Received: from b-painless.mh.aa.net.uk ([81.187.30.52]:52513)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <cjwatson@debian.org>) id 1dlfXU-0000FF-9P
	for coreutils@gnu.org; Sat, 26 Aug 2017 14:10:32 -0400
Received: from
	3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa
	([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org)
	by b-painless.mh.aa.net.uk with esmtps
	(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
	(envelope-from <cjwatson@debian.org>) id 1dlfXT-0007bu-Gi
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:10:31 +0100
Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org)
	by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89)
	(envelope-from <cjwatson@debian.org>) id 1dlfXQ-0004hx-Cl
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:10:28 +0100
Date: Sat, 26 Aug 2017 19:10:28 +0100
From: Colin Watson <cjwatson@debian.org>
To: coreutils@gnu.org
Subject: New utility suggestion: chdir(1)
Message-ID: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 81.187.30.52
X-Mailman-Approved-At: Sat, 26 Aug 2017 16:56:27 -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: Sat, 26 Aug 2017 18:10:36 -0000

I would like there to be an adverbial version of "cd", which takes a
path followed by a command and optional arguments and executes the
command with its working directory set to the given path.  Its
invocation would be similar to chroot(8), that is:

  chdir [OPTION] NEWDIR [COMMAND [ARG]...]

This would allow these two commands to be synonyms aside from a
different arrangement of processes:

  (cd /foo && ls -l)
  chdir /foo ls -l


Why do I want this when there's a perfectly good shell builtin?  Well, I
often find that I want to write programs that take an argument list and
run them in various different contexts, for example in a chroot (using
"chroot") or in a container (using "lxc exec").  Unless the
context-entering command has an option to set the current directory -
neither of the two aforementioned examples does - I have to do this by
writing something along the lines of:

  sudo chroot /path/to/chroot sh -c 'cd /foo && ls -l'

This means dealing with shell quoting, which is tedious and error-prone.
It would be much easier if I had something that composed nicely with
other programs that use this kind of pattern for running a child process
in some different context:

  sudo chroot /path/to/chroot chdir /foo ls -l


If people think this is a reasonable idea then I'd be happy to write the
code, although I'd have to faff around with getting my employer to sign
a copyright assignment.  I'm aware that (as far as I know) this is an
innovation rather than something that other operating systems already
implement; I think my suggested name is the most natural choice by
analogy with the system call and chroot(8).


Thanks,

-- 
Colin Watson                                       [cjwatson@debian.org]


From MAILER-DAEMON Sat Aug 26 16:56:32 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dli84-00005W-Tg
	for mharc-coreutils@gnu.org; Sat, 26 Aug 2017 16:56:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42756)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlfjn-00043m-Tn
	for coreutils@gnu.org; Sat, 26 Aug 2017 14:23:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlfjk-0004lS-Ns
	for coreutils@gnu.org; Sat, 26 Aug 2017 14:23:15 -0400
Received: from b-painless.mh.aa.net.uk ([81.187.30.52]:33734)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <cjwatson@debian.org>) id 1dlfjk-0004l0-G7
	for coreutils@gnu.org; Sat, 26 Aug 2017 14:23:12 -0400
Received: from
	3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa
	([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org)
	by b-painless.mh.aa.net.uk with esmtps
	(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
	(envelope-from <cjwatson@debian.org>) id 1dlfjj-0007oC-2v
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:23:11 +0100
Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org)
	by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89)
	(envelope-from <cjwatson@debian.org>) id 1dlfji-0004uO-7m
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:23:10 +0100
Date: Sat, 26 Aug 2017 19:23:10 +0100
From: Colin Watson <cjwatson@debian.org>
To: coreutils@gnu.org
Subject: Re: New utility suggestion: chdir(1)
Message-ID: <20170826182310.h2q67oln6ghey4yk@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 81.187.30.52
X-Mailman-Approved-At: Sat, 26 Aug 2017 16:56:27 -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: Sat, 26 Aug 2017 18:23:17 -0000

Incidentally, here's a simplified excerpt of Python code from a project
I maintain at my day job (https://launchpad.net/launchpad-buildd) which
could benefit from this, and also illustrates chaining the similar
env(1) as well:


import re
import subprocess


non_meta_re = re.compile(r'^[a-zA-Z0-9+,./:=@_-]+$')

def shell_escape(arg):
    if non_meta_re.match(arg):
        return arg
    else:
        return "'%s'" % arg.replace("'", "'\\''")

def run_build_command(chroot_path, args, env=None):
    """Run a build command in the chroot.

    This is unpleasant because we need to run it in /build under sudo
    chroot, and there's no way to do this without either a helper
    program in the chroot or unpleasant quoting.  We go for the
    unpleasant quoting.
    """
    args = [shell_escape(arg) for arg in args]
    if env:
        args = (
            ["env"] +
            ["%s=%s" % (key, shell_escape(value))
             for key, value in env.items()] +
            args)
    command = "cd /build && %s" % " ".join(args)
    subprocess.check_call(
        ["sudo", "chroot", chroot_path, "/bin/sh", "-c", command])


With chdir(1), this would become something like:


def run_build_command(chroot_path, args, env=None):
    """Run a build command in the chroot."""
    if env:
        args = (
            ["env"] +
            ["%s=%s" % (key, value) for key, value in env.items()] +
            args)
    subprocess.check_call(
        ["sudo", "chroot", chroot_path, "chdir", "/build"] + args)

-- 
Colin Watson                                       [cjwatson@debian.org]


From MAILER-DAEMON Sat Aug 26 19:00:22 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlk3y-0000wn-FJ
	for mharc-coreutils@gnu.org; Sat, 26 Aug 2017 19:00:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39160)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dlk3w-0000uw-0e
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:00:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dlk3s-0004QR-W9
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:00:20 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:41184)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dlk3s-0004Q7-Ps
	for coreutils@gnu.org; Sat, 26 Aug 2017 19:00:16 -0400
Received: from localhost.localdomain (unknown [73.93.153.7])
	(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 CFFD14A78;
	Sun, 27 Aug 2017 00:00:13 +0100 (IST)
Subject: Re: New utility suggestion: chdir(1)
To: Colin Watson <cjwatson@debian.org>, coreutils@gnu.org
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
Date: Sat, 26 Aug 2017 16:00:11 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
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]
	[fuzzy]
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, 26 Aug 2017 23:00:21 -0000

On 26/08/17 11:10, Colin Watson wrote:
> I would like there to be an adverbial version of "cd", which takes a
> path followed by a command and optional arguments and executes the
> command with its working directory set to the given path.  Its
> invocation would be similar to chroot(8), that is:
>=20
>   chdir [OPTION] NEWDIR [COMMAND [ARG]...]
>=20
> This would allow these two commands to be synonyms aside from a
> different arrangement of processes:
>=20
>   (cd /foo && ls -l)
>   chdir /foo ls -l
>=20
>=20
> Why do I want this when there's a perfectly good shell builtin?  Well, =
I
> often find that I want to write programs that take an argument list and
> run them in various different contexts, for example in a chroot (using
> "chroot") or in a container (using "lxc exec").  Unless the
> context-entering command has an option to set the current directory -
> neither of the two aforementioned examples does - I have to do this by
> writing something along the lines of:
>=20
>   sudo chroot /path/to/chroot sh -c 'cd /foo && ls -l'
>=20
> This means dealing with shell quoting, which is tedious and error-prone=
.
> It would be much easier if I had something that composed nicely with
> other programs that use this kind of pattern for running a child proces=
s
> in some different context:
>=20
>   sudo chroot /path/to/chroot chdir /foo ls -l
>=20
>=20
> If people think this is a reasonable idea then I'd be happy to write th=
e
> code, although I'd have to faff around with getting my employer to sign
> a copyright assignment.  I'm aware that (as far as I know) this is an
> innovation rather than something that other operating systems already
> implement; I think my suggested name is the most natural choice by
> analogy with the system call and chroot(8).

If we were to provide this I think chdir is a fine name.
It's a pity we have to have this heavy weight chaining of execs like this
to set each process attribute. This is more general though, than adding
--chdir to other "context" type programs like chroot etc.
Note GNU chroot has a --skip-chdir which nearly does what you want.
I.E. you could os.chdir("/chroot/build") before calling "chroot --skip-di=
r ...",
however that's currently restricted for greater protection to when
you're not actually changing the root directory.  I suppose we could rela=
x
the check to verify that getcwd() was _below_ the specified chroot path.
Of course none of this helps with jexec, lxc etc.

Another option to consider is to add --chdir to env(1) since they
would often be used together and could be done more efficiently with a si=
ngle exec?

cheers,
P=E1draig.



From MAILER-DAEMON Sat Aug 26 21:23:50 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlmIo-00035t-Jn
	for mharc-coreutils@gnu.org; Sat, 26 Aug 2017 21:23:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50569)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dlmIm-00035b-L2
	for coreutils@gnu.org; Sat, 26 Aug 2017 21:23:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dlmIj-0003EN-I3
	for coreutils@gnu.org; Sat, 26 Aug 2017 21:23:48 -0400
Received: from smtp-out-no.shaw.ca ([64.59.134.9]:59309)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <962-396-1872@kylheku.com>)
	id 1dlmIj-0003CJ-CS
	for coreutils@gnu.org; Sat, 26 Aug 2017 21:23:45 -0400
Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP
	id lmIXd4oGBM9gtlmIYd7EtX; Sat, 26 Aug 2017 19:23:35 -0600
X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0
	a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17
	a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=KeKAF7QvOSUA:10
	a=f6DEvRuBHW7yoSg7qMIA:9 a=QEXdDO2ut3YA:10
Received: from www-data by kylheku.com with local (Exim 4.72)
	(envelope-from <962-396-1872@kylheku.com>)
	id 1dlmIX-0002It-Lz; Sat, 26 Aug 2017 18:23:33 -0700
To: Colin Watson <cjwatson@debian.org>
Subject: Re: New utility suggestion: chdir(1)
X-PHP-Originating-Script: 501:rcmail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: quoted-printable
Date: Sat, 26 Aug 2017 18:23:33 -0700
From: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
Cc: coreutils@gnu.org
In-Reply-To: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
Message-ID: <23f9a5863061545f050e0ecdf36373a1@mail.kylheku.com>
X-Sender: 962-396-1872@kylheku.com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfAbub2T4JhvuomesiUuyV3BYOor5yPJ7V4PQLLmc3pU59bgBy91GHQEyIm4rxtuh7kUYhFDj32HzPtNCg2wLQyUPp+dd+JMX5Z77xxRDBwhzFw6hD31w
	FuOYKjNJsd6+wcsYuPK4iOXb5B9qu9DNDZnsShX4GIDATSL+ZcnRyYt1GIhoBeNcPKPwGGGW8fGAW8SrUAYJkYRKZePvLkj26IY=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 64.59.134.9
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, 27 Aug 2017 01:23:49 -0000

On 26.08.2017 11:10, Colin Watson wrote:
>   sudo chroot /path/to/chroot sh -c 'cd /foo && ls -l'

The -c option is not the only way to pass a script to the shell.

You can also pipe it in.

> This means dealing with shell quoting, which is tedious and=20
> error-prone.

    sh <<'end'
    echo 'hello, world'
    end



From MAILER-DAEMON Sun Aug 27 03:14:53 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlrmX-0007lc-Ec
	for mharc-coreutils@gnu.org; Sun, 27 Aug 2017 03:14:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45955)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlrmV-0007l9-At
	for coreutils@gnu.org; Sun, 27 Aug 2017 03:14:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlrmS-0002KP-5Y
	for coreutils@gnu.org; Sun, 27 Aug 2017 03:14:51 -0400
Received: from a-painless.mh.aa.net.uk ([81.187.30.51]:59561)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <cjwatson@debian.org>) id 1dlrmR-0002KJ-Vy
	for coreutils@gnu.org; Sun, 27 Aug 2017 03:14:48 -0400
Received: from
	3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa
	([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org)
	by a-painless.mh.aa.net.uk with esmtps
	(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
	(envelope-from <cjwatson@debian.org>)
	id 1dlrmR-0005eD-4r; Sun, 27 Aug 2017 08:14:47 +0100
Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org)
	by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89)
	(envelope-from <cjwatson@debian.org>)
	id 1dlrmM-0001gg-MY; Sun, 27 Aug 2017 08:14:42 +0100
Date: Sun, 27 Aug 2017 08:14:42 +0100
From: Colin Watson <cjwatson@debian.org>
To: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
Cc: coreutils@gnu.org
Subject: Re: New utility suggestion: chdir(1)
Message-ID: <20170827071442.xck2rb6qjrkfunom@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<23f9a5863061545f050e0ecdf36373a1@mail.kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <23f9a5863061545f050e0ecdf36373a1@mail.kylheku.com>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 81.187.30.51
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, 27 Aug 2017 07:14:52 -0000

On Sat, Aug 26, 2017 at 06:23:33PM -0700, Kaz Kylheku (Coreutils) wrote:
> On 26.08.2017 11:10, Colin Watson wrote:
> >   sudo chroot /path/to/chroot sh -c 'cd /foo && ls -l'
> 
> The -c option is not the only way to pass a script to the shell.
> 
> You can also pipe it in.
> 
> > This means dealing with shell quoting, which is tedious and error-prone.
> 
>    sh <<'end'
>    echo 'hello, world'
>    end

I don't really want to derail too much into this kind of thing, but
let's just say that this approach still requires dealing with shell
quoting, just in a slightly different way.  Any time your approach
involves composing input to the shell from caller-supplied data, you
have to make sure that the shell is going to decompose that in the way
that you want, regardless of how you then arrange for the shell to
actually read that input.  Your example above contains a manually-quoted
argument to echo, which is all very well when you're dealing with a
single command constructed by hand; if you were writing a general
wrapper function that takes arbitrary command+argument lists then you'd
see what I meant.

If you're using "sh -c", then you need a *second* layer of quoting to
ensure that the argument stays in one piece, and if the calling language
is shell then that's going to be shell quoting.  Piping a script into
the shell avoids this layer of quoting, yes, but (1) that's not very
interesting when the calling language is something with a good list
syntax for invoking subprocesses, (2) it doesn't remove the need for the
first layer of quoting, and (3) it makes it cumbersome to supply data to
the subsidiary program's standard input (yes, I know it can be done if
you try hard enough).

In any case, I'm really not looking for help with shell quoting here,
but rather suggesting a way to avoid the issue together.  A good general
rule of thumb in my experience is that robust code that invokes
subsidiary programs should try to do so without introducing intermediate
shells if it possibly can.

-- 
Colin Watson                                       [cjwatson@debian.org]


From MAILER-DAEMON Sun Aug 27 03:23:53 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dlrvF-0000cH-9g
	for mharc-coreutils@gnu.org; Sun, 27 Aug 2017 03:23:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46462)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlrvA-0000bu-BL
	for coreutils@gnu.org; Sun, 27 Aug 2017 03:23:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dlrv6-0006UV-LY
	for coreutils@gnu.org; Sun, 27 Aug 2017 03:23:48 -0400
Received: from b-painless.mh.aa.net.uk ([81.187.30.52]:49419)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <cjwatson@debian.org>) id 1dlrv6-0006UK-6n
	for coreutils@gnu.org; Sun, 27 Aug 2017 03:23:44 -0400
Received: from
	3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa
	([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org)
	by b-painless.mh.aa.net.uk with esmtps
	(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
	(envelope-from <cjwatson@debian.org>)
	id 1dlrv4-0007K4-NV; Sun, 27 Aug 2017 08:23:43 +0100
Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org)
	by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89)
	(envelope-from <cjwatson@debian.org>)
	id 1dlrv2-0001ra-FM; Sun, 27 Aug 2017 08:23:40 +0100
Date: Sun, 27 Aug 2017 08:23:40 +0100
From: Colin Watson <cjwatson@debian.org>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org
Subject: Re: New utility suggestion: chdir(1)
Message-ID: <20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="35htslefcfqp27vo"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 81.187.30.52
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, 27 Aug 2017 07:23:51 -0000


--35htslefcfqp27vo
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

On Sat, Aug 26, 2017 at 04:00:11PM -0700, Pádraig Brady wrote:
> If we were to provide this I think chdir is a fine name.
> It's a pity we have to have this heavy weight chaining of execs like this
> to set each process attribute. This is more general though, than adding
> --chdir to other "context" type programs like chroot etc.
> Note GNU chroot has a --skip-chdir which nearly does what you want.
> I.E. you could os.chdir("/chroot/build") before calling "chroot --skip-dir ...",
> however that's currently restricted for greater protection to when
> you're not actually changing the root directory.  I suppose we could relax
> the check to verify that getcwd() was _below_ the specified chroot path.
> Of course none of this helps with jexec, lxc etc.

Indeed; I really want something composable rather than playing
whack-a-mole with every possible wrapper command.

> Another option to consider is to add --chdir to env(1) since they
> would often be used together and could be done more efficiently with a single exec?

That's a good idea, and I agree they're often used together.  I'd
already slipped and implemented chdir(1), but I think that suggestion
may be better: it results in a much shorter patch, and it avoids the
problem with some shells (e.g. zsh) implementing their own "chdir"
built-ins with different semantics.

I've attached both patches; my preference following Pádraig's suggestion
is the second one ("env: add --chdir option"), but I'd be happy either
way.

If either of these requires a copyright assignment and I don't have one
on file for coreutils, then I'd appreciate it if a maintainer could get
the ball rolling on the necessary paperwork.

Thanks,

-- 
Colin Watson                                       [cjwatson@debian.org]

--35htslefcfqp27vo
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-chdir-new-command-to-run-command-with-changed-CWD.patch"

>From ebe4e313994059ef0c3b98c1c86b0137538e9604 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 27 Aug 2017 00:14:06 +0100
Subject: [PATCH] chdir: new command to run command with changed CWD

* AUTHORS: Add my name.
* NEWS: Add new binary.
* README: Likewise.
* build-aux/gen-lists-of-programs.sh: Likewise.
* scripts/git-hooks/commit-msg: Likewise.
* doc/coreutils.texi (chdir invocation): Document the new program.
* man/chdir.x: New template.
* man/local.mk: Reference new template.
* po/POTFILES.in: Add src/chdir.c.
* src/.gitignore: Ignore chdir.
* src/chdir.c: New file.
* src/local.mk (src_chdir_LDADD): New variable.
* tests/misc/chdir.sh: New file.
* tests/local.mk (all_tests): Add tests/misc/chdir.sh.
* tests/misc/help-version.sh: Handle expected chdir exit code and setup
requirements.
* tests/misc/invalid-opt.pl: Handle expected chdir exit code.
---
 AUTHORS                            |   1 +
 NEWS                               |   4 ++
 README                             |   6 +-
 build-aux/gen-lists-of-programs.sh |   1 +
 doc/coreutils.texi                 |  63 ++++++++++++++++--
 man/chdir.x                        |   6 ++
 man/local.mk                       |   1 +
 po/POTFILES.in                     |   1 +
 scripts/git-hooks/commit-msg       |   6 +-
 src/.gitignore                     |   1 +
 src/chdir.c                        | 132 +++++++++++++++++++++++++++++++++++++
 src/local.mk                       |   1 +
 tests/local.mk                     |   1 +
 tests/misc/chdir.sh                |  35 ++++++++++
 tests/misc/help-version.sh         |   2 +
 tests/misc/invalid-opt.pl          |   1 +
 16 files changed, 252 insertions(+), 10 deletions(-)
 create mode 100644 man/chdir.x
 create mode 100644 src/chdir.c
 create mode 100644 tests/misc/chdir.sh

diff --git a/AUTHORS b/AUTHORS
index 93d547b..fbf92b8 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,6 +8,7 @@ base64: Simon Josefsson
 basename: David MacKenzie
 cat: Torbjorn Granlund, Richard M. Stallman
 chcon: Russell Coker, Jim Meyering
+chdir: Colin Watson
 chgrp: David MacKenzie, Jim Meyering
 chmod: David MacKenzie, Jim Meyering
 chown: David MacKenzie, Jim Meyering
diff --git a/NEWS b/NEWS
index d37195e..c7b49e6 100644
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,10 @@ GNU coreutils NEWS                                    -*- outline -*-
   expr now returns number of characters matched (instead of incorrect
   number of bytes matched) with 'match'/':' operators on multibyte strings.
 
+** New programs
+
+  chdir: Run command or shell with changed working directory.
+
 ** New features
 
   expand and unexpand now support specifying an offset for tab stops
diff --git a/README b/README
index 5cb90d3..5cfd228 100644
--- a/README
+++ b/README
@@ -7,9 +7,9 @@ arbitrary limits.
 
 The programs that can be built with this package are:
 
-  [ arch b2sum base32 base64 basename cat chcon chgrp chmod chown chroot cksum
-  comm coreutils cp csplit cut date dd df dir dircolors dirname du echo env
-  expand expr factor false fmt fold groups head hostid hostname id install
+  [ arch b2sum base32 base64 basename cat chcon chdir chgrp chmod chown chroot
+  cksum comm coreutils cp csplit cut date dd df dir dircolors dirname du echo
+  env expand expr factor false fmt fold groups head hostid hostname id install
   join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl
   nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd
   readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum
diff --git a/build-aux/gen-lists-of-programs.sh b/build-aux/gen-lists-of-programs.sh
index cdbcd0a..59ac692 100755
--- a/build-aux/gen-lists-of-programs.sh
+++ b/build-aux/gen-lists-of-programs.sh
@@ -48,6 +48,7 @@ normal_progs='
     basename
     cat
     chcon
+    chdir
     chgrp
     chmod
     chown
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8f1cb4c..8c1d5eb 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -43,6 +43,7 @@
 * basename: (coreutils)basename invocation.     Strip directory and suffix.
 * cat: (coreutils)cat invocation.               Concatenate and write files.
 * chcon: (coreutils)chcon invocation.           Change SELinux CTX of files.
+* chdir: (coreutils)chdir invocation.           Specify the working directory.
 * chgrp: (coreutils)chgrp invocation.           Change file groups.
 * chmod: (coreutils)chmod invocation.           Change access permissions.
 * chown: (coreutils)chown invocation.           Change file owners and groups.
@@ -204,7 +205,7 @@ Free Documentation License''.
 * User information::             id logname whoami groups users who
 * System context::               date arch nproc uname hostname hostid uptime
 * SELinux context::              chcon runcon
-* Modified command invocation::  chroot env nice nohup stdbuf timeout
+* Modified command invocation::  chdir chroot env nice nohup stdbuf timeout
 * Process control::              kill
 * Delaying::                     sleep
 * Numeric operations::           factor numfmt seq
@@ -446,6 +447,7 @@ SELinux context
 
 Modified command invocation
 
+* chdir invocation::             Run a command in a different working directory
 * chroot invocation::            Run a command with a different root directory
 * env invocation::               Run a command in a modified environment
 * nice invocation::              Run a command with modified niceness
@@ -813,9 +815,10 @@ However, some of the programs documented here do produce
 other exit status values and a few associate different
 meanings with the values @samp{0} and @samp{1}.
 Here are some of the exceptions:
-@command{chroot}, @command{env}, @command{expr}, @command{nice},
-@command{nohup}, @command{numfmt}, @command{printenv}, @command{sort},
-@command{stdbuf}, @command{test}, @command{timeout}, @command{tty}.
+@command{chdir}, @command{chroot}, @command{env}, @command{expr},
+@command{nice}, @command{nohup}, @command{numfmt}, @command{printenv},
+@command{sort}, @command{stdbuf}, @command{test}, @command{timeout},
+@command{tty}.
 
 
 @node Backup options
@@ -16648,6 +16651,7 @@ different than the current one: a modified environment, as a different
 user, etc.
 
 @menu
+* chdir invocation::            Modify the working directory.
 * chroot invocation::           Modify the root directory.
 * env invocation::              Modify environment variables.
 * nice invocation::             Modify niceness.
@@ -16657,6 +16661,57 @@ user, etc.
 @end menu
 
 
+@node chdir invocation
+@section @command{chdir}: Run a command in a different working directory
+
+@pindex chdir
+@cindex running a program in a specified working directory
+@cindex working directory, running a program in a specified
+
+@command{chdir} runs a command with a specified working directory.  Synopses:
+
+@example
+chdir @var{option} @var{newdir} [@var{command} [@var{args}]@dots{}]
+chdir @var{option}
+@end example
+
+This command differs from the shell built-in @command{cd} in that it starts
+@var{command} as a subprocess rather than altering the shell's own working
+directory; this allows it to be chained with other commands that run commands
+in a different context.  For example:
+
+@example
+# Run 'true' with /chroot as its root directory and /srv as its working
+# directory.
+chroot /chroot chdir /srv true
+# Run 'true' with /build as its working directory and FOO=bar in its
+# environment.
+chdir /build env FOO=bar true
+@end example
+
+If @var{command} is not specified, the default is the value of the @env{SHELL}
+environment variable or @command{/bin/sh} if not set, invoked with the
+@option{-i} option.
+@var{command} must not be a special built-in utility (@pxref{Special built-in
+utilities}).
+
+@c zsh has chdir as a synonym for cd
+@mayConflictWithShellBuiltIn{chdir}
+
+The only options are @option{--help} and @option{--version}.  @xref{Common
+options}.  Options must precede operands.
+
+@cindex exit status of @command{chdir}
+Exit status:
+
+@display
+125 if @command{chdir} itself fails
+126 if @var{command} is found but cannot be invoked
+127 if @var{command} cannot be found
+the exit status of @var{command} otherwise
+@end display
+
+
 @node chroot invocation
 @section @command{chroot}: Run a command with a different root directory
 
diff --git a/man/chdir.x b/man/chdir.x
new file mode 100644
index 0000000..ee591f0
--- /dev/null
+++ b/man/chdir.x
@@ -0,0 +1,6 @@
+[NAME]
+chdir \- run command or interactive shell with changed working directory
+[DESCRIPTION]
+.\" Add any additional description here
+[SEE ALSO]
+chdir(2)
diff --git a/man/local.mk b/man/local.mk
index 4b98bfd..e7ab51a 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -66,6 +66,7 @@ man/base64.1:    src/base64$(EXEEXT)
 man/basename.1:  src/basename$(EXEEXT)
 man/cat.1:       src/cat$(EXEEXT)
 man/chcon.1:     src/chcon$(EXEEXT)
+man/chdir.1:     src/chdir$(EXEEXT)
 man/chgrp.1:     src/chgrp$(EXEEXT)
 man/chmod.1:     src/chmod$(EXEEXT)
 man/chown.1:     src/chown$(EXEEXT)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e4fcdbf..9dd9d93 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -37,6 +37,7 @@ src/base64.c
 src/basename.c
 src/cat.c
 src/chcon.c
+src/chdir.c
 src/chgrp.c
 src/chmod.c
 src/chown-core.c
diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg
index 6aedf80..a1d4d44 100755
--- a/scripts/git-hooks/commit-msg
+++ b/scripts/git-hooks/commit-msg
@@ -14,9 +14,9 @@ $editor = "vi" if $? != 0 or $editor =~ /^\s*\z/;
 # Keywords allowed before the colon on the first line of a commit message:
 # program names and a few general category names.
 my @valid = qw(
-    arch b2sum base32 base64 basename cat chcon chgrp chmod chown chroot cksum
-    comm cp csplit cut date dd df dir dircolors dirname du echo env expand
-    expr factor false fmt fold groups head hostid hostname id install
+    arch b2sum base32 base64 basename cat chcon chdir chgrp chmod chown chroot
+    cksum comm cp csplit cut date dd df dir dircolors dirname du echo env
+    expand expr factor false fmt fold groups head hostid hostname id install
     join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
     mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf
     ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
diff --git a/src/.gitignore b/src/.gitignore
index 70ab2ca..e3c4072 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -8,6 +8,7 @@ base64
 basename
 cat
 chcon
+chdir
 chgrp
 chmod
 chown
diff --git a/src/chdir.c b/src/chdir.c
new file mode 100644
index 0000000..07210cd
--- /dev/null
+++ b/src/chdir.c
@@ -0,0 +1,132 @@
+/* chdir -- run command or shell with changed working directory
+   Copyright (C) 2017 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/>.  */
+
+/* Written by Colin Watson.  */
+
+#include <config.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <pwd.h>
+#include <grp.h>
+
+#include "system.h"
+#include "die.h"
+#include "error.h"
+#include "quote.h"
+
+/* The official name of this program (e.g., no 'g' prefix).  */
+#define PROGRAM_NAME "chdir"
+
+#define AUTHORS proper_name ("Colin Watson")
+
+static struct option const long_opts[] =
+{
+  {GETOPT_HELP_OPTION_DECL},
+  {GETOPT_VERSION_OPTION_DECL},
+  {NULL, 0, NULL, 0}
+};
+
+void
+usage (int status)
+{
+  if (status != EXIT_SUCCESS)
+    emit_try_help ();
+  else
+    {
+      printf (_("\
+Usage: %s [OPTION] NEWDIR [COMMAND [ARG]...]\n\
+  or:  %s OPTION\n\
+"), program_name, program_name);
+
+      fputs (_("\
+Run COMMAND with working directory set to NEWDIR.\n\
+\n\
+"), stdout);
+
+      fputs (HELP_OPTION_DESCRIPTION, stdout);
+      fputs (VERSION_OPTION_DESCRIPTION, stdout);
+      fputs (_("\
+\n\
+If no command is given, run '\"$SHELL\" -i' (default: '/bin/sh -i').\n\
+"), stdout);
+      emit_ancillary_info (PROGRAM_NAME);
+    }
+  exit (status);
+}
+
+int
+main (int argc, char **argv)
+{
+  int c;
+
+  initialize_main (&argc, &argv);
+  set_program_name (argv[0]);
+  setlocale (LC_ALL, "");
+  bindtextdomain (PACKAGE, LOCALEDIR);
+  textdomain (PACKAGE);
+
+  initialize_exit_failure (EXIT_CANCELED);
+  atexit (close_stdout);
+
+  while ((c = getopt_long (argc, argv, "+", long_opts, NULL)) != -1)
+    {
+      switch (c)
+        {
+        case_GETOPT_HELP_CHAR;
+
+        case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+
+        default:
+          usage (EXIT_CANCELED);
+        }
+    }
+
+  if (argc <= optind)
+    {
+      error (0, 0, _("missing operand"));
+      usage (EXIT_CANCELED);
+    }
+
+  char const *newdir = argv[optind];
+
+  if (chdir (newdir) != 0)
+    die (EXIT_CANCELED, errno, _("cannot change directory to %s"),
+         quoteaf (newdir));
+
+  if (argc == optind + 1)
+    {
+      /* No command.  Run an interactive shell.  */
+      char *shell = getenv ("SHELL");
+      if (shell == NULL)
+        shell = bad_cast ("/bin/sh");
+      argv[0] = shell;
+      argv[1] = bad_cast ("-i");
+      argv[2] = NULL;
+    }
+  else
+    {
+      /* The following arguments give the command.  */
+      argv += optind + 1;
+    }
+
+  /* Execute the given command.  */
+  execvp (argv[0], argv);
+
+  int exit_status = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE;
+  error (0, errno, _("failed to run command %s"), quote (argv[0]));
+  return exit_status;
+}
diff --git a/src/local.mk b/src/local.mk
index 1cb6859..ae27d01 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -100,6 +100,7 @@ src_base32_LDADD = $(LDADD)
 src_basename_LDADD = $(LDADD)
 src_cat_LDADD = $(LDADD)
 src_chcon_LDADD = $(LDADD)
+src_chdir_LDADD = $(LDADD)
 src_chgrp_LDADD = $(LDADD)
 src_chmod_LDADD = $(LDADD)
 src_chown_LDADD = $(LDADD)
diff --git a/tests/local.mk b/tests/local.mk
index fd4713d..abbbaaa 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -275,6 +275,7 @@ all_tests =					\
   tests/misc/base64.pl				\
   tests/misc/basename.pl			\
   tests/misc/close-stdout.sh			\
+  tests/misc/chdir.sh				\
   tests/misc/chroot-fail.sh			\
   tests/misc/comm.pl				\
   tests/misc/csplit.sh				\
diff --git a/tests/misc/chdir.sh b/tests/misc/chdir.sh
new file mode 100644
index 0000000..0b6bd01
--- /dev/null
+++ b/tests/misc/chdir.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Verify behavior of chdir.
+
+# Copyright (C) 2017 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_ chdir pwd
+
+# Verify exact status of internal failure.
+returns_ 125 chdir || fail=1 # missing argument
+returns_ 125 chdir --- / true || fail=1 # unknown option
+
+returns_ 2 chdir / sh -c 'exit 2' || fail=1 # exit status propagation
+returns_ 126 chdir / . || fail=1 # invalid command
+returns_ 127 chdir / no_such || fail=1 # no such command
+
+# Ensure we change directory.
+curdir=$(chdir /bin env pwd) || fail=1
+test "$curdir" = /bin || fail=1
+
+Exit $fail
diff --git a/tests/misc/help-version.sh b/tests/misc/help-version.sh
index b864e8c..77d74a7 100755
--- a/tests/misc/help-version.sh
+++ b/tests/misc/help-version.sh
@@ -22,6 +22,7 @@
 # Terminate any background processes
 cleanup_() { kill $pid 2>/dev/null && wait $pid; }
 
+expected_failure_status_chdir=125
 expected_failure_status_chroot=125
 expected_failure_status_env=125
 expected_failure_status_nice=125
@@ -188,6 +189,7 @@ expr_setup () { args=foo; }
 # Punt, in case GNU 'id' hasn't been installed yet.
 groups_setup () { args=--version; }
 
+chdir_setup () { args="/ true"; }
 pathchk_setup () { args=$tmp_in; }
 yes_setup () { args=--version; }
 logname_setup () { args=--version; }
diff --git a/tests/misc/invalid-opt.pl b/tests/misc/invalid-opt.pl
index cca7811..c7437ed 100755
--- a/tests/misc/invalid-opt.pl
+++ b/tests/misc/invalid-opt.pl
@@ -28,6 +28,7 @@ my %exit_status =
     dir => 2,
     vdir => 2,
     test => 2,
+    chdir => 125,
     chroot => 125,
     echo => 0,
     env => 125,
-- 
2.7.4


--35htslefcfqp27vo
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-env-add-chdir-option.patch"

>From 0a74257b9fb7e02587b6c5553d8bc1b536249a7e Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 27 Aug 2017 08:16:21 +0100
Subject: [PATCH] env: add --chdir option

This is useful when chaining with other commands that run commands in a
different context.

* NEWS (New features): Document the new option.
* doc/coreutils.texi (env invocation): Likewise.
* src/env.c (usage): Likewise.
(main): Implement the new option.
* tests/misc/env.sh: Test the new option.
---
 NEWS               |  3 +++
 doc/coreutils.texi | 17 +++++++++++++++++
 src/env.c          | 20 ++++++++++++++++++++
 tests/misc/env.sh  | 10 +++++++++-
 4 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index d37195e..60d5ca5 100644
--- a/NEWS
+++ b/NEWS
@@ -86,6 +86,9 @@ GNU coreutils NEWS                                    -*- outline -*-
 
   expr supports multibyte strings for all string operations.
 
+  env now has a --chdir option to change to a new working directory before
+  executing the subsidiary program.
+
 ** Improvements
 
   mv --verbose now distinguishes rename and copy operations.
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8f1cb4c..f127517 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -16909,6 +16909,23 @@ environment.
 @opindex --ignore-environment
 Start with an empty environment, ignoring the inherited environment.
 
+@item --chdir=@var{dir}
+@opindex --chdir
+Change the working directory to @var{dir} before invoking @var{command}.
+This differs from the shell built-in @command{cd} in that it starts
+@var{command} as a subprocess rather than altering the shell's own working
+directory; this allows it to be chained with other commands that run commands
+in a different context.  For example:
+
+@example
+# Run 'true' with /chroot as its root directory and /srv as its working
+# directory.
+chroot /chroot env --chdir=/srv true
+# Run 'true' with /build as its working directory, FOO=bar in its
+# environment, and a time limit of five seconds.
+env --chdir=/build FOO=bar timeout 5 true
+@end example
+
 @end table
 
 @cindex exit status of @command{env}
diff --git a/src/env.c b/src/env.c
index 63d5c2c..291fbb4 100644
--- a/src/env.c
+++ b/src/env.c
@@ -33,11 +33,19 @@
   proper_name ("Richard Mlynarik"), \
   proper_name ("David MacKenzie")
 
+/* For long options that have no equivalent short option, use a
+   non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
+enum
+{
+  CHDIR = CHAR_MAX + 1
+};
+
 static struct option const longopts[] =
 {
   {"ignore-environment", no_argument, NULL, 'i'},
   {"null", no_argument, NULL, '0'},
   {"unset", required_argument, NULL, 'u'},
+  {"chdir", required_argument, NULL, CHDIR},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
   {NULL, 0, NULL, 0}
@@ -63,6 +71,7 @@ Set each NAME to VALUE in the environment and run COMMAND.\n\
   -i, --ignore-environment  start with an empty environment\n\
   -0, --null           end each output line with NUL, not newline\n\
   -u, --unset=NAME     remove variable from the environment\n\
+      --chdir=DIR      change working directory to DIR\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -81,6 +90,7 @@ main (int argc, char **argv)
   int optc;
   bool ignore_environment = false;
   bool opt_nul_terminate_output = false;
+  char const *newdir = NULL;
 
   initialize_main (&argc, &argv);
   set_program_name (argv[0]);
@@ -103,6 +113,9 @@ main (int argc, char **argv)
         case '0':
           opt_nul_terminate_output = true;
           break;
+	case CHDIR:
+	  newdir = optarg;
+	  break;
         case_GETOPT_HELP_CHAR;
         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
         default:
@@ -154,6 +167,13 @@ main (int argc, char **argv)
       usage (EXIT_CANCELED);
     }
 
+  if (newdir)
+    {
+      if (chdir (newdir) != 0)
+	die (EXIT_CANCELED, errno, _("cannot change directory to %s"),
+	     quoteaf (newdir));
+    }
+
   execvp (argv[optind], &argv[optind]);
 
   int exit_status = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE;
diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index f2f6ba8..c409630 100755
--- a/tests/misc/env.sh
+++ b/tests/misc/env.sh
@@ -18,7 +18,7 @@
 
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-print_ver_ env
+print_ver_ env pwd
 
 # A simple shebang program to call "echo" from symlinks like "./-u" or "./--".
 echo "#!$abs_top_builddir/src/echo simple_echo" > simple_echo \
@@ -150,4 +150,12 @@ test "x$(sh -c '\c=d echo fail')" = xpass && #dash 0.5.4 fails so check first
 returns_ 125 env -u a=b true || fail=1
 returns_ 125 env -u '' true || fail=1
 
+# Verify changing directory.
+mkdir empty || framework_failure_
+returns_ 125 env --chdir=empty/nonexistent true || fail=1
+curdir=$(env pwd) || fail=1
+test "$curdir" = "$(pwd)" || fail=1
+curdir=$(env --chdir=empty pwd) || fail=1
+test "$curdir" = "$(cd empty && pwd)" || fail=1
+
 Exit $fail
-- 
2.7.4


--35htslefcfqp27vo--


From MAILER-DAEMON Sun Aug 27 09:58:34 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dly5C-0004Jf-JC
	for mharc-coreutils@gnu.org; Sun, 27 Aug 2017 09:58:34 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54500)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dly59-0004JG-Rq
	for coreutils@gnu.org; Sun, 27 Aug 2017 09:58:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dly56-0006VJ-R5
	for coreutils@gnu.org; Sun, 27 Aug 2017 09:58:31 -0400
Received: from smtp-out-no.shaw.ca ([64.59.134.13]:42387)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <962-396-1872@kylheku.com>)
	id 1dly56-0006Up-Kq
	for coreutils@gnu.org; Sun, 27 Aug 2017 09:58:28 -0400
Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP
	id ly4xd7CVFM9gtly4yd86zM; Sun, 27 Aug 2017 07:58:25 -0600
X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0
	a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17
	a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=KeKAF7QvOSUA:10
	a=4bwHr9qX2C_YJgysp9QA:9 a=QEXdDO2ut3YA:10
Received: from www-data by kylheku.com with local (Exim 4.72)
	(envelope-from <962-396-1872@kylheku.com>)
	id 1dly4x-0002qT-3K; Sun, 27 Aug 2017 06:58:19 -0700
To: Colin Watson <cjwatson@debian.org>
Subject: Re: New utility suggestion: chdir(1)
X-PHP-Originating-Script: 501:rcmail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: quoted-printable
Date: Sun, 27 Aug 2017 06:58:19 -0700
From: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
Cc: coreutils@gnu.org
In-Reply-To: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
Message-ID: <4d2068589970f3b1297b0e70a70ec9ed@mail.kylheku.com>
X-Sender: 962-396-1872@kylheku.com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfCQgNXgq5cImHeD78EdD6ulHAZ1cWYRkRed1dQr87XFQqmMdItDx89EgbXYZQ6Kzt3k1zq0cOFib+SoAS4OYP8W3LNmNU/8oHPdeKtfO/56d21Xo1/IA
	uqvEnttFtm820jzP7xoD8zwYUAJ/D74F2ugqbDknu+l1YRuwu1D0dhds9YhEq6hr7yVHyTr0oYc9JRQak79Mp2DzJ9QoDGadLGQ=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 64.59.134.13
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, 27 Aug 2017 13:58:32 -0000

On 26.08.2017 11:10, Colin Watson wrote:
> I would like there to be an adverbial version of "cd", which takes a
> path followed by a command and optional arguments and executes the
> command with its working directory set to the given path.  Its
> invocation would be similar to chroot(8), that is:
>=20
>   chdir [OPTION] NEWDIR [COMMAND [ARG]...]

Could be an option in "env".

   env -C /path/to/dir VAR=3Dvalue ... command arg

(-C follows "tar -C' and "make -C").



From MAILER-DAEMON Sun Aug 27 16:02:26 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dm3lK-00020N-7q
	for mharc-coreutils@gnu.org; Sun, 27 Aug 2017 16:02:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57916)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dm3lH-00020B-Na
	for coreutils@gnu.org; Sun, 27 Aug 2017 16:02:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dm3lE-0000lz-LF
	for coreutils@gnu.org; Sun, 27 Aug 2017 16:02:23 -0400
Received: from a-painless.mh.aa.net.uk ([81.187.30.51]:36440)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <cjwatson@debian.org>) id 1dm3lE-0000k0-FJ
	for coreutils@gnu.org; Sun, 27 Aug 2017 16:02:20 -0400
Received: from
	3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa
	([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org)
	by a-painless.mh.aa.net.uk with esmtps
	(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
	(envelope-from <cjwatson@debian.org>)
	id 1dm3l7-0002gg-2n; Sun, 27 Aug 2017 21:02:13 +0100
Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org)
	by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89)
	(envelope-from <cjwatson@debian.org>)
	id 1dm3l1-0007e4-FW; Sun, 27 Aug 2017 21:02:07 +0100
Date: Sun, 27 Aug 2017 21:02:07 +0100
From: Colin Watson <cjwatson@debian.org>
To: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
Cc: coreutils@gnu.org
Subject: Re: New utility suggestion: chdir(1)
Message-ID: <20170827200207.imjpwmj6vlcw4zb6@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<4d2068589970f3b1297b0e70a70ec9ed@mail.kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <4d2068589970f3b1297b0e70a70ec9ed@mail.kylheku.com>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 81.187.30.51
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, 27 Aug 2017 20:02:24 -0000

On Sun, Aug 27, 2017 at 06:58:19AM -0700, Kaz Kylheku (Coreutils) wrote:
> On 26.08.2017 11:10, Colin Watson wrote:
> > I would like there to be an adverbial version of "cd", which takes a
> > path followed by a command and optional arguments and executes the
> > command with its working directory set to the given path.  Its
> > invocation would be similar to chroot(8), that is:
> > 
> >   chdir [OPTION] NEWDIR [COMMAND [ARG]...]
> 
> Could be an option in "env".
> 
>   env -C /path/to/dir VAR=value ... command arg
> 
> (-C follows "tar -C' and "make -C").

Yep, Pádraig made a similar suggestion in
https://lists.gnu.org/archive/html/coreutils/2017-08/msg00055.html and
the second patch I attached to
https://lists.gnu.org/archive/html/coreutils/2017-08/msg00058.html
implements it.

I intentionally didn't add a short option, though, because env(1) is a
standardised utility with multiple implementations and I didn't want to
risk colliding with somebody else's extension.

-- 
Colin Watson                                       [cjwatson@debian.org]


From MAILER-DAEMON Sun Aug 27 22:28:01 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dm9mT-0007Gc-OG
	for mharc-coreutils@gnu.org; Sun, 27 Aug 2017 22:28:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45994)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dm9mR-0007GT-HD
	for coreutils@gnu.org; Sun, 27 Aug 2017 22:28:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dm9mM-0001Qs-J4
	for coreutils@gnu.org; Sun, 27 Aug 2017 22:27:59 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:38290)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dm9mM-0001Py-C1
	for coreutils@gnu.org; Sun, 27 Aug 2017 22:27:54 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 359F04A7F;
	Mon, 28 Aug 2017 03:27:51 +0100 (IST)
Subject: Re: Feature request: ls --hyperlink
To: Egmont Koblinger <egmont@gmail.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <7c6813e6-46d2-031a-63d9-016fff26b82b@draigBrady.com>
Date: Sun, 27 Aug 2017 19:27:48 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@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]
	[fuzzy]
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, 28 Aug 2017 02:28:00 -0000

On 25/08/17 13:01, Egmont Koblinger wrote:
> Hi,
>=20
>> Version 2 [...]
>> ensures that URLs are aligned in padded output,
>=20
> I'm not sure I like this change (the outer pair of single quotes no lon=
ger belonging to the URL).
>=20
> First, these single quotes are colored according to the file type. With=
 this change, coloring and URLizing became less consistent compared to ea=
ch other.

I've just tested with src/testvte and I think
the alignment is better when not including the quotes in the URL.
I.E. the misaligned underlining is distracting.

Now this wouldn't be an issue if the URIs weren't highlighted by default.
When you have a block of URIs, having them all underlined (albeit dotted)
is noisy and would at least for me mean I wouldn't enable --hyperlink
by default for ls. It would be very useful for apps like ls to indicate
whether they wanted an indicator by default.
How about we support hl=3D# parameter, where 1 =3D hover only, 2 =3D both=
 ?
I've updated the patch here to output the hl=3D1 parameter
and have confirmed that vte ignores it as expected at present.

thanks,
P=C3=A1draig


From MAILER-DAEMON Sun Aug 27 22:33:28 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dm9rk-0007qE-9T
	for mharc-coreutils@gnu.org; Sun, 27 Aug 2017 22:33:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46444)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dm9ri-0007q6-5l
	for coreutils@gnu.org; Sun, 27 Aug 2017 22:33:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dm9rd-0004Bk-87
	for coreutils@gnu.org; Sun, 27 Aug 2017 22:33:26 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:38300)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dm9rd-0004Ab-1v
	for coreutils@gnu.org; Sun, 27 Aug 2017 22:33:21 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 6956B4A89;
	Mon, 28 Aug 2017 03:33:19 +0100 (IST)
Subject: Re: New utility suggestion: chdir(1)
To: Colin Watson <cjwatson@debian.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <4e886ea7-261a-87dc-5387-bfd3103504ef@draigBrady.com>
Date: Sun, 27 Aug 2017 19:33:17 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
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]
	[fuzzy]
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, 28 Aug 2017 02:33:27 -0000

On 27/08/17 00:23, Colin Watson wrote:
> On Sat, Aug 26, 2017 at 04:00:11PM -0700, P=E1draig Brady wrote:
>> If we were to provide this I think chdir is a fine name.
>> It's a pity we have to have this heavy weight chaining of execs like t=
his
>> to set each process attribute. This is more general though, than addin=
g
>> --chdir to other "context" type programs like chroot etc.
>> Note GNU chroot has a --skip-chdir which nearly does what you want.
>> I.E. you could os.chdir("/chroot/build") before calling "chroot --skip=
-dir ...",
>> however that's currently restricted for greater protection to when
>> you're not actually changing the root directory.  I suppose we could r=
elax
>> the check to verify that getcwd() was _below_ the specified chroot pat=
h.
>> Of course none of this helps with jexec, lxc etc.
>=20
> Indeed; I really want something composable rather than playing
> whack-a-mole with every possible wrapper command.
>=20
>> Another option to consider is to add --chdir to env(1) since they
>> would often be used together and could be done more efficiently with a=
 single exec?
>=20
> That's a good idea, and I agree they're often used together.  I'd
> already slipped and implemented chdir(1), but I think that suggestion
> may be better: it results in a much shorter patch, and it avoids the
> problem with some shells (e.g. zsh) implementing their own "chdir"
> built-ins with different semantics.
>=20
> I've attached both patches; my preference following P=E1draig's suggest=
ion
> is the second one ("env: add --chdir option"), but I'd be happy either
> way.

Cool, I'll include your `env` change in the upcoming release.
I think supporting -C aligns well with other utils,
and has little chance of conflicting with existing implementations,
so I'll tweak your patch to allow that.

thanks!
P=E1draig



From MAILER-DAEMON Mon Aug 28 03:38:24 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmEcp-0004rh-Ue
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 03:38:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52497)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dmEcn-0004rP-1K
	for coreutils@gnu.org; Mon, 28 Aug 2017 03:38:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dmEcl-0005Db-TL
	for coreutils@gnu.org; Mon, 28 Aug 2017 03:38:21 -0400
Received: from mail-it0-x232.google.com ([2607:f8b0:4001:c0b::232]:37319)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dmEcl-0005C0-M9
	for coreutils@gnu.org; Mon, 28 Aug 2017 03:38:19 -0400
Received: by mail-it0-x232.google.com with SMTP id 77so23373967itj.0
	for <coreutils@gnu.org>; Mon, 28 Aug 2017 00:38:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=Ws8P9hYRpXk7SFyiOmRGE0DZrN/QdHuD6h74nMWyGTc=;
	b=HUFIa+qle3oAr0n6fcabC3JJudpfESlfbBTbOuzYIjtybIFywqOgbaK+uZwF92ygXk
	tjay2WW2FPzbg5i5a3MBwIcT2yN2guBvOooEdoV30xct+5uxnYvIBgiGoqNZqFaaGfz0
	Ir7wdjnrrXWp8HL9/nZ1vR5mY4hTM9pYq8hPCaLRAjn3KTYTpXrK2Ik/0HHOiCt5C/dY
	exVXajgn4Zg+LFX9CXRAdF8/N8QwqdNO5dJ6myN0fE8abBhkFF1wgbsXMzB1ylt5lHwX
	y50zOySNZRyizGMEDSTxY8U4aTnTE4qFi4/zJ9hQORDS7aDxSN5r6+umBz1XeQgvA1tQ
	Gvsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=Ws8P9hYRpXk7SFyiOmRGE0DZrN/QdHuD6h74nMWyGTc=;
	b=JsAN0pgTuAvOB9P94NFV4UxoJzkIT+tV1GirPKJIn1jCrYDGj/LFnXaNmgckREmRoX
	6Rbt2yY69SPT9UdH6/OpYmnehTIswZJC5ZylLTIKAryzi+b1dB5FMsObT9mOkjLXkbDh
	RxCdjRIyLIG0+C1T5zXTHj/4F3I0ngrfh7blNV+BZQORdgkjBQ5++SmaDR4tt4JrLztW
	fQtICwRY873KTN8CzajRJxKGD7zkFGVgZ5UlNEC6gNEFTOd3v7qVD2lyIGM5i/0N//al
	RpcYcVzj/iWw+Yuw2pu7clmhvYiJdXOOBRjjORDCOFfH0V+vMvBb6s0R9yVrzhMhXG00
	1yjA==
X-Gm-Message-State: AHYfb5hsI4E7q9bBMFp+rzByb1UvrHsRB9Cn8i8pIXCU9Aax7DJf4Ja2
	9H/loBN/Hx7+WNmhvZr5jwRKyvEDeg==
X-Received: by 10.36.150.71 with SMTP id z68mr4728524itd.6.1503905897736; Mon,
	28 Aug 2017 00:38:17 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Mon, 28 Aug 2017 00:37:36 -0700 (PDT)
In-Reply-To: <7c6813e6-46d2-031a-63d9-016fff26b82b@draigBrady.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
	<7c6813e6-46d2-031a-63d9-016fff26b82b@draigBrady.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Mon, 28 Aug 2017 09:37:36 +0200
Message-ID: <CAGWcZkKvCJWWrjbPEJR+Wv6nZ041NQn-adL7xJF8X5fEgEHEgQ@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::232
Content-Type: text/plain; charset="UTF-8"
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: Mon, 28 Aug 2017 07:38:22 -0000

Hi,

Now this wouldn't be an issue if the URIs weren't highlighted by default.
> When you have a block of URIs, having them all underlined (albeit dotted)
> is noisy and would at least for me mean I wouldn't enable --hyperlink
> by default for ls. It would be very useful for apps like ls to indicate
> whether they wanted an indicator by default.
> How about we support hl=# parameter, where 1 = hover only, 2 = both ?
>

I also found it dense, or "noisy" as you call it, for a few days. Then I
got totally used to it. The dotted underline is not that heavy or
distracting.

Right now the goal is to spread this feature and make it discoverable for
users. Removing the dotted underline would be a step backwards in this
goal. (I understand it'd still be underlined on hover and the mouse pointer
shape altered too.)

It's not a trivial question who should control the look of URLs: 1: the
terminal emulator (leaving no way for the app to override), 2: the emitting
app (resulting in an inconsistent look across apps), or 3: some combination
of both.

For the first approach, it's possible that we will add a config option to
gnome-terminal not to highlight explicit hyperlinks. For the second
approach, if we were about to go that road then maybe a new ANSI escape
sequence would need to be introduced for dotted underline, and apps like
"ls" would need to explicitly output it if they wanted to dotted underline
their hyperlink (and apps could also use this style for non-hyperlinks).
(And then why not a similar escape sequence for the mouse pointer shape?)

What you suggest goes in the third, hybrid direction: have a default style,
but let apps somewhat override that.

I'm not against your proposal, but I'd like to have it discussed at least
across iTerm2 and gnome-terminal, the two emulators that co-designed this
feature.

Given that vte/gnome-terminal will have its hard code freeze in a week from
now for the 0.50 / 3.26 versions where this feature debuts, and I won't
have much time this week, I don't see a reasonable chance for this to
happen in the initial version.

What I recommend is that the feature goes out as it is now currently, and
we wait for a year or so to gather user feedback (both here and for
gnome-terminal) and see what users wish for. I'm definitely up for
discussing possible improvements. I can promise to loop you in if I find
this topic being brought up somewhere.

Does that sound reasonable for you?

Thanks a lot,
e.

From MAILER-DAEMON Mon Aug 28 04:11:52 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmF9E-0003uQ-Rn
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 04:11:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57699)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dmF9B-0003sT-WF
	for coreutils@gnu.org; Mon, 28 Aug 2017 04:11:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dmF9A-0001sU-DZ
	for coreutils@gnu.org; Mon, 28 Aug 2017 04:11:49 -0400
Received: from mail-io0-x22e.google.com ([2607:f8b0:4001:c06::22e]:35845)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dmF9A-0001s1-7W
	for coreutils@gnu.org; Mon, 28 Aug 2017 04:11:48 -0400
Received: by mail-io0-x22e.google.com with SMTP id g33so14026093ioj.3
	for <coreutils@gnu.org>; Mon, 28 Aug 2017 01:11:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=YDUpV96O1FE+WFR0AFrUf6UcctPcr0Q//zE10uLoSqQ=;
	b=KFBclSWVsnkzKDOvX3UslYOp69Rzr8KyvlNF6j3WW5TFqBnJhS2n3MoEif5/DKfcTF
	A2a4z/ykua+VWRCl7v6zoFLEYaQn0cSIRHPhVdHMZxykYhDmpCOWlzUEuZms0b4htYnZ
	j2zMmziaCUXKYIUXjubPpkk4cR+MytD5ThU0AjdrJpUzVlzJbBZAEfkTjtxc1VOY8UQp
	QOhY6lD64xb2vSdjS4727UU9Wwq40NGGl6svkc8yEaPXkMT2NfzO9ZudE6eOAM5oDWZK
	X/XKnnLspZfVo32xxuj+2RPW6PvcR4QJARHNFXvE1QKybXxDyB8+vFcBPYRZdkXcWSI3
	Ew8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=YDUpV96O1FE+WFR0AFrUf6UcctPcr0Q//zE10uLoSqQ=;
	b=tpimaaZYZ0NHHjJ1OA8tU9aiFtXREkyUNIwwLCjhbUd09HkGPftimhGUsvdXRrf0k6
	WepHIzYiEG3bc29CgPC0VyxLsS2YQV9eTwNJMJhip6u5EDMEWIi3pd3ioYEwOFnF/xwN
	kgqscw8tc4yRYCBHlyY9CiqiMO2o9+C7q9OrYaApHJc1GVck/GjBHXt7Wg5sszRNf1sw
	vXfJuvdvxoI3TQkIZauIU5Jyky7dOs8WQxv/nTiy+Tp0aI1g+ni8O4dnZCJj73UzxWms
	gKXvJEV8zOWzuJAxoD1dfZtSH0dOW0MLd5awX/RutYzUPzrODS8A2sN0BCe0ar0dZf9I
	8Uug==
X-Gm-Message-State: AHYfb5itGbVgeVBA54+v3IhE3uSRGSA4SZe0PNl2jmGL+UR3Ol7xaR4q
	sSt2Hde5M7kZawOyRkWC8FsZx1WX1w==
X-Received: by 10.107.132.130 with SMTP id o2mr5152281ioi.259.1503907907637;
	Mon, 28 Aug 2017 01:11:47 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Mon, 28 Aug 2017 01:11:06 -0700 (PDT)
In-Reply-To: <CAGWcZkKvCJWWrjbPEJR+Wv6nZ041NQn-adL7xJF8X5fEgEHEgQ@mail.gmail.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
	<7c6813e6-46d2-031a-63d9-016fff26b82b@draigBrady.com>
	<CAGWcZkKvCJWWrjbPEJR+Wv6nZ041NQn-adL7xJF8X5fEgEHEgQ@mail.gmail.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Mon, 28 Aug 2017 10:11:06 +0200
Message-ID: <CAGWcZk+Mj+JenHk+NLg_ir0Ro75+fZ3ZXa4yQYQQxq4Bw01RTA@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::22e
Content-Type: text/plain; charset="UTF-8"
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: Mon, 28 Aug 2017 08:11:51 -0000

Hi,

One more possible approach I can think of (and I can commit this week) is
to make the dotted underline even lighter, let's say with a 1/3 fill ratio
instead of 1/2.

Edit src/vte.c at the "j = 0.125" loop, this loop is responsible for dotted
underlining "columns" number of consecutive cells. E.g. I've changed the
0.25 multiplier to 0.15 now (the result of the multiplication is somewhere
later on subject to integer conversion, no antialiasing will kick in) and
I'm happy with that look.

Are you happy with such lighter underline as a compromise, or would you
rather still have some means of disabling underlining?

(The current exact underlining look wasn't "designed". I just happened to
code it up quickly to have something to begin with, and then I found it
good enough not to change :))

e.


On Mon, Aug 28, 2017 at 9:37 AM, Egmont Koblinger <egmont@gmail.com> wrote:

> Hi,
>
> Now this wouldn't be an issue if the URIs weren't highlighted by default.
>> When you have a block of URIs, having them all underlined (albeit dotted)
>> is noisy and would at least for me mean I wouldn't enable --hyperlink
>> by default for ls. It would be very useful for apps like ls to indicate
>> whether they wanted an indicator by default.
>> How about we support hl=# parameter, where 1 = hover only, 2 = both ?
>>
>
> I also found it dense, or "noisy" as you call it, for a few days. Then I
> got totally used to it. The dotted underline is not that heavy or
> distracting.
>
> Right now the goal is to spread this feature and make it discoverable for
> users. Removing the dotted underline would be a step backwards in this
> goal. (I understand it'd still be underlined on hover and the mouse pointer
> shape altered too.)
>
> It's not a trivial question who should control the look of URLs: 1: the
> terminal emulator (leaving no way for the app to override), 2: the emitting
> app (resulting in an inconsistent look across apps), or 3: some combination
> of both.
>
> For the first approach, it's possible that we will add a config option to
> gnome-terminal not to highlight explicit hyperlinks. For the second
> approach, if we were about to go that road then maybe a new ANSI escape
> sequence would need to be introduced for dotted underline, and apps like
> "ls" would need to explicitly output it if they wanted to dotted underline
> their hyperlink (and apps could also use this style for non-hyperlinks).
> (And then why not a similar escape sequence for the mouse pointer shape?)
>
> What you suggest goes in the third, hybrid direction: have a default
> style, but let apps somewhat override that.
>
> I'm not against your proposal, but I'd like to have it discussed at least
> across iTerm2 and gnome-terminal, the two emulators that co-designed this
> feature.
>
> Given that vte/gnome-terminal will have its hard code freeze in a week
> from now for the 0.50 / 3.26 versions where this feature debuts, and I
> won't have much time this week, I don't see a reasonable chance for this to
> happen in the initial version.
>
> What I recommend is that the feature goes out as it is now currently, and
> we wait for a year or so to gather user feedback (both here and for
> gnome-terminal) and see what users wish for. I'm definitely up for
> discussing possible improvements. I can promise to loop you in if I find
> this topic being brought up somewhere.
>
> Does that sound reasonable for you?
>
> Thanks a lot,
> e.
>

From MAILER-DAEMON Mon Aug 28 04:52:03 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmFm7-0005ry-Nk
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 04:52:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37788)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmFm1-0005rS-QZ
	for coreutils@gnu.org; Mon, 28 Aug 2017 04:52:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmFlx-0002lN-RZ
	for coreutils@gnu.org; Mon, 28 Aug 2017 04:51:57 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:45360)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmFlx-0002kp-Kj
	for coreutils@gnu.org; Mon, 28 Aug 2017 04:51:53 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 3576A9B;
	Mon, 28 Aug 2017 09:51:51 +0100 (IST)
Subject: Re: Feature request: ls --hyperlink
To: Egmont Koblinger <egmont@gmail.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
	<7c6813e6-46d2-031a-63d9-016fff26b82b@draigBrady.com>
	<CAGWcZkKvCJWWrjbPEJR+Wv6nZ041NQn-adL7xJF8X5fEgEHEgQ@mail.gmail.com>
	<CAGWcZk+Mj+JenHk+NLg_ir0Ro75+fZ3ZXa4yQYQQxq4Bw01RTA@mail.gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <a9de8bf8-3981-bfe2-2f91-880bb46e179b@draigBrady.com>
Date: Mon, 28 Aug 2017 01:51:48 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAGWcZk+Mj+JenHk+NLg_ir0Ro75+fZ3ZXa4yQYQQxq4Bw01RTA@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]
	[fuzzy]
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, 28 Aug 2017 08:52:01 -0000

On 28/08/17 01:11, Egmont Koblinger wrote:
> Hi,
>=20
> One more possible approach I can think of (and I can commit this week) =
is to make the dotted underline even lighter, let's say with a 1/3 fill r=
atio instead of 1/2.
>=20
> Edit src/vte.c at the "j =3D 0.125" loop, this loop is responsible for =
dotted underlining "columns" number of consecutive cells. E.g. I've chang=
ed the 0.25 multiplier to 0.15 now (the result of the multiplication is s=
omewhere later on subject to integer conversion, no antialiasing will kic=
k in) and I'm happy with that look.
>=20
> Are you happy with such lighter underline as a compromise, or would you=
 rather still have some means of disabling underlining?
>=20
> (The current exact underlining look wasn't "designed". I just happened =
to code it up quickly to have something to begin with, and then I found i=
t good enough not to change :))
>=20
> e.
>=20
>=20
> On Mon, Aug 28, 2017 at 9:37 AM, Egmont Koblinger <egmont@gmail.com <ma=
ilto:egmont@gmail.com>> wrote:
>=20
>     Hi,
>=20
>         Now this wouldn't be an issue if the URIs weren't highlighted b=
y default.
>         When you have a block of URIs, having them all underlined (albe=
it dotted)
>         is noisy and would at least for me mean I wouldn't enable --hyp=
erlink
>         by default for ls. It would be very useful for apps like ls to =
indicate
>         whether they wanted an indicator by default.
>         How about we support hl=3D# parameter, where 1 =3D hover only, =
2 =3D both ?
>=20
>=20
>     I also found it dense, or "noisy" as you call it, for a few days. T=
hen I got totally used to it. The dotted underline is not that heavy or d=
istracting.
>=20
>     Right now the goal is to spread this feature and make it discoverab=
le for users. Removing the dotted underline would be a step backwards in =
this goal. (I understand it'd still be underlined on hover and the mouse =
pointer shape altered too.)
>=20
>     It's not a trivial question who should control the look of URLs: 1:=
 the terminal emulator (leaving no way for the app to override), 2: the e=
mitting app (resulting in an inconsistent look across apps), or 3: some c=
ombination of both.
>=20
>     For the first approach, it's possible that we will add a config opt=
ion to gnome-terminal not to highlight explicit hyperlinks. For the secon=
d approach, if we were about to go that road then maybe a new ANSI escape=
 sequence would need to be introduced for dotted underline, and apps like=
 "ls" would need to explicitly output it if they wanted to dotted underli=
ne their hyperlink (and apps could also use this style for non-hyperlinks=
). (And then why not a similar escape sequence for the mouse pointer shap=
e?)
>=20
>     What you suggest goes in the third, hybrid direction: have a defaul=
t style, but let apps somewhat override that.
>=20
>     I'm not against your proposal, but I'd like to have it discussed at=
 least across iTerm2 and gnome-terminal, the two emulators that co-design=
ed this feature.
>=20
>     Given that vte/gnome-terminal will have its hard code freeze in a w=
eek from now for the 0.50 / 3.26 versions where this feature debuts, and =
I won't have much time this week, I don't see a reasonable chance for thi=
s to happen in the initial version.
>=20
>     What I recommend is that the feature goes out as it is now currentl=
y, and we wait for a year or so to gather user feedback (both here and fo=
r gnome-terminal) and see what users wish for. I'm definitely up for disc=
ussing possible improvements. I can promise to loop you in if I find this=
 topic being brought up somewhere.
>=20
>     Does that sound reasonable for you?
>=20
>     Thanks a lot,
>     e.


Yes a bit lighter underlining is a small improvement,
but it still would mean I wouldn't enable it by default.
Also it definitely would discourage enabling this on a site wide
or even a distro wide basis. I.E. would really hurt adoption IMHO.
Note I don't think it would help discoverability initially either
since a user will need to explicitly add --hyperlink to their
ls alias or whatever, so so will implicitly know files are clickable.
Given the amount of interaction with mouse and xterms it would
be discoverable enough without the dotted lines I think.
Note dotted lines are a good default in general for identifying links,
but bad in the ls case since they don't add any info.

cheers,
P=C3=A1draig


From MAILER-DAEMON Mon Aug 28 08:51:25 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmJVl-0003sF-LM
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 08:51:25 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50379)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <yugandharbhoomi@gmail.com>) id 1dmENK-0002RY-EM
	for coreutils@gnu.org; Mon, 28 Aug 2017 03:22:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <yugandharbhoomi@gmail.com>) id 1dmENJ-0006uo-1H
	for coreutils@gnu.org; Mon, 28 Aug 2017 03:22:22 -0400
Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]:37920)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <yugandharbhoomi@gmail.com>)
	id 1dmENI-0006uJ-RP
	for coreutils@gnu.org; Mon, 28 Aug 2017 03:22:20 -0400
Received: by mail-io0-x230.google.com with SMTP id 81so13591211ioj.5
	for <coreutils@gnu.org>; Mon, 28 Aug 2017 00:22:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=EKMFf+Uny1cDh5gVicYIrYTTf3/BkYaJcQNnCQvozP0=;
	b=YTKqvJD29mwAbIIYlgDysxNbnHnvc2sDr+u0V7dJIcWKu2WUw1AWYDVW7e2rM+WNiZ
	k4Lb/vjUEPHBCaPuzpzMeMrrlX4nwAiK8fK1DVY4wi7aSx7CZbgSwcS+4Ax7AkICuAEu
	VeAfoWTyrpXuizwKSqyUu8ANQjrIqgjZE2238GyqueOtYwhoqAZbSgYFWr6p2Gk0NmfU
	kUrqO961jKRbfGWC1XW8ponrLve6GvioIUt4B5ZdTqPAj8SIndqOBe9VlJrMlBJfEO1F
	BdTBgq1AKXr5b7B+vDVHq2v0h5GqQ2pkq/vaRSSqGqI1QXQHmcHeBXavlpqVmsdj6No7
	PDpw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=EKMFf+Uny1cDh5gVicYIrYTTf3/BkYaJcQNnCQvozP0=;
	b=k9kJg7UNDyiSvLSALAldQbPsgjRT7mJjvL+PUm9mGbFwsxHFDS3tIJmhzuIpx706EH
	S+7tkDonFlZUGD0PGzFUAbSVo8JYjtrreXjmjYufx9bUS9beuku9LC+uVcl+7R+iw8e+
	eVX2gEFlzlBc92xDhEuUpImsHdjy3csuTIAKAMnBCddgNSqtGgWS5lJh+A84Mnj4ntRE
	vz9VbKYgDCdzHUvTS+dwwPsBPm95T96UWWfLfHyFvrcJCnxxd1JQk6SpbqcXsLuSNMMm
	gSIw1anLxAz3Jv0Z2EBZIAT4IPiF5Q42fsEowEE5a9FO0Bou5eo9AwavMFEtdzhfwW16
	UHBQ==
X-Gm-Message-State: AHYfb5j9YPpafSRcPKnWPEJXWAGljWJrhXx3TsVnT6aFrqmUml+dbdOb
	iosKdpAYG/M6Q3u+QFu8gnj9e+4dNw==
X-Received: by 10.107.59.141 with SMTP id i135mr5171697ioa.358.1503904938807; 
	Mon, 28 Aug 2017 00:22:18 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.155.193 with HTTP; Mon, 28 Aug 2017 00:22:18 -0700 (PDT)
In-Reply-To: <078c88e8-78cf-055e-3b5f-ffe0baf5c3a8@redhat.com>
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
	<078c88e8-78cf-055e-3b5f-ffe0baf5c3a8@redhat.com>
From: Ravinder <yugandharbhoomi@gmail.com>
Date: Mon, 28 Aug 2017 12:52:18 +0530
Message-ID: <CAMO4kbBAP+-Fh1zxk2_dZDU-rsbnztSnGY=68ZUPWJXBjSaKmA@mail.gmail.com>
Subject: Re: bug#28224: Need to know technical support for GnuWin32: CoreUtils
	5.3.0 versions
To: Eric Blake <eblake@redhat.com>
Cc: 28224-done@debbugs.gnu.org, coreutils@gnu.org, 
	Ravinder.padigela@in.ibm.com
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::230
X-Mailman-Approved-At: Mon, 28 Aug 2017 08:51:24 -0400
Content-Type: text/plain; charset="UTF-8"
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: Mon, 28 Aug 2017 07:22:23 -0000

Thanks for your reply Eric,

As I seen coreutils@gnu.org contact information we have in the official gnu
site. So please provide any contact information for supporting GnuWin32:
CoreUtils 5.3.0.


Thanks In Advance,

Regards,
Ravinder. P.


On Thu, Aug 24, 2017 at 11:29 PM, Eric Blake <eblake@redhat.com> wrote:

> tag 28224 notabug
> thanks
>
> On 08/24/2017 06:24 AM, Ravinder wrote:
> > Hi,
> >
> > We are using GnuWin32: CoreUtils 5.3.0 versions in our project, so
> > requesting you to know whether the technical support is still giving for
> > these versions, so that we will plan our project to use the latest
> version
> > of GnuWin32: CoreUtils.
>
> This site does not maintain GnuWin32.  You'll have to ask the GnuWin32
> folks how long they plan to support something, and I doubt that anyone
> working on GnuWin32 reads this list.  As such, I'm closing this issue in
> the upstream coreutils bug database, as it is not an upstream bug, so
> much as a support question to your choice of vendor, which should
> therefore be directed to your vendor.
>
> As it is, 5.3.0 is ancient, compared to current upstream 8.27.  Using
> software that is more than 12 years old is rather risky on your part,
> since even some of the longest Enterprise contracts you can purchase
> tend not to last that long.  So if I had to guess, I'd state that
> GnuWin32 is unsupported.
>
> >
> > Kindly feel free & revert me ASAP.
>
> "revert me" doesn't make much sense; did you mean "reply to me"?
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>
>

From MAILER-DAEMON Mon Aug 28 09:49:54 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmKQM-0002be-EM
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 09:49:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:32993)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dmKQJ-0002Z2-RQ
	for coreutils@gnu.org; Mon, 28 Aug 2017 09:49:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dmKQG-0004of-II
	for coreutils@gnu.org; Mon, 28 Aug 2017 09:49:51 -0400
Received: from mx1.redhat.com ([209.132.183.28]:61660)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eblake@redhat.com>) id 1dmKQG-0004o9-9T
	for coreutils@gnu.org; Mon, 28 Aug 2017 09:49:48 -0400
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
	[10.5.11.11])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 2EBD84A70F;
	Mon, 28 Aug 2017 13:49:46 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2EBD84A70F
Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=eblake@redhat.com
Received: from [10.10.122.186] (ovpn-122-186.rdu2.redhat.com [10.10.122.186])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 7699B7F483;
	Mon, 28 Aug 2017 13:49:45 +0000 (UTC)
Subject: Re: bug#28224: Need to know technical support for GnuWin32: CoreUtils
	5.3.0 versions
To: Ravinder <yugandharbhoomi@gmail.com>
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
	<078c88e8-78cf-055e-3b5f-ffe0baf5c3a8@redhat.com>
	<CAMO4kbBAP+-Fh1zxk2_dZDU-rsbnztSnGY=68ZUPWJXBjSaKmA@mail.gmail.com>
Cc: 28224-done@debbugs.gnu.org, coreutils@gnu.org, Ravinder.padigela@in.ibm.com
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <cccfe3ef-4354-9a07-c0e0-cb95364938e4@redhat.com>
Date: Mon, 28 Aug 2017 08:49:44 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <CAMO4kbBAP+-Fh1zxk2_dZDU-rsbnztSnGY=68ZUPWJXBjSaKmA@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="9A8V5hI8qdxopKQ3MCvQ8JWsvsf7Gke4a"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.38]);
	Mon, 28 Aug 2017 13:49:46 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Mon, 28 Aug 2017 13:49:52 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--9A8V5hI8qdxopKQ3MCvQ8JWsvsf7Gke4a
From: Eric Blake <eblake@redhat.com>
To: Ravinder <yugandharbhoomi@gmail.com>
Cc: 28224-done@debbugs.gnu.org, coreutils@gnu.org,
 Ravinder.padigela@in.ibm.com
Message-ID: <cccfe3ef-4354-9a07-c0e0-cb95364938e4@redhat.com>
Subject: Re: bug#28224: Need to know technical support for GnuWin32: CoreUtils
 5.3.0 versions
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
 <078c88e8-78cf-055e-3b5f-ffe0baf5c3a8@redhat.com>
 <CAMO4kbBAP+-Fh1zxk2_dZDU-rsbnztSnGY=68ZUPWJXBjSaKmA@mail.gmail.com>
In-Reply-To: <CAMO4kbBAP+-Fh1zxk2_dZDU-rsbnztSnGY=68ZUPWJXBjSaKmA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 08/28/2017 02:22 AM, Ravinder wrote:
> Thanks for your reply Eric,
>=20
> As I seen coreutils@gnu.org contact information we have in the official=
 gnu
> site. So please provide any contact information for supporting GnuWin32=
:
> CoreUtils 5.3.0.

You have the official upstream site, but NOT the official GnuWin32 site.
 As I already mentioned, if you want to know how long GnuWin32 is
supported, you'll have to ask the GnuWin32 people, since they are a
downstream distribution.  We do not maintain GnuWin32 here upstream.

A quick google search:
http://lmgtfy.com/?q=3Dgnuwin32
shows GnuWin32 (used to?) live here:
http://gnuwin32.sourceforge.net/

The last update to that page was in 2010.  In all likelihood, that means
it is no longer being maintained, and if so, that probably answers your
question - there is NO technical support for coreutils 5.3.0 binaries
obtained from the GnuWin32 folks, either from us at upstream (because we
don't care about releases that old here, only the current latest
release), or from the GnuWin32 folks (because they don't care enough
about their product to keep it up to date).

--=20
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

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

iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlmkH3gACgkQp6FrSiUn
Q2qL8Af/X4i3l0k75743CcHxYHe5vqAYzFU3a0t8uJFf+dxYXRfdf33fC81ZYkAb
erZU4bkmuIfjNpqe5qVcgSUjC3PhYXodqXFl7dzqMvSDrxuX24uSjZ/QyUc5zTk6
7UNqXVSmu/rL6pvl5k8/H92IhoP6pMXJ4W5E6s01wRixjj7iecl+jdQClzODx0Q/
9bMYKZGQGmbUwoUlQkrMOIPKRwrNU/uFd1IXVPoZRHiARFVPjAr+X9nqxIYRhp8q
JNi2dApLmS/zC97Z5jqHZVN0Rf3uagkhBBZaRcfo67aZFHryA12c394MOc5Et7ar
u/aBkd33nJ3z0PWuV752AI/Se92CpQ==
=hMsz
-----END PGP SIGNATURE-----

--9A8V5hI8qdxopKQ3MCvQ8JWsvsf7Gke4a--


From MAILER-DAEMON Mon Aug 28 11:04:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmLai-0007ht-Fo
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 11:04:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51517)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dmLae-0007fy-3p
	for coreutils@gnu.org; Mon, 28 Aug 2017 11:04:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <egmont@gmail.com>) id 1dmLac-0003Pn-Sv
	for coreutils@gnu.org; Mon, 28 Aug 2017 11:04:36 -0400
Received: from mail-it0-x234.google.com ([2607:f8b0:4001:c0b::234]:34983)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <egmont@gmail.com>) id 1dmLac-0003Pc-Od
	for coreutils@gnu.org; Mon, 28 Aug 2017 11:04:34 -0400
Received: by mail-it0-x234.google.com with SMTP id f1so3147780ith.0
	for <coreutils@gnu.org>; Mon, 28 Aug 2017 08:04:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=45jFxYYEioXbY4no8B42J9SEuUhu8ia0aQRP4S5qyu8=;
	b=Pu87jGR4kVKydE5csHqdSzRA/53ehHJevKBCrUbO/2WivYyNtTE1IHcMiCyja0WvCV
	aW9Wgn+jN/uro19aV0cqj9fhd1PHlsOFbC5Bu1lGNyigYf6SHtyhY3bHMezY/kBz1pAI
	t8vi/m1UY2Qesjv8/1efN8fG7eUNNPkAZ+alXkq69q8suV/9O0K80yCwVDuOBubnVaFH
	0Jkwhdq7FSDF6jxOGZgYhj5DMvPEM1knNxEbOauUEO0/rUEq8PoLAqgSzqbaY5H0hODr
	bD45DKOeNg6KWdOl88TpdEqAQhXc8owHf+f/q7Li5p37+mNBRFS6S0Wo+eK9FuAEAcZt
	6ScQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=45jFxYYEioXbY4no8B42J9SEuUhu8ia0aQRP4S5qyu8=;
	b=mlEjABGlGOPCsxWuF8rwyGuFWefCYUQVZkNd49C2MvfDTgdcpgsvO4bkMFyOKoJlZE
	XM5Ww86OWdKzIBhAku6RKOJQ1wN8tYd4jOkkPm41BzO67T5F1gb9K0BTrW3HEuKfjyQJ
	CHaPg6U+JoQe2MC47hVpTFm7Wl4mZN+RxUQise4CmI9OnyxzJtMyylwZRpgdD7YTTHLd
	PNzKGL+63m5RZsPoNZfqRviOG16VaWSc4WwCiDG0r4FnHJ10l7tCrkBWUzSDGQL0NPn7
	OVbzR9BLqN3VIhLgCJiwPK3Vr7dCEZRXbtU8EJ5dhv4nMM1MfwKZtm9TTmyRgNcDD0QW
	IzQw==
X-Gm-Message-State: AHYfb5hFrv9DRKY5FiiAmxWSFKr/8+cv2efxTjAhClLj/duN4WYrMUsX
	a0mLTxG3dCxgTrHU05vzJCskuuDf/YZ8
X-Received: by 10.36.252.69 with SMTP id b66mr845691ith.171.1503932674078;
	Mon, 28 Aug 2017 08:04:34 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.152.206 with HTTP; Mon, 28 Aug 2017 08:03:53 -0700 (PDT)
In-Reply-To: <a9de8bf8-3981-bfe2-2f91-880bb46e179b@draigBrady.com>
References: <CAGWcZk+z8gsuG=ARNbDj1-YDwinAc=ryWGvhSPg_uGGDC+QeYg@mail.gmail.com>
	<85963450-b32f-8b87-a708-5ca417882daa@draigBrady.com>
	<d7331702-0f55-4816-ab85-815cf023f973@draigBrady.com>
	<08ca2e8b-8f4d-00ac-e8cf-6a5ae5313dd5@draigBrady.com>
	<CAGWcZkLrQQ33rTGjWu4PmsMOy72Ytv40hm3P_u3kXNtent1nrw@mail.gmail.com>
	<7c6813e6-46d2-031a-63d9-016fff26b82b@draigBrady.com>
	<CAGWcZkKvCJWWrjbPEJR+Wv6nZ041NQn-adL7xJF8X5fEgEHEgQ@mail.gmail.com>
	<CAGWcZk+Mj+JenHk+NLg_ir0Ro75+fZ3ZXa4yQYQQxq4Bw01RTA@mail.gmail.com>
	<a9de8bf8-3981-bfe2-2f91-880bb46e179b@draigBrady.com>
From: Egmont Koblinger <egmont@gmail.com>
Date: Mon, 28 Aug 2017 17:03:53 +0200
Message-ID: <CAGWcZkJ_=hxwxDy2Dr629ziP7oVhw1rT0d4QaAoYf-XGFRx+wg@mail.gmail.com>
Subject: Re: Feature request: ls --hyperlink
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::234
Content-Type: text/plain; charset="UTF-8"
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: Mon, 28 Aug 2017 15:04:38 -0000

> Yes a bit lighter underlining is a small improvement,
> but it still would mean I wouldn't enable it by default.
>

Unless the main developer objects, I'll make the underline lighter as per
https://bugzilla.gnome.org/show_bug.cgi?id=786912. That would change it in
all hyperlink-enabled VTE-based emulators, which as the time we speak means
GNOME Terminal and Tilix. I haven't seen this feature working on iTerm2 yet
as I don't have access to a Mac, I don't know how it looks there.

For the rest, I really think we should wait until this feature gets widely
adopted and users start sending valuable feedback.

[...] but bad in the ls case since they don't add any info.
>

As long as "ls" is the only utility we care about, this could probably be
true. However, I imagine that _some_ of "stat", "grep", "find", "gcc" and
others might also eventlually add hyperlink support. And then it's not
feasible for users to keep in mind which ones do and which ones don't (or
just not configured right now to do, or omitted right now because the
output was piped through a filter). I'd much rather the terminal emulator
explicitly helps users here.

The bottom line is still: I'm not convinced that you are right here, just
as much as I'm not convinced that I am right either :-) I'd really push out
what we have now as-is and wait for users' feedback.

cheers,
e.

From MAILER-DAEMON Mon Aug 28 19:08:39 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmT95-0007hA-Lx
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 19:08:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36349)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dmT93-0007h0-0d
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:08:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dmT8y-0000P9-1p
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:08:37 -0400
Received: from mout.kundenserver.de ([212.227.126.133]:57892)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dmT8x-0000Ok-Mk
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:08:31 -0400
Received: from [192.168.101.10] ([91.12.163.59]) by mrelayeu.kundenserver.de
	(mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0LwAO6-1dS2s63UyM-017zi4; Tue, 29 Aug 2017 01:08:28 +0200
Subject: Re: New utility suggestion: chdir(1)
To: Colin Watson <cjwatson@debian.org>, =?UTF-8?Q?P=c3=a1draig_Brady?=
	<P@draigBrady.com>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
Cc: coreutils@gnu.org
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
Date: Tue, 29 Aug 2017 01:08:28 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:LsQ/U7Zbky+P4svWbApaYaUhnXI3P2hLKkfwoxbb0Kq7lptr5RJ
	Qn4Xbqx+4xPvhG23KzRgYE3Wh1pCgYPXFmA7guDjWpW7QAfu0gMaH5XOqfXMOKPhiqERO17
	oxPuVEx3BONM0ybngyjOZ1bNb1c8Bky8pRg/B7LSi3M4Cbi33UeV78gG56ilLDtppEFgdFk
	feiS6552tst56suORlHNw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:L903RK8xf8c=:aGtranyRGgKTxZaqKFKWqE
	LgglZ8O1kQkDSY8hZDC5QyIsb7WNJwOiaZNmaQH0GKNnqlDlUSjQNzWBFhMcMz/T67cFTX0gX
	khTI+909LdA+NObPxszq1QuVC4qC3rhMVM+1EaEbp87IVmlDI+1pQE5/A+LA9Mo4utLde/4tv
	c6QKN5IuXXaNUSCL/0RWLMNFt9JC9C5g0bdYr2PZqXBoPYSqPogqkfuHBLotx/n9JHlkQz6Tm
	y1OWUc+WREc9d4Eq3EZAlJe5QCMtsmJ8uQ5x/9TJGVxvDQEwh6msjQ8G/R0XnOQBb6WjSyzLA
	gLg85NukVM2DKiGlGO5ZSQ6CBC6daNOnDnbpz/eqgU3oBUIctRg/8z5sV7VSo9937JPW/GCH/
	eUeMfA8voMDDF8wL85LyCWR6kADoENEvuzCZQck9oWaRjVNnm2fRFp7ynMNYCadOYOeA9rgdX
	+DxzI3/CAdtexfXmBRb+0vyUSbOmyqzbAT4GA8eKboGMMSg9blcVY5czLRLh/yvVsVIrciHH8
	b4O3UFELfGoHv4ayxf4o4z5H5krcOLff35G0XH/Dm6llLVjUOi+kGVAmoXKXDLichs/NHqZyN
	JKJefotvX0eSeNxiG5FwKG0oTFF2FYWo4zOtfvTuD+SMEYVbzW9oBIFdwrtQs35IZHG6UXX8M
	Eu77yZ1ECV0ad1B+YEyfZv3j7wieGV7Ty0zYMQajXJNiaQMl6X/RFSFa/YxIZewb26tH8mcfm
	g0Yx+DRls9Wk34wOLFsOpuvge1GX7zkg1KnepcJFFiaI1AYsxYCZUATvvGE=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.133
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, 28 Aug 2017 23:08:38 -0000

On 08/27/2017 09:23 AM, Colin Watson wrote:
> From 0a74257b9fb7e02587b6c5553d8bc1b536249a7e Mon Sep 17 00:00:00 2001
> From: Colin Watson <cjwatson@debian.org>
> Date: Sun, 27 Aug 2017 08:16:21 +0100
> Subject: [PATCH] env: add --chdir option
> 
> This is useful when chaining with other commands that run commands in a
> different context.
> 
> * NEWS (New features): Document the new option.
> * doc/coreutils.texi (env invocation): Likewise.
> * src/env.c (usage): Likewise.
> (main): Implement the new option.
> * tests/misc/env.sh: Test the new option.
> ---
>  NEWS               |  3 +++
>  doc/coreutils.texi | 17 +++++++++++++++++
>  src/env.c          | 20 ++++++++++++++++++++
>  tests/misc/env.sh  | 10 +++++++++-
>  4 files changed, 49 insertions(+), 1 deletion(-)
> 
> diff --git a/NEWS b/NEWS
> index d37195e..60d5ca5 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -86,6 +86,9 @@ GNU coreutils NEWS                                    -*- outline -*-
>  
>    expr supports multibyte strings for all string operations.
>  
> +  env now has a --chdir option to change to a new working directory before
> +  executing the subsidiary program.
> +

To me (as non-native), "new working directory" might sound like the
directory may be created at the same time, doesn't it?
Maybe
  s/to change to a new working directory/to change the working directory/
?

>  ** Improvements
>  
>    mv --verbose now distinguishes rename and copy operations.
> diff --git a/doc/coreutils.texi b/doc/coreutils.texi
> index 8f1cb4c..f127517 100644
> --- a/doc/coreutils.texi
> +++ b/doc/coreutils.texi
> @@ -16909,6 +16909,23 @@ environment.
>  @opindex --ignore-environment
>  Start with an empty environment, ignoring the inherited environment.
>  
> +@item --chdir=@var{dir}
> +@opindex --chdir
> +Change the working directory to @var{dir} before invoking @var{command}.
> +This differs from the shell built-in @command{cd} in that it starts
> +@var{command} as a subprocess rather than altering the shell's own working
> +directory; this allows it to be chained with other commands that run commands
> +in a different context.  For example:
> +
> +@example
> +# Run 'true' with /chroot as its root directory and /srv as its working
> +# directory.
> +chroot /chroot env --chdir=/srv true
> +# Run 'true' with /build as its working directory, FOO=bar in its
> +# environment, and a time limit of five seconds.
> +env --chdir=/build FOO=bar timeout 5 true
> +@end example
> +
>  @end table
>  
>  @cindex exit status of @command{env}
> diff --git a/src/env.c b/src/env.c
> index 63d5c2c..291fbb4 100644
> --- a/src/env.c
> +++ b/src/env.c
> @@ -33,11 +33,19 @@
>    proper_name ("Richard Mlynarik"), \
>    proper_name ("David MacKenzie")
>  
> +/* For long options that have no equivalent short option, use a
> +   non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
> +enum
> +{
> +  CHDIR = CHAR_MAX + 1
> +};
> +
>  static struct option const longopts[] =
>  {
>    {"ignore-environment", no_argument, NULL, 'i'},
>    {"null", no_argument, NULL, '0'},
>    {"unset", required_argument, NULL, 'u'},
> +  {"chdir", required_argument, NULL, CHDIR},
>    {GETOPT_HELP_OPTION_DECL},
>    {GETOPT_VERSION_OPTION_DECL},
>    {NULL, 0, NULL, 0}
> @@ -63,6 +71,7 @@ Set each NAME to VALUE in the environment and run COMMAND.\n\
>    -i, --ignore-environment  start with an empty environment\n\
>    -0, --null           end each output line with NUL, not newline\n\
>    -u, --unset=NAME     remove variable from the environment\n\
> +      --chdir=DIR      change working directory to DIR\n\
>  "), stdout);
>        fputs (HELP_OPTION_DESCRIPTION, stdout);
>        fputs (VERSION_OPTION_DESCRIPTION, stdout);
> @@ -81,6 +90,7 @@ main (int argc, char **argv)
>    int optc;
>    bool ignore_environment = false;
>    bool opt_nul_terminate_output = false;
> +  char const *newdir = NULL;
>  
>    initialize_main (&argc, &argv);
>    set_program_name (argv[0]);
> @@ -103,6 +113,9 @@ main (int argc, char **argv)
>          case '0':
>            opt_nul_terminate_output = true;
>            break;
> +	case CHDIR:
> +	  newdir = optarg;
> +	  break;

Please use tab-free indentation as throughout the whole coreutils
sources.

>          case_GETOPT_HELP_CHAR;
>          case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
>          default:
> @@ -154,6 +167,13 @@ main (int argc, char **argv)
>        usage (EXIT_CANCELED);
>      }
>  
> +  if (newdir)
> +    {
> +      if (chdir (newdir) != 0)
> +	die (EXIT_CANCELED, errno, _("cannot change directory to %s"),
> +	     quoteaf (newdir));
> +    }
> +

Likewise.

>    execvp (argv[optind], &argv[optind]);
>  
>    int exit_status = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE;
> diff --git a/tests/misc/env.sh b/tests/misc/env.sh
> index f2f6ba8..c409630 100755
> --- a/tests/misc/env.sh
> +++ b/tests/misc/env.sh
> @@ -18,7 +18,7 @@
>  
>  
>  . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
> -print_ver_ env
> +print_ver_ env pwd
>  
>  # A simple shebang program to call "echo" from symlinks like "./-u" or "./--".
>  echo "#!$abs_top_builddir/src/echo simple_echo" > simple_echo \
> @@ -150,4 +150,12 @@ test "x$(sh -c '\c=d echo fail')" = xpass && #dash 0.5.4 fails so check first
>  returns_ 125 env -u a=b true || fail=1
>  returns_ 125 env -u '' true || fail=1
>  
> +# Verify changing directory.
> +mkdir empty || framework_failure_
> +returns_ 125 env --chdir=empty/nonexistent true || fail=1
> +curdir=$(env pwd) || fail=1
> +test "$curdir" = "$(pwd)" || fail=1

The above does not run CU's version of pwd, but instead
that of the shell.  The test therefore fails when "pwd -L"
!= "pwd -P" (and the implementation of coreutils and that
of the shell differs).

> +curdir=$(env --chdir=empty pwd) || fail=1
> +test "$curdir" = "$(cd empty && pwd)" || fail=1
> +
>  Exit $fail
> -- 

I therefore propose to squash in the following change:

diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index c409630..7c864cd 100755
--- a/tests/misc/env.sh
+++ b/tests/misc/env.sh
@@ -153,9 +153,8 @@ returns_ 125 env -u '' true || fail=1
 # Verify changing directory.
 mkdir empty || framework_failure_
 returns_ 125 env --chdir=empty/nonexistent true || fail=1
-curdir=$(env pwd) || fail=1
-test "$curdir" = "$(pwd)" || fail=1
-curdir=$(env --chdir=empty pwd) || fail=1
-test "$curdir" = "$(cd empty && pwd)" || fail=1
+exp=$(cd empty && env pwd) || framework_failure_
+got=$(env --chdir=empty pwd) || fail=1

Thanks & have a nice day,
Berny


From MAILER-DAEMON Mon Aug 28 19:11:13 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmTBY-0008Mi-WB
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 19:11:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37206)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dmTBV-0008Lx-LC
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:11:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dmTBQ-0001Zx-MR
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:11:09 -0400
Received: from mout.kundenserver.de ([212.227.126.131]:64926)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dmTBQ-0001XN-7a
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:11:04 -0400
Received: from [192.168.101.10] ([91.12.163.59]) by mrelayeu.kundenserver.de
	(mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0LwmZo-1dSavm0UQq-016QSr; Tue, 29 Aug 2017 01:11:02 +0200
Subject: Re: tail: unrecognized file system type 0x53464846
To: Sayed Mulkhan Fulkhani <fulkhani@gmail.com>, coreutils@gnu.org
References: <CADtYDdUGWDqFe1siKOPH+N20Df_0si8TnK8GOrmhBuuH+MO_hA@mail.gmail.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <ab454e9d-5108-a5a7-0338-1793328259ac@bernhard-voelker.de>
Date: Tue, 29 Aug 2017 01:11:01 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <CADtYDdUGWDqFe1siKOPH+N20Df_0si8TnK8GOrmhBuuH+MO_hA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:/rjWx/zAY8Q6JrMA2RiOyQCZSJSCnC78iF+od9kAZq0Ls3y5Qvy
	9LbUKBm/0Xfz0J9pA6pZXfNfabvPVb3n8mDV6v1gOkeyMUesvarW8rZXMrjzw2TK0b9Nv/T
	RZVbyDRtWqSW9IxhU+EhaR0cIPxLa4CUtyFoyuhSKOBdp2nzDgkO6FRviijiOSCl35ngc8V
	6P/ASxpbqTWQMZa5pTWBA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:hRlgP8n/3Cg=:zC3hDlwRRpVtvvCBu9LoTx
	DvV6oWWCGWIeo0SBlzvANZ5d1Wa3OF1vGL9g5IwohABLSIhYdjwbWG1ExyU2xrisLixJmUR9I
	AnHKLShnEB3nZiSSpgOe6TwmOQkc3HeivnS8FV0xXvrxqiiQ6A/aHdVJn/rC2WplkESXIxrGg
	953T8lp8M/NeInlh7CSWBhKzPGMEoSHsEiUrfnCiL9T8jbvU4QK5ozHuhn0+S8BmShMROCYQo
	p0wiihCcruw3uOLwkg7SMq4BQNLJLimGSbyabCPZ0CgLzL1P4nWih9FCqYy4SCR6RVS2RkSVS
	OjKDajJWblNvKxHz/BPDVgdGOLHAV9HmMCb/6NXYyET4pfLsXZQ1f1AXs/iKPIyBcNz82tqXb
	+tXPd7H+XT3H9+QSPWFNEHR5vKC2nOYXr3UEo5bM9CEMn1NbwCdfliwXFNT3MUQQK7aFFgUiX
	+tW07c38uNfiLAMF3JuiT6uxgkLK7O2INVPBwlr5WiLmObTf0/OvgavNSpTs5FnEc1gtnvfBR
	VEcFxy5qtC4aCAPk8yJQEb3T2YJCMtmci+wOReRUC+ojY0mvaCHWq5EiAckFmMgVJzDVQBUK9
	Bq+FFyqR4nhbkd3t+HtReQ7ROp4ccZ2ACYuSEMN20pu15+rAlkdaEOEZCb+jOgGGCpZ2VOb4N
	BdJ2Ep1+85NFd39jz/uRRY/ML659353ast+9vMMJuFOHAtJ4Bj6Ib/RiKLOLcjvTeJbvwdXqt
	YbzpMGfTf40/VUXW2UDlt++/PHASF8gtUPNOnFSIFIsRNar7IDDcmqJIWZg=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.131
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, 28 Aug 2017 23:11:12 -0000

On 08/21/2017 09:32 AM, Sayed Mulkhan Fulkhani wrote:
> tail: unrecognized file system type 0x53464846 for ‘make.txt’. please
> report this to bug-coreutils@gnu.org. reverting to polling

Thanks for the report, but a fix is already available in a newer
release (since v8.26, and now in v8.27).

Have a nice day,
Berny


From MAILER-DAEMON Mon Aug 28 19:24:55 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmTOp-0002Hu-EQ
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 19:24:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39967)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dmTOm-0002Bc-OM
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:24:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dmTOi-0000vp-RC
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:24:52 -0400
Received: from mout.kundenserver.de ([212.227.126.135]:49294)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dmTOi-0000vC-HG
	for coreutils@gnu.org; Mon, 28 Aug 2017 19:24:48 -0400
Received: from [192.168.101.10] ([91.12.163.59]) by mrelayeu.kundenserver.de
	(mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0LroEc-1dNcm324ze-013eY3; Tue, 29 Aug 2017 01:24:45 +0200
Subject: Re: coreutils-8.28 impending release
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Coreutils <coreutils@gnu.org>
References: <31de062d-36a4-9e9e-e5ab-82bdb7ef186b@draigBrady.com>
Cc: Bruno Haible <bruno@clisp.org>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <09d8ac36-2c85-21da-223d-fb4a0d577605@bernhard-voelker.de>
Date: Tue, 29 Aug 2017 01:24:44 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <31de062d-36a4-9e9e-e5ab-82bdb7ef186b@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:Qzy7BwNNA6wJ03ERi9aCPaX788AAyGSm2+fFG4vQGl+W5BTt80J
	7+1s3FSlVDEX21lLCPq0XiG5ijIq3+qJk+WhcM24gXL02KNpPnAShxFF9FNJgue+KaNULml
	tH5VadZXT2Re7q2IM7xzi3o410IFlGehD5RC19KMv2oqOSo/mlnkX4FI/SdshwgAFoQ+Drs
	PqDCFpXyhchVoNyZkpDMA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:ZI8FmuNndTw=:DbEzVWizDElseFdT85VgdZ
	SxnGCETilsE35ijb9TVpwPfnC97E1NstzOBAfPvbSBTN/gjPxfCi/mKnzTBxBSMVscBvHf1pJ
	1aGXsWAwRo90Yf+9IfDmmIsmoPCTw7Tr4bVW+XeJw6+xuZnBHltlWGGlASZEfFbtKClQfgTKB
	vI10yQ7ppJgzotcofycF6DoYzjSuRiFR/lMyQFE8V+am2jcTMpPUtwj2GfLW/0wNN8AWoc64/
	/geg2OLI7aJ47BzgmIoRpVWcbK78ock00lWWOm/KNE6hyTSIlLJ8x1rWRich53C5oTNn++wuG
	FJipb6df0AHSFoRW2ighyPPycHcYWSLAZszFJnPA1N4CwphSUYr39VZ33QrVRKzdGnzyxRYvK
	l8jIi2scndBzaromjuW98utp9IunPREKCS3VnBoxv+xwK9jjIxEWAZPl+d58kXFb1UAP84zlj
	IzhhPdJfj19MC0g55BxV8sjFXb2xjPY3yR2unDc7HYF9QnYpM0VYL5Qi00jejMYN8MUH/7Gkl
	COwMmAJqHHHWl96FrTEqGxLFmR/kIstSLEtcMav5NG0vt+/e+WtraLdT4yVBEFW9mFVF6mCex
	UTpev9SwPaTyzD0Ouq2NfbYG66MSFmsJpCCmI0HmVBTMKjOHWUEXiyjf4a8bqbG3i4TMVseMI
	2YFb/GgtoGt1med3srMt70ys9V8vqZ2FF9AEvSdtkkj0PEC5WAIH2PCAQh2BRlk3hlBzCP7XE
	d7W2FvYxivO4coLFXNZtbqMKpOt01EmzBVE9IUtFaU9d8ki359p9SfR8SII=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.135
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, 28 Aug 2017 23:24:53 -0000

On 08/22/2017 07:02 AM, Pádraig Brady wrote:
> If there is anything else outstanding please yell.

Well, only the unlucky discussion about

  [PATCH] df: avoid stat() for dummy file systems with -l

http://lists.gnu.org/archive/html/coreutils/2017-08/msg00013.html

I didn't have the time to look into it more, and it seems that
the situation won't change in the next couple of weeks.

Have a nice day,
Berny


From MAILER-DAEMON Mon Aug 28 22:52:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmWdT-0007U7-Ot
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 22:52:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56180)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmWdR-0007Ts-3X
	for coreutils@gnu.org; Mon, 28 Aug 2017 22:52:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmWdN-0000zc-VG
	for coreutils@gnu.org; Mon, 28 Aug 2017 22:52:13 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:35900)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmWdN-0000xe-Iy
	for coreutils@gnu.org; Mon, 28 Aug 2017 22:52:09 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 2C147977C;
	Tue, 29 Aug 2017 03:52:03 +0100 (IST)
Subject: Re: New utility suggestion: chdir(1)
To: Bernhard Voelker <mail@bernhard-voelker.de>,
	Colin Watson <cjwatson@debian.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
	<18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <80008221-8a9e-a684-6016-bb62e474cd18@draigBrady.com>
Date: Mon, 28 Aug 2017 19:52:00 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
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]
	[fuzzy]
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: Tue, 29 Aug 2017 02:52:14 -0000

On 28/08/17 16:08, Bernhard Voelker wrote:
> On 08/27/2017 09:23 AM, Colin Watson wrote:
>> From 0a74257b9fb7e02587b6c5553d8bc1b536249a7e Mon Sep 17 00:00:00 2001
>> From: Colin Watson <cjwatson@debian.org>
>> Date: Sun, 27 Aug 2017 08:16:21 +0100
>> Subject: [PATCH] env: add --chdir option
>>
>> This is useful when chaining with other commands that run commands in =
a
>> different context.
>>
>> * NEWS (New features): Document the new option.
>> * doc/coreutils.texi (env invocation): Likewise.
>> * src/env.c (usage): Likewise.
>> (main): Implement the new option.
>> * tests/misc/env.sh: Test the new option.
>> ---
>>  NEWS               |  3 +++
>>  doc/coreutils.texi | 17 +++++++++++++++++
>>  src/env.c          | 20 ++++++++++++++++++++
>>  tests/misc/env.sh  | 10 +++++++++-
>>  4 files changed, 49 insertions(+), 1 deletion(-)
>>
>> diff --git a/NEWS b/NEWS
>> index d37195e..60d5ca5 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -86,6 +86,9 @@ GNU coreutils NEWS                                  =
  -*- outline -*-
>> =20
>>    expr supports multibyte strings for all string operations.
>> =20
>> +  env now has a --chdir option to change to a new working directory b=
efore
>> +  executing the subsidiary program.
>> +
>=20
> To me (as non-native), "new working directory" might sound like the
> directory may be created at the same time, doesn't it?
> Maybe
>   s/to change to a new working directory/to change the working director=
y/
> ?

ack

>>  ** Improvements
>> =20
>>    mv --verbose now distinguishes rename and copy operations.
>> diff --git a/doc/coreutils.texi b/doc/coreutils.texi
>> index 8f1cb4c..f127517 100644
>> --- a/doc/coreutils.texi
>> +++ b/doc/coreutils.texi
>> @@ -16909,6 +16909,23 @@ environment.
>>  @opindex --ignore-environment
>>  Start with an empty environment, ignoring the inherited environment.
>> =20
>> +@item --chdir=3D@var{dir}
>> +@opindex --chdir
>> +Change the working directory to @var{dir} before invoking @var{comman=
d}.
>> +This differs from the shell built-in @command{cd} in that it starts
>> +@var{command} as a subprocess rather than altering the shell's own wo=
rking
>> +directory; this allows it to be chained with other commands that run =
commands
>> +in a different context.  For example:
>> +
>> +@example
>> +# Run 'true' with /chroot as its root directory and /srv as its worki=
ng
>> +# directory.
>> +chroot /chroot env --chdir=3D/srv true
>> +# Run 'true' with /build as its working directory, FOO=3Dbar in its
>> +# environment, and a time limit of five seconds.
>> +env --chdir=3D/build FOO=3Dbar timeout 5 true
>> +@end example
>> +
>>  @end table
>> =20
>>  @cindex exit status of @command{env}
>> diff --git a/src/env.c b/src/env.c
>> index 63d5c2c..291fbb4 100644
>> --- a/src/env.c
>> +++ b/src/env.c
>> @@ -33,11 +33,19 @@
>>    proper_name ("Richard Mlynarik"), \
>>    proper_name ("David MacKenzie")
>> =20
>> +/* For long options that have no equivalent short option, use a
>> +   non-character as a pseudo short option, starting with CHAR_MAX + 1=
.  */
>> +enum
>> +{
>> +  CHDIR =3D CHAR_MAX + 1
>> +};
>> +
>>  static struct option const longopts[] =3D
>>  {
>>    {"ignore-environment", no_argument, NULL, 'i'},
>>    {"null", no_argument, NULL, '0'},
>>    {"unset", required_argument, NULL, 'u'},
>> +  {"chdir", required_argument, NULL, CHDIR},
>>    {GETOPT_HELP_OPTION_DECL},
>>    {GETOPT_VERSION_OPTION_DECL},
>>    {NULL, 0, NULL, 0}
>> @@ -63,6 +71,7 @@ Set each NAME to VALUE in the environment and run CO=
MMAND.\n\
>>    -i, --ignore-environment  start with an empty environment\n\
>>    -0, --null           end each output line with NUL, not newline\n\
>>    -u, --unset=3DNAME     remove variable from the environment\n\
>> +      --chdir=3DDIR      change working directory to DIR\n\
>>  "), stdout);
>>        fputs (HELP_OPTION_DESCRIPTION, stdout);
>>        fputs (VERSION_OPTION_DESCRIPTION, stdout);
>> @@ -81,6 +90,7 @@ main (int argc, char **argv)
>>    int optc;
>>    bool ignore_environment =3D false;
>>    bool opt_nul_terminate_output =3D false;
>> +  char const *newdir =3D NULL;
>> =20
>>    initialize_main (&argc, &argv);
>>    set_program_name (argv[0]);
>> @@ -103,6 +113,9 @@ main (int argc, char **argv)
>>          case '0':
>>            opt_nul_terminate_output =3D true;
>>            break;
>> +	case CHDIR:
>> +	  newdir =3D optarg;
>> +	  break;
>=20
> Please use tab-free indentation as throughout the whole coreutils
> sources.

ack (make syntax-check catches this)


>>          case_GETOPT_HELP_CHAR;
>>          case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
>>          default:
>> @@ -154,6 +167,13 @@ main (int argc, char **argv)
>>        usage (EXIT_CANCELED);
>>      }
>> =20
>> +  if (newdir)
>> +    {
>> +      if (chdir (newdir) !=3D 0)
>> +	die (EXIT_CANCELED, errno, _("cannot change directory to %s"),
>> +	     quoteaf (newdir));
>> +    }
>> +
>=20
> Likewise.
>=20
>>    execvp (argv[optind], &argv[optind]);
>> =20
>>    int exit_status =3D errno =3D=3D ENOENT ? EXIT_ENOENT : EXIT_CANNOT=
_INVOKE;
>> diff --git a/tests/misc/env.sh b/tests/misc/env.sh
>> index f2f6ba8..c409630 100755
>> --- a/tests/misc/env.sh
>> +++ b/tests/misc/env.sh
>> @@ -18,7 +18,7 @@
>> =20
>> =20
>>  . "${srcdir=3D.}/tests/init.sh"; path_prepend_ ./src
>> -print_ver_ env
>> +print_ver_ env pwd
>> =20
>>  # A simple shebang program to call "echo" from symlinks like "./-u" o=
r "./--".
>>  echo "#!$abs_top_builddir/src/echo simple_echo" > simple_echo \
>> @@ -150,4 +150,12 @@ test "x$(sh -c '\c=3Dd echo fail')" =3D xpass && =
#dash 0.5.4 fails so check first
>>  returns_ 125 env -u a=3Db true || fail=3D1
>>  returns_ 125 env -u '' true || fail=3D1
>> =20
>> +# Verify changing directory.
>> +mkdir empty || framework_failure_
>> +returns_ 125 env --chdir=3Dempty/nonexistent true || fail=3D1
>> +curdir=3D$(env pwd) || fail=3D1
>> +test "$curdir" =3D "$(pwd)" || fail=3D1
>=20
> The above does not run CU's version of pwd, but instead
> that of the shell.  The test therefore fails when "pwd -L"
> !=3D "pwd -P" (and the implementation of coreutils and that
> of the shell differs).
>=20
>> +curdir=3D$(env --chdir=3Dempty pwd) || fail=3D1
>> +test "$curdir" =3D "$(cd empty && pwd)" || fail=3D1
>> +
>>  Exit $fail
>> --=20
>=20
> I therefore propose to squash in the following change:
>=20
> diff --git a/tests/misc/env.sh b/tests/misc/env.sh
> index c409630..7c864cd 100755
> --- a/tests/misc/env.sh
> +++ b/tests/misc/env.sh
> @@ -153,9 +153,8 @@ returns_ 125 env -u '' true || fail=3D1
>  # Verify changing directory.
>  mkdir empty || framework_failure_
>  returns_ 125 env --chdir=3Dempty/nonexistent true || fail=3D1
> -curdir=3D$(env pwd) || fail=3D1
> -test "$curdir" =3D "$(pwd)" || fail=3D1
> -curdir=3D$(env --chdir=3Dempty pwd) || fail=3D1
> -test "$curdir" =3D "$(cd empty && pwd)" || fail=3D1
> +exp=3D$(cd empty && env pwd) || framework_failure_
> +got=3D$(env --chdir=3Dempty pwd) || fail=3D1

This is missing the `test`, but I'll change as you intended.

thanks!
P=E1draig


From MAILER-DAEMON Mon Aug 28 23:55:35 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmXcl-0002eQ-4p
	for mharc-coreutils@gnu.org; Mon, 28 Aug 2017 23:55:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42691)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmXci-0002d5-Gh
	for coreutils@gnu.org; Mon, 28 Aug 2017 23:55:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmXcf-0006tL-9g
	for coreutils@gnu.org; Mon, 28 Aug 2017 23:55:32 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:36094)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmXce-0006pp-Uv
	for coreutils@gnu.org; Mon, 28 Aug 2017 23:55:29 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 0BEF54503;
	Tue, 29 Aug 2017 04:55:23 +0100 (IST)
Subject: Re: New utility suggestion: chdir(1)
To: Bernhard Voelker <mail@bernhard-voelker.de>,
	Colin Watson <cjwatson@debian.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
	<18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
	<80008221-8a9e-a684-6016-bb62e474cd18@draigBrady.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <ce2ed123-b113-3c91-c8c8-34bbcfac5cad@draigBrady.com>
Date: Mon, 28 Aug 2017 20:55:21 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <80008221-8a9e-a684-6016-bb62e474cd18@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------CD8BC61827F7B7145A9FC1E7"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 29 Aug 2017 03:55:34 -0000

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

I'll push the attached shortly.
This supports -C and also requires specifying a command
when specifying -C, as otherwise you get confusing
output and no error with `env --chdir command` which would
just print the environment with the previous version.
It's of no functional value to print the env while
also changing dir as far as I can see.

cheers,
P=E1draig

--------------CD8BC61827F7B7145A9FC1E7
Content-Type: text/x-patch;
 name="env-C.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="env-C.patch"

=46rom 30ec7a6ade71fbed5589738a87ef70fd7fd1ec4d Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 27 Aug 2017 08:16:21 +0100
Subject: [PATCH] env: add --chdir option

This is useful when chaining with other commands that run commands in a
different context, while avoiding using the shell to cd, and thus
having to consider shell quoting the chained command.

* NEWS (New features): Document the new option.
* doc/coreutils.texi (env invocation): Likewise.
* src/env.c (usage): Likewise.
(main): Implement the new option.
* tests/misc/env.sh: Test the new option.
---
 NEWS               |  3 +++
 doc/coreutils.texi | 19 +++++++++++++++++++
 src/env.c          | 37 ++++++++++++++++++++++++++++++-------
 tests/misc/env.sh  | 15 ++++++++++++++-
 4 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index d37195e..65f99b7 100644
--- a/NEWS
+++ b/NEWS
@@ -84,6 +84,9 @@ GNU coreutils NEWS                                    -=
*- outline -*-
   split supports a new --hex-suffixes[=3Dfrom] option to create files wi=
th
   lower case hexadecimal suffixes, similar to the --numeric-suffixes opt=
ion.
=20
+  env now has a --chdir (-C) option to change the working directory befo=
re
+  executing the subsidiary program.
+
   expr supports multibyte strings for all string operations.
=20
 ** Improvements
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 8f1cb4c..bd34acf 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -16909,6 +16909,25 @@ environment.
 @opindex --ignore-environment
 Start with an empty environment, ignoring the inherited environment.
=20
+@item -C @var{dir}
+@itemx --chdir=3D@var{dir}
+@opindex -C
+@opindex --chdir
+Change the working directory to @var{dir} before invoking @var{command}.=

+This differs from the shell built-in @command{cd} in that it starts
+@var{command} as a subprocess rather than altering the shell's own worki=
ng
+directory; this allows it to be chained with other commands that run com=
mands
+in a different context.  For example:
+
+@example
+# Run 'true' with /chroot as its root directory and /srv as its working
+# directory.
+chroot /chroot env --chdir=3D/srv true
+# Run 'true' with /build as its working directory, FOO=3Dbar in its
+# environment, and a time limit of five seconds.
+env --chdir=3D/build FOO=3Dbar timeout 5 true
+@end example
+
 @end table
=20
 @cindex exit status of @command{env}
diff --git a/src/env.c b/src/env.c
index 63d5c2c..988b14d 100644
--- a/src/env.c
+++ b/src/env.c
@@ -38,6 +38,7 @@ static struct option const longopts[] =3D
   {"ignore-environment", no_argument, NULL, 'i'},
   {"null", no_argument, NULL, '0'},
   {"unset", required_argument, NULL, 'u'},
+  {"chdir", required_argument, NULL, 'C'},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
   {NULL, 0, NULL, 0}
@@ -64,6 +65,9 @@ Set each NAME to VALUE in the environment and run COMMA=
ND.\n\
   -0, --null           end each output line with NUL, not newline\n\
   -u, --unset=3DNAME     remove variable from the environment\n\
 "), stdout);
+      fputs (_("\
+  -C, --chdir=3DDIR      change working directory to DIR\n\
+"), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
@@ -81,6 +85,7 @@ main (int argc, char **argv)
   int optc;
   bool ignore_environment =3D false;
   bool opt_nul_terminate_output =3D false;
+  char const *newdir =3D NULL;
=20
   initialize_main (&argc, &argv);
   set_program_name (argv[0]);
@@ -91,7 +96,7 @@ main (int argc, char **argv)
   initialize_exit_failure (EXIT_CANCELED);
   atexit (close_stdout);
=20
-  while ((optc =3D getopt_long (argc, argv, "+iu:0", longopts, NULL)) !=3D=
 -1)
+  while ((optc =3D getopt_long (argc, argv, "+C:iu:0", longopts, NULL)) =
!=3D -1)
     {
       switch (optc)
         {
@@ -103,6 +108,9 @@ main (int argc, char **argv)
         case '0':
           opt_nul_terminate_output =3D true;
           break;
+        case 'C':
+          newdir =3D optarg;
+          break;
         case_GETOPT_HELP_CHAR;
         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
         default:
@@ -120,7 +128,7 @@ main (int argc, char **argv)
     }
=20
   optind =3D 0;			/* Force GNU getopt to re-initialize. */
-  while ((optc =3D getopt_long (argc, argv, "+iu:0", longopts, NULL)) !=3D=
 -1)
+  while ((optc =3D getopt_long (argc, argv, "+C:iu:0", longopts, NULL)) =
!=3D -1)
     if (optc =3D=3D 'u' && unsetenv (optarg))
       die (EXIT_CANCELED, errno, _("cannot unset %s"), quote (optarg));
=20
@@ -139,19 +147,34 @@ main (int argc, char **argv)
       optind++;
     }
=20
-  /* If no program is specified, print the environment and exit. */
-  if (argc <=3D optind)
+  bool program_specified =3D optind < argc;
+
+  if (opt_nul_terminate_output && program_specified)
     {
+      error (0, errno, _("cannot specify --null (-0) with command"));
+      usage (EXIT_CANCELED);
+    }
+
+  if (newdir && ! program_specified)
+    {
+      error (0, errno, _("must specify command with --chdir (-C)"));
+      usage (EXIT_CANCELED);
+    }
+
+  if (! program_specified)
+    {
+      /* Print the environment and exit. */
       char *const *e =3D environ;
       while (*e)
         printf ("%s%c", *e++, opt_nul_terminate_output ? '\0' : '\n');
       return EXIT_SUCCESS;
     }
=20
-  if (opt_nul_terminate_output)
+  if (newdir)
     {
-      error (0, errno, _("cannot specify --null (-0) with command"));
-      usage (EXIT_CANCELED);
+      if (chdir (newdir) !=3D 0)
+        die (EXIT_CANCELED, errno, _("cannot change directory to %s"),
+             quoteaf (newdir));
     }
=20
   execvp (argv[optind], &argv[optind]);
diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index f2f6ba8..fc589cc 100755
--- a/tests/misc/env.sh
+++ b/tests/misc/env.sh
@@ -18,7 +18,7 @@
=20
=20
 . "${srcdir=3D.}/tests/init.sh"; path_prepend_ ./src
-print_ver_ env
+print_ver_ env pwd
=20
 # A simple shebang program to call "echo" from symlinks like "./-u" or "=
=2E/--".
 echo "#!$abs_top_builddir/src/echo simple_echo" > simple_echo \
@@ -150,4 +150,17 @@ test "x$(sh -c '\c=3Dd echo fail')" =3D xpass && #da=
sh 0.5.4 fails so check first
 returns_ 125 env -u a=3Db true || fail=3D1
 returns_ 125 env -u '' true || fail=3D1
=20
+# Verify changing directory.
+mkdir empty || framework_failure_
+returns_ 125 env --chdir=3Dempty/nonexistent true || fail=3D1
+returns_ 125 env -C empty 2>out || fail=3D1
+printf '%s\n' \
+  'env: must specify command with --chdir (-C)' \
+  "Try 'env --help' for more information." > exp ||
+  framework_failure_
+compare exp out || fail=3D1
+exp=3D$(cd empty && env pwd) || framework_failure_
+got=3D$(env --chdir=3Dempty pwd) || fail=3D1
+test "$exp" =3D "$got" || fail=3D1
+
 Exit $fail
--=20
2.9.3


--------------CD8BC61827F7B7145A9FC1E7--


From MAILER-DAEMON Tue Aug 29 00:18:23 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmXyp-0006vu-6H
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 00:18:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46288)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dmXyn-0006vn-QH
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:18:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dmXym-0003bR-Ld
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:18:21 -0400
Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]:35624)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dmXym-0003aR-GS
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:18:20 -0400
Received: by mail-qt0-x232.google.com with SMTP id x36so10414192qtx.2
	for <coreutils@gnu.org>; Mon, 28 Aug 2017 21:18:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=EZCPLityk4BNU+IoQxT7MvSCpJCvCEEg99uvyFEQhkU=;
	b=mCbojei1XAuvYuiB3pDJikxmc6/CUlwnbPwrggcPHQ5dqjRxtimoleTDEG1yqGUKQu
	aln8V8fCyexhY5P+TP8u1EnHplYBzNevPwKcg7aIipA/RwogLfFdTcSwOROoFRDkj+89
	5CQQoyid2cSocXgsnoUPUa+/u9HDvDAYP1avQdYwrzExvfL3f7nFVQZl/HSbAx7zJURo
	touQgtgclgKz//q5AQJdUEw0pqAzAUn/IzMiwPVwsj1aOwbeFnkxGyT2uURBchCZ6NFw
	xeiCrfyh3OV6tmOmJ6I+vvVuImYRd+A7rCXMfFwLKJrLJ92Vd0qsMkhZ1RBr1PXMl6re
	69Pw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=EZCPLityk4BNU+IoQxT7MvSCpJCvCEEg99uvyFEQhkU=;
	b=LXuXQ2wSi3IWaMtCavvTy1JjW2/+eQJC2M1ZG1ptbila+TmAjDDN9nAuuGs7/PGh2t
	D7wubCXlWcYPk2VaJp/LT3QuKDwLwsr6R5Okk3YLvW7/nWwOD2RBs2ZNKWEUWK/8wnvW
	zkjX6+WhxZl0Z9x1s4ZMu6KGy9OpSujGLSRLkIzWxfsDL/amm8cdte5XpRA8j6beyyu6
	STxVke7GyX0bJLN+Xmv87/YEaARbFHuh827+FVYn9RkeugndAd7ks/s/uQKCR8s4hol2
	A+ErY8EYiE301ZU+34671s84Iu6JmzQkig2W3Ra5VUKaCyODIJdxkiGPO2qLYCZz4QEy
	13bQ==
X-Gm-Message-State: AHYfb5gQ5R1lBi8b+eRl2vJvosWx9o21P5vDNozeMjat/KSQTPccnO5r
	YZVxhN3STEOsylvIqzij6LwrPgYPvNe8
X-Received: by 10.237.63.189 with SMTP id s58mr4417424qth.84.1503980298628;
	Mon, 28 Aug 2017 21:18:18 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.55.46.66 with HTTP; Mon, 28 Aug 2017 21:17:57 -0700 (PDT)
In-Reply-To: <ce2ed123-b113-3c91-c8c8-34bbcfac5cad@draigBrady.com>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
	<18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
	<80008221-8a9e-a684-6016-bb62e474cd18@draigBrady.com>
	<ce2ed123-b113-3c91-c8c8-34bbcfac5cad@draigBrady.com>
From: Jim Meyering <jim@meyering.net>
Date: Mon, 28 Aug 2017 21:17:57 -0700
X-Google-Sender-Auth: P55RFviGYNoexPK8DrzyexIw1rA
Message-ID: <CA+8g5KFviLrd-XkhAEjTJQtOnaqe-6AJ5qu0WmEe1D0KCYVKVw@mail.gmail.com>
Subject: Re: New utility suggestion: chdir(1)
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Bernhard Voelker <mail@bernhard-voelker.de>,
	Colin Watson <cjwatson@debian.org>, Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400d:c0d::232
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, 29 Aug 2017 04:18:22 -0000

On Mon, Aug 28, 2017 at 8:55 PM, P=C3=A1draig Brady <P@draigbrady.com> wrot=
e:
> I'll push the attached shortly.
> This supports -C and also requires specifying a command
> when specifying -C, as otherwise you get confusing
> output and no error with `env --chdir command` which would
> just print the environment with the previous version.
> It's of no functional value to print the env while
> also changing dir as far as I can see.

Thanks for working on that. Nits in env.c:

  +  if (opt_nul_terminate_output && program_specified)
       {
  +      error (0, errno, _("cannot specify --null (-0) with command"));
  +      usage (EXIT_CANCELED);
  +    }
  +
  +  if (newdir && ! program_specified)
  +    {
  +      error (0, errno, _("must specify command with --chdir (-C)"));
  +      usage (EXIT_CANCELED);
  +    }

Each of those uses of "errno" should be "0".


From MAILER-DAEMON Tue Aug 29 00:24:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmY4u-00084d-0C
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 00:24:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47328)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmY4s-00084W-EU
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:24:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmY4n-00071Z-Hh
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:24:38 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39074)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmY4n-000704-BO
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:24:33 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 363EA4AB3
	for <coreutils@gnu.org>; Tue, 29 Aug 2017 05:24:31 +0100 (IST)
Subject: Re: New utility suggestion: chdir(1)
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
	<18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
	<80008221-8a9e-a684-6016-bb62e474cd18@draigBrady.com>
	<ce2ed123-b113-3c91-c8c8-34bbcfac5cad@draigBrady.com>
	<CA+8g5KFviLrd-XkhAEjTJQtOnaqe-6AJ5qu0WmEe1D0KCYVKVw@mail.gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <30b63e90-3ca6-131c-566c-eada307d9a81@draigBrady.com>
Date: Mon, 28 Aug 2017 21:24:29 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CA+8g5KFviLrd-XkhAEjTJQtOnaqe-6AJ5qu0WmEe1D0KCYVKVw@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]
	[fuzzy]
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: Tue, 29 Aug 2017 04:24:39 -0000

On 28/08/17 21:17, Jim Meyering wrote:
> On Mon, Aug 28, 2017 at 8:55 PM, P=C3=A1draig Brady <P@draigbrady.com> =
wrote:
>> I'll push the attached shortly.
>> This supports -C and also requires specifying a command
>> when specifying -C, as otherwise you get confusing
>> output and no error with `env --chdir command` which would
>> just print the environment with the previous version.
>> It's of no functional value to print the env while
>> also changing dir as far as I can see.
>=20
> Thanks for working on that. Nits in env.c:
>=20
>   +  if (opt_nul_terminate_output && program_specified)
>        {
>   +      error (0, errno, _("cannot specify --null (-0) with command"))=
;
>   +      usage (EXIT_CANCELED);
>   +    }
>   +
>   +  if (newdir && ! program_specified)
>   +    {
>   +      error (0, errno, _("must specify command with --chdir (-C)"));
>   +      usage (EXIT_CANCELED);
>   +    }
>=20
> Each of those uses of "errno" should be "0".
>=20

nice catch. adjusted


From MAILER-DAEMON Tue Aug 29 00:28:18 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmY8Q-0000FM-CL
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 00:28:18 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47913)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmY8O-0000FD-Gz
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:28:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmY8J-0001AC-JV
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:28:16 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39088)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmY8J-00019w-Cp
	for coreutils@gnu.org; Tue, 29 Aug 2017 00:28:11 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 F3A014AB8
	for <coreutils@gnu.org>; Tue, 29 Aug 2017 05:28:09 +0100 (IST)
To: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Subject: [PATCH] doc: remove older ChangeLog items
Message-ID: <30a2ce1c-eeba-5922-06d9-e0c24cd7bd57@draigBrady.com>
Date: Mon, 28 Aug 2017 21:28:08 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
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]
	[fuzzy]
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: Tue, 29 Aug 2017 04:28:17 -0000

commit 01e2b079b6d415200b41052a6e8f9ef16f6cb4ea
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Mon Aug 28 21:09:08 2017 -0700

    doc: remove older ChangeLog items

    This saves about 0.5MB uncompressed from the tarball.

    * Makefile.am: Following on from v8.26-34-g2c64bc8
    update the oldest documented version to 8.18 which
    is now about 5 years old.  Also remove older ChangeLogs
    that were previously thought to be for changes not
    in the git history, but are adequately recorded upon review.
    * build-aux/ChangeLog-2007: Remove file.
    * lib/ChangeLog-2007: Likewise.
    * m4/ChangeLog-2007: Likewise.

diff --git a/Makefile.am b/Makefile.am
index 396112f..1c58fa5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,13 +19,7 @@ ALL_RECURSIVE_TARGETS =3D

 SUBDIRS =3D po . gnulib-tests

-changelog_etc =3D                                \
-  build-aux/ChangeLog-2007             \
-  lib/ChangeLog-2007                   \
-  m4/ChangeLog-2007
-
 EXTRA_DIST =3D                           \
-  $(changelog_etc)                     \
   .mailmap                             \
   .prev-version                                \
   .version                             \
@@ -99,7 +93,7 @@ dist-hook: gen-ChangeLog
        $(AM_V_at)touch $(distdir)/doc/constants.texi \
          $(distdir)/doc/coreutils.info

-gen_start_ver =3D 8.15
+gen_start_ver =3D 8.18
 .PHONY: gen-ChangeLog


From MAILER-DAEMON Tue Aug 29 01:05:58 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmYis-0007sx-4v
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 01:05:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52342)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmYim-0007sV-PC
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:05:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmYij-00068K-FG
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:05:52 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39216)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmYij-00067i-5h
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:05:49 -0400
Received: from localhost.net (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 892A794AA;
	Tue, 29 Aug 2017 06:05:46 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: don't fail tests when failing to write here docs
Date: Mon, 28 Aug 2017 22:05:39 -0700
Message-Id: <20170829050539.3914-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 29 Aug 2017 05:05:56 -0000

* tests/sample-test: Use framework_error_ rather than fail=1
* tests/chown/deref.sh: Likewise.
* tests/chown/preserve-root.sh: Likewise.
* tests/cp/src-base-dot.sh: Likewise.
* tests/dd/unblock-sync.sh: Likewise.
* tests/du/2g.sh: Likewise.
* tests/du/inacc-dest.sh: Likewise.
* tests/du/one-file-system.sh: Likewise.
* tests/fmt/goal-option.sh: Likewise.
* tests/ln/hard-backup.sh: Likewise.
* tests/ls/color-dtype-dir.sh: Likewise.
* tests/ls/m-option.sh: Likewise.
* tests/ls/stat-dtype.sh: Likewise.
* tests/ls/time-style-diag.sh: Likewise.
* tests/ls/x-option.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/nohup.sh: Likewise.
* tests/misc/od-N.sh: Likewise.
* tests/misc/sort-compress.sh: Likewise.
* tests/misc/tac-continue.sh: Likewise.
* tests/misc/time-style.sh: Likewise.
* tests/mv/backup-dir.sh: Likewise.
* tests/mv/dir2dir.sh: Likewise.
* tests/rm/dir-no-w.sh: Likewise.
* tests/rm/dir-nonrecur.sh: Likewise.
* tests/rm/inaccessible.sh: Likewise.
* tests/rm/interactive-always.sh: Likewise.
* tests/rm/interactive-once.sh: Likewise.
* tests/rm/rm3.sh: Likewise.
* tests/rm/v-slash.sh: Likewise.
* tests/touch/relative.sh: Likewise.
---
 tests/chown/deref.sh           |  2 +-
 tests/chown/preserve-root.sh   |  6 +++---
 tests/cp/src-base-dot.sh       |  6 +-----
 tests/dd/unblock-sync.sh       |  2 +-
 tests/du/2g.sh                 |  2 +-
 tests/du/inacc-dest.sh         |  2 +-
 tests/du/one-file-system.sh    | 12 ++++++------
 tests/fmt/goal-option.sh       |  4 ++--
 tests/ln/hard-backup.sh        |  2 +-
 tests/ls/color-dtype-dir.sh    | 10 +++++-----
 tests/ls/m-option.sh           |  2 +-
 tests/ls/stat-dtype.sh         |  5 ++---
 tests/ls/time-style-diag.sh    |  2 +-
 tests/ls/x-option.sh           |  2 +-
 tests/misc/chcon.sh            |  4 ++--
 tests/misc/nohup.sh            |  4 ++--
 tests/misc/od-N.sh             |  2 +-
 tests/misc/sort-compress.sh    |  2 +-
 tests/misc/tac-continue.sh     |  2 +-
 tests/misc/time-style.sh       |  6 +++---
 tests/mv/backup-dir.sh         |  2 +-
 tests/mv/dir2dir.sh            |  2 +-
 tests/rm/dir-no-w.sh           |  2 +-
 tests/rm/dir-nonrecur.sh       |  2 +-
 tests/rm/inaccessible.sh       |  2 +-
 tests/rm/interactive-always.sh |  8 ++++----
 tests/rm/interactive-once.sh   |  6 ++----
 tests/rm/rm3.sh                |  6 +++---
 tests/rm/v-slash.sh            |  2 +-
 tests/sample-test              |  2 +-
 tests/touch/relative.sh        |  2 +-
 31 files changed, 54 insertions(+), 61 deletions(-)

diff --git a/tests/chown/deref.sh b/tests/chown/deref.sh
index 4c8628d..87c2027 100755
--- a/tests/chown/deref.sh
+++ b/tests/chown/deref.sh
@@ -29,7 +29,7 @@ set _ $(ls -ldo dangle); shift; user=$3
 chown --dereference $user dangle 2> out1 && fail=1
 sed 's/: [^:]*$//' out1 > out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 chown: cannot dereference 'dangle'
 EOF
 
diff --git a/tests/chown/preserve-root.sh b/tests/chown/preserve-root.sh
index 76d0a3f..d5c370f 100755
--- a/tests/chown/preserve-root.sh
+++ b/tests/chown/preserve-root.sh
@@ -37,16 +37,16 @@ chmod -R --preserve-root u+r / >> out 2>&1 && fail=1
 # With -RHh, --preserve-root should trigger nothing,
 # since the symlink in question is not a command line argument.
 # Contrary to the above commands, these two should succeed.
-echo '==== test -RHh' >> out
+echo '==== test -RHh' >> out || framework_failure_
 chown -RHh --preserve-root $(id -u) d >> out 2>&1 || fail=1
 chgrp -RHh --preserve-root $(id -g) d >> out 2>&1 || fail=1
 
 # These must fail.
-echo '==== test -RLh' >> out
+echo '==== test -RLh' >> out || framework_failure_
 chown -RLh --preserve-root $(id -u) d >> out 2>&1 && fail=1
 chgrp -RLh --preserve-root $(id -g) d >> out 2>&1 && fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 chown: it is dangerous to operate recursively on '/'
 chown: use --no-preserve-root to override this failsafe
 chgrp: it is dangerous to operate recursively on '/'
diff --git a/tests/cp/src-base-dot.sh b/tests/cp/src-base-dot.sh
index dfa3acd..7acd5de 100755
--- a/tests/cp/src-base-dot.sh
+++ b/tests/cp/src-base-dot.sh
@@ -21,12 +21,8 @@ print_ver_ cp
 
 mkdir x y || framework_failure_
 
-
 cd y
 cp --verbose -ab ../x/. . > out 2>&1 || fail=1
-cat <<\EOF > exp || fail=1
-EOF
-
-compare exp out || fail=1
+compare /dev/null out || fail=1
 
 Exit $fail
diff --git a/tests/dd/unblock-sync.sh b/tests/dd/unblock-sync.sh
index 0ae6442..4c0786b 100755
--- a/tests/dd/unblock-sync.sh
+++ b/tests/dd/unblock-sync.sh
@@ -23,7 +23,7 @@ printf 000100020003xx > in || framework_failure_
 
 
 dd cbs=4 ibs=4 conv=unblock,sync < in > out 2> /dev/null || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 0001
 0002
 0003
diff --git a/tests/du/2g.sh b/tests/du/2g.sh
index e3045b3..3a74d2f 100755
--- a/tests/du/2g.sh
+++ b/tests/du/2g.sh
@@ -62,7 +62,7 @@ du -k $big > out1 || fail=1
 rm -f $big
 sed 's/^2[0-9][0-9][0-9][0-9][0-9][0-9]	'$big'$/~2M/' out1 > out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ~2M
 EOF
 
diff --git a/tests/du/inacc-dest.sh b/tests/du/inacc-dest.sh
index 2d54397..f9144ba 100755
--- a/tests/du/inacc-dest.sh
+++ b/tests/du/inacc-dest.sh
@@ -33,7 +33,7 @@ du > ../t 2>&1 && fail=1
 # /proc support, nor native openat support.
 
 sed 's/^[0-9][0-9]*	//' ../t | sort -u > out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 .
 ./a
 ./b
diff --git a/tests/du/one-file-system.sh b/tests/du/one-file-system.sh
index e21c90c..7c6436a 100755
--- a/tests/du/one-file-system.sh
+++ b/tests/du/one-file-system.sh
@@ -28,8 +28,8 @@ ln -s "$other_partition_tmpdir/x" d || framework_failure_
 # would not traverse into second and subsequent directories listed
 # on the command line.
 du -ax b y > t || fail=1
-sed 's/^[0-9][0-9]*	//' t > out
-cat <<\EOF > exp || fail=1
+sed 's/^[0-9][0-9]*	//' t > out || framework_failure_
+cat <<\EOF > exp || framework_failure_
 b/c
 b
 y/z
@@ -41,16 +41,16 @@ compare exp out || fail=1
 # "du -xL" reported a zero count for a file in a different file system,
 # instead of ignoring it.
 du -xL d > u || fail=1
-sed 's/^[0-9][0-9]*	//' u > out1
-echo d > exp1 || fail=1
+sed 's/^[0-9][0-9]*	//' u > out1 || framework_failure_
+echo d > exp1 || framework_failure_
 compare exp1 out1 || fail=1
 
 # With coreutils-8.15, "du -xs FILE" would print no output.
 touch f
 for opt in -x -xs; do
   du $opt f > u || fail=1
-  sed 's/^[0-9][0-9]*	//' u > out2
-  echo f > exp2 || fail=1
+  sed 's/^[0-9][0-9]*	//' u > out2 || framework_failure_
+  echo f > exp2 || framework_failure_
   compare exp2 out2 || fail=1
 done
 
diff --git a/tests/fmt/goal-option.sh b/tests/fmt/goal-option.sh
index 1ebf714..eda086b 100755
--- a/tests/fmt/goal-option.sh
+++ b/tests/fmt/goal-option.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ fmt
 
-cat <<\_EOF_ > base || fail=1
+cat <<\_EOF_ > base || framework_failure_
 
 @command{fmt} prefers breaking lines at the end of a sentence, and tries to
 avoid line breaks after the first word of a sentence or before the last word
@@ -36,7 +36,7 @@ _EOF_
 
 fmt -g 60 -w 72 base > out || fail=1
 
-cat <<\_EOF_ > exp
+cat <<\_EOF_ > exp || framework_failure_
 
 @command{fmt} prefers breaking lines at the end of a sentence,
 and tries to avoid line breaks after the first word of a sentence
diff --git a/tests/ln/hard-backup.sh b/tests/ln/hard-backup.sh
index a983292..53e5917 100755
--- a/tests/ln/hard-backup.sh
+++ b/tests/ln/hard-backup.sh
@@ -23,7 +23,7 @@ touch f || framework_failure_
 
 
 ln --backup f f 2> out && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ln: 'f' and 'f' are the same file
 EOF
 
diff --git a/tests/ls/color-dtype-dir.sh b/tests/ls/color-dtype-dir.sh
index dc5f2db..6a71bb9 100755
--- a/tests/ls/color-dtype-dir.sh
+++ b/tests/ls/color-dtype-dir.sh
@@ -31,10 +31,10 @@ chmod o+t sticky || framework_failure_
 
 
 TERM=xterm ls --color=always > out || fail=1
-cat -A out > o1 || fail=1
-mv o1 out || fail=1
+cat -A out > o1 || framework_failure_
+mv o1 out || framework_failure_
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ^[[0m^[[01;34md^[[0m$
 ^[[34;42mother-writable^[[0m$
 out$
@@ -43,7 +43,7 @@ EOF
 
 compare exp out || fail=1
 
-rm exp
+rm exp || framework_failure_
 
 # Turn off colors for other-writable dirs and ensure
 # we fall back to the color for standard directories.
@@ -52,7 +52,7 @@ LS_COLORS="ow=:" ls --color=always > out || fail=1
 cat -A out > o1 || fail=1
 mv o1 out || fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ^[[0m^[[01;34md^[[0m$
 ^[[01;34mother-writable^[[0m$
 out$
diff --git a/tests/ls/m-option.sh b/tests/ls/m-option.sh
index b6e7743..275ab43 100755
--- a/tests/ls/m-option.sh
+++ b/tests/ls/m-option.sh
@@ -29,7 +29,7 @@ ls -w2 -m a b > out || fail=1
 # Before coreutils-5.1.1, the following would produce leading white space.
 # All of the sed business is because the sizes are not portable.
 ls -sm a b | sed 's/^[0-9]/0/;s/, [0-9][0-9]* b/, 12 b/' >> out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 a,
 b
 0 a, 12 b
diff --git a/tests/ls/stat-dtype.sh b/tests/ls/stat-dtype.sh
index dbd0e31..550856c 100755
--- a/tests/ls/stat-dtype.sh
+++ b/tests/ls/stat-dtype.sh
@@ -42,19 +42,18 @@ chmod 600 e || framework_failure_
 
 
 ls --file-type d > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 s@
 EOF
 
 compare exp out || fail=1
 
-rm -f out exp
 # Check for the ls -CF misaligned-columns bug:
 ls -CF e > out || fail=1
 
 # coreutils-6.0 would print two spaces after the first slash,
 # rather than the appropriate TAB.
-printf 'a2345/\tb/\n' > exp || fail=1
+printf 'a2345/\tb/\n' > exp || framework_failure_
 
 compare exp out || fail=1
 
diff --git a/tests/ls/time-style-diag.sh b/tests/ls/time-style-diag.sh
index 00c04dd..2c67021 100755
--- a/tests/ls/time-style-diag.sh
+++ b/tests/ls/time-style-diag.sh
@@ -21,7 +21,7 @@ print_ver_ ls
 
 returns_ 2 ls -l --time-style=XX > out 2> err || fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ls: invalid argument 'XX' for 'time style'
 Valid arguments are:
   - [posix-]full-iso
diff --git a/tests/ls/x-option.sh b/tests/ls/x-option.sh
index e4ee8bb..224d2b3 100755
--- a/tests/ls/x-option.sh
+++ b/tests/ls/x-option.sh
@@ -27,7 +27,7 @@ touch subdir/a || framework_failure_
 # Coreutils 6.8 and 6.9 would output this in the wrong order.
 ls -x subdir > out || fail=1
 ls -rx subdir >> out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 a  b
 b  a
 EOF
diff --git a/tests/misc/chcon.sh b/tests/misc/chcon.sh
index c9c42f0..13a72a0 100755
--- a/tests/misc/chcon.sh
+++ b/tests/misc/chcon.sh
@@ -57,7 +57,7 @@ for i in -u$u1 -r$r1 -t$t1; do
   stat --printf="f|$i|"'%C\n' f >> out || fail=1
 done
 
-cat <<EOF > exp || fail=1
+cat <<EOF > exp || framework_failure_
 f|$ctx
 g|$ctx
 f|--user=$u2|$u2:$r1:$t1:$range
@@ -72,7 +72,7 @@ EOF
 compare exp out || fail=1
 
 chcon --verbose -u$u1 f > out || fail=1
-echo "changing security context of 'f'" > exp
+echo "changing security context of 'f'" > exp || framework_failure_
 compare exp out || fail=1
 
 Exit $fail
diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh
index eae1cd0..0557889 100755
--- a/tests/misc/nohup.sh
+++ b/tests/misc/nohup.sh
@@ -88,7 +88,7 @@ if test -t 1; then
   compare /dev/null nohup.out || fail=1
 fi
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 nohup: appending output to 'nohup.out'
 nohup: cannot run command 'no-such-command': No such file or directory
 EOF
@@ -108,7 +108,7 @@ if test -t 1; then
   compare /dev/null nohup.out || fail=1
 fi
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 nohup: appending output to 'nohup.out'
 nohup: cannot run command './k': Permission denied
 EOF
diff --git a/tests/misc/od-N.sh b/tests/misc/od-N.sh
index f05b1c7..fcf0730 100755
--- a/tests/misc/od-N.sh
+++ b/tests/misc/od-N.sh
@@ -23,7 +23,7 @@ echo abcdefg > in || framework_failure_
 
 
 (od -An -N3 -c; od -An -N3 -c) < in > out
-cat <<EOF > exp || fail=1
+cat <<EOF > exp || framework_failure_
    a   b   c
    d   e   f
 EOF
diff --git a/tests/misc/sort-compress.sh b/tests/misc/sort-compress.sh
index 82b585f..91fad43 100755
--- a/tests/misc/sort-compress.sh
+++ b/tests/misc/sort-compress.sh
@@ -28,7 +28,7 @@ sort -S 1k in > out || fail=1
 compare exp out || fail=1
 
 # Create our own gzip program that will be used as the default
-cat <<EOF > gzip || fail=1
+cat <<EOF > gzip || framework_failure_
 #!$SHELL
 tr 41 14
 touch ok
diff --git a/tests/misc/tac-continue.sh b/tests/misc/tac-continue.sh
index 44cd98b..dca6b6c 100755
--- a/tests/misc/tac-continue.sh
+++ b/tests/misc/tac-continue.sh
@@ -63,7 +63,7 @@ mkfifo_or_skip_ fifo
 seq 1000 > fifo & pid=$!
 TMPDIR=$FULL_PARTITION_TMPDIR tac fifo in >out 2>err && fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 5
 4
 3
diff --git a/tests/misc/time-style.sh b/tests/misc/time-style.sh
index ec1d4ab..1a88dc6 100755
--- a/tests/misc/time-style.sh
+++ b/tests/misc/time-style.sh
@@ -42,7 +42,7 @@ sed 's/[^	]*	//' duout >dued || framework_failure_
 sed 's/[^ ]* *[^ ]* *[^ ]* *[^ ]* *//' lsout >lsed || framework_failure_
 sed '/^$/d' prout >pred || framework_failure_
 
-cat <<\EOF > duexp || fail=1
+cat <<\EOF > duexp || framework_failure_
 1970-07-08 09:10:11.000000000 +0000	a
 1970-07-08 09:10	a
 1970-07-08	a
@@ -65,7 +65,7 @@ cat <<\EOF > duexp || fail=1
 %bJul%bJul	a
 EOF
 
-cat <<\EOF > lsexp || fail=1
+cat <<\EOF > lsexp || framework_failure_
 1970-07-08 09:10:11.000000000 +0000 a
 1970-07-08 09:10 a
 1970-07-08  a
@@ -92,7 +92,7 @@ Jul  8  1970 a
 %bJul%bJul a
 EOF
 
-cat <<\EOF > prexp || fail=1
+cat <<\EOF > prexp || framework_failure_
 +1970-07-08 09:10:11 +0000 (UTC)                a                 Page 1
 hello
 +%bJul%bJul                           a                           Page 1
diff --git a/tests/mv/backup-dir.sh b/tests/mv/backup-dir.sh
index 497384e..7263afe 100755
--- a/tests/mv/backup-dir.sh
+++ b/tests/mv/backup-dir.sh
@@ -25,7 +25,7 @@ touch X Y || framework_failure_
 
 # Before coreutils-6.2, the " (backup: 'B.~1~')" suffix was not printed.
 mv --verbose --backup=numbered -T A B > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 renamed 'A' -> 'B' (backup: 'B.~1~')
 EOF
 
diff --git a/tests/mv/dir2dir.sh b/tests/mv/dir2dir.sh
index be10691..de97abb 100755
--- a/tests/mv/dir2dir.sh
+++ b/tests/mv/dir2dir.sh
@@ -33,7 +33,7 @@ mv b/t a 2> out && fail=1
 sed             's/: File exists/: Directory not empty/'<out>o1;mv o1 out
 sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 mv: cannot move 'b/t' to 'a/t': Directory not empty
 EOF
 
diff --git a/tests/rm/dir-no-w.sh b/tests/rm/dir-no-w.sh
index 23124d0..8afc994 100755
--- a/tests/rm/dir-no-w.sh
+++ b/tests/rm/dir-no-w.sh
@@ -25,7 +25,7 @@ mkdir --mode=0500 unwritable-dir || framework_failure_
 
 # For rm from coreutils-5.0.1, this would prompt.
 rm ---presume-input-tty unwritable-dir < /dev/null > out-t 2>&1 && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 rm: cannot remove 'unwritable-dir': Is a directory
 EOF
 
diff --git a/tests/rm/dir-nonrecur.sh b/tests/rm/dir-nonrecur.sh
index a99184e..e9bda6e 100755
--- a/tests/rm/dir-nonrecur.sh
+++ b/tests/rm/dir-nonrecur.sh
@@ -24,7 +24,7 @@ mkdir d || framework_failure_
 
 
 rm d 2> out && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 rm: cannot remove 'd': Is a directory
 EOF
 
diff --git a/tests/rm/inaccessible.sh b/tests/rm/inaccessible.sh
index dfb7c4d..8d8469f 100755
--- a/tests/rm/inaccessible.sh
+++ b/tests/rm/inaccessible.sh
@@ -34,7 +34,7 @@ set +x
 test -d "$p/abs1" && fail=1
 test -d "$p/abs2" && fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 rm: cannot remove 'rel': Permission denied
 EOF
 
diff --git a/tests/rm/interactive-always.sh b/tests/rm/interactive-always.sh
index 6ed07db..d287ae1 100755
--- a/tests/rm/interactive-always.sh
+++ b/tests/rm/interactive-always.sh
@@ -64,9 +64,7 @@ rm -R -f --interactive=once file4-* < in >> out 2>> err || fail=1
 echo . >> err || fail=1
 test -f file4-1 || fail=1
 
-cat <<\EOF > expout || fail=1
-EOF
-sed 's/@remove_empty/rm: remove regular empty file/g' <<\EOF > experr || fail=1
+cat <<\EOF > experr.t || framework_failure_
 no WHEN
 @remove_empty 'file1-1'? @remove_empty 'file1-2'? .
 WHEN=never
@@ -80,8 +78,10 @@ WHEN=always
 --interactive overrides -f
 rm: remove 1 argument recursively? .
 EOF
+sed 's/@remove_empty/rm: remove regular empty file/g' < experr.t > experr ||
+  framework_failure_
 
-compare expout out || fail=1
+compare /dev/null out || fail=1
 compare experr err || fail=1
 
 Exit $fail
diff --git a/tests/rm/interactive-once.sh b/tests/rm/interactive-once.sh
index 5831213..5995ac0 100755
--- a/tests/rm/interactive-once.sh
+++ b/tests/rm/interactive-once.sh
@@ -119,9 +119,7 @@ echo . >> err || fail=1
 test -d dir2-1 && fail=1
 test -d dir2-2 && fail=1
 
-cat <<\EOF > expout || fail=1
-EOF
-cat <<EOF > experr || fail=1
+cat <<EOF > experr || framework_failure_
 one file, no recursion
 .
 one file, read only, answer no
@@ -144,7 +142,7 @@ multiple files, recursion, answer yes
 rm: remove 2 arguments recursively? .
 EOF
 
-compare expout out || fail=1
+compare /dev/null out || fail=1
 compare experr err || fail=1
 
 Exit $fail
diff --git a/tests/rm/rm3.sh b/tests/rm/rm3.sh
index 5f29e44..77490ce 100755
--- a/tests/rm/rm3.sh
+++ b/tests/rm/rm3.sh
@@ -31,7 +31,7 @@ chmod u-w fu du empty-u || framework_failure_
 cd ..
 
 
-cat <<EOF > in
+cat <<EOF > in || framework_failure_
 y
 y
 y
@@ -52,9 +52,9 @@ rm -ir z < in > out 2>&1 || fail=1
 # This avoids a bug whereby some vendor-provided (Tru64) versions of sed
 # would mistakenly tack a newline onto the end of the output.
 tr '?' '\n' < out | head --bytes=-1 | sed 's/^ //' |sort > o2
-mv o2 out
+mv o2 out || framework_failure_
 
-sort <<EOF > exp || fail=1
+sort <<EOF > exp || framework_failure_
 rm: descend into directory 'z'
 rm: remove regular empty file 'z/empty'
 rm: remove write-protected regular file 'z/fu'
diff --git a/tests/rm/v-slash.sh b/tests/rm/v-slash.sh
index 5312278..975f92e 100755
--- a/tests/rm/v-slash.sh
+++ b/tests/rm/v-slash.sh
@@ -24,7 +24,7 @@ touch a/x || framework_failure_
 
 
 rm --verbose -r a/// > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 removed 'a/x'
 removed directory 'a/'
 EOF
diff --git a/tests/sample-test b/tests/sample-test
index 27fdc3b..8041549 100644
--- a/tests/sample-test
+++ b/tests/sample-test
@@ -27,7 +27,7 @@ print_ver_ FIXME
 # FIXME: . "$abs_srcdir/tests/other-fs-tmpdir"
 
 FIXME > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 FIXME
 EOF
 
diff --git a/tests/touch/relative.sh b/tests/touch/relative.sh
index a2925b2..a83300c 100755
--- a/tests/touch/relative.sh
+++ b/tests/touch/relative.sh
@@ -29,7 +29,7 @@ touch --ref f --date='-5 days' f || fail=1
 TZ=UTC0 ls -og --time-style=+%Y-%m-%d f > out.1 || fail
 sed 's/ f$//;s/.* //' out.1 > out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 2004-01-11
 EOF
 
-- 
2.9.3



From MAILER-DAEMON Tue Aug 29 01:25:05 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmZ1N-0001Np-Rk
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 01:25:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54340)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmZ1M-0001Nh-5j
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:25:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmZ1H-0003Zm-7Z
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:25:04 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39310)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmZ1H-0003ZB-1E
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:24:59 -0400
Received: from localhost.net (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 5C71394E5;
	Tue, 29 Aug 2017 06:24:57 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] all: update gnulib submodule to latest
Date: Mon, 28 Aug 2017 22:24:50 -0700
Message-Id: <20170829052450.29719-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 29 Aug 2017 05:25:05 -0000

* bootstrap: Sync timestamp update.
---
 bootstrap | 2 +-
 gnulib    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bootstrap b/bootstrap
index 6a21392..932ff85 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2016-11-03.18; # UTC
+scriptversion=2017-01-09.19; # UTC
 
 # Bootstrap this package from checked-out sources.
 
diff --git a/gnulib b/gnulib
index daba283..8d116e3 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit daba2833be01f39982742b9bcdbbd1319be157aa
+Subproject commit 8d116e3f657cb120f79efbbb675fa3cc9d21f53e
-- 
2.9.3



From MAILER-DAEMON Tue Aug 29 01:33:21 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmZ9N-0004IF-Dx
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 01:33:21 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56493)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmZ9K-0004GV-Ud
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:33:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmZ9G-0008OU-SO
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:33:18 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39328)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmZ9G-0008Np-Li
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:33:14 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 9D30D94F4;
	Tue, 29 Aug 2017 06:33:12 +0100 (IST)
Subject: Re: realpath edge cases
To: Assaf Gordon <assafgordon@gmail.com>
References: <20170625000252.GA17379@gmail.com>
	<24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
	<20170628005528.GA12440@gmail.com> <20170628013600.GB12440@gmail.com>
	<2eb20a60-6d7c-cd0a-7581-25fb993700c1@draigBrady.com>
	<C8F94B85-9171-4885-BBB9-7461A3784ACE@gmail.com>
	<21a83313-a986-a02f-bd08-8a2db1dd31c9@draigBrady.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <40beaaf0-36cc-c1d5-8df9-885864142e95@draigBrady.com>
Date: Mon, 28 Aug 2017 22:33:10 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <21a83313-a986-a02f-bd08-8a2db1dd31c9@draigBrady.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]
	[fuzzy]
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: Tue, 29 Aug 2017 05:33:20 -0000

On 28/06/17 23:48, P=E1draig Brady wrote:
> On 28/06/17 17:49, Assaf Gordon wrote:
>> Hello P=E1draig,
>>
>>> On Jun 28, 2017, at 12:29, P=E1draig Brady <P@draigBrady.com> wrote:
>>>
>>> On 27/06/17 18:36, Assaf Gordon wrote:
>>>> On Wed, Jun 28, 2017 at 12:55:29AM +0000, Assaf Gordon wrote:
>>>>> Attached are three patches for realpath's documentation:
>>> I'm getting this message repeated 5 times when building coreutils.inf=
o:
>>>
>>> Negative repeat count does nothing at /usr/share/texinfo/Texinfo/Conv=
ert/Line.pm line 124.
>>
>> I'm not able to reproduce this warning (tried with texinfo versions fr=
om 4.8a to 6.4) -
>> I wonder what triggered it.
>=20
> Eek, sorry I should have said I used texinfo-6.1-4.fc25.x86_64
>=20
>> Versions older than 6.1 warned about a missing "@menu" item, I'll add =
that before pushing
>> (despite 6.0 being too old for coreutils, and texinfo>6.1 allow omitti=
ng the @menu).
>=20
> The warning is caused by the @exdents (which occur nowhere else in the =
file).
> The code producing the warning is:
>=20
>       if ($line->{'indent_length'}) {
>         $result .=3D ' ' x ($line->{'indent_length'} - $line->{'counter=
'});
>         print STDERR "INDENT.L($line->{'counter'})\n" if ($line->{'DEBU=
G'});
>       }
>=20
> So 'counter' must be more that 'indent_length' which must be non zero.
> It's only a warning so it doesn't matter really.
> I'll leave it up to you if you want to leave the @exdents in place
>=20
> cheers,
> P=E1draig
>=20
>=20
I'm applying these without the @exdent

thanks,
P=E1draig


From MAILER-DAEMON Tue Aug 29 01:42:26 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmZIA-0006P7-DV
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 01:42:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57740)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmZI8-0006Or-Er
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:42:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmZI4-0003Zq-HL
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:42:24 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39352)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmZI4-0003ZW-BP
	for coreutils@gnu.org; Tue, 29 Aug 2017 01:42:20 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 78B5F9509;
	Tue, 29 Aug 2017 06:42:18 +0100 (IST)
Subject: Re: [PATCH] df: avoid stat() for dummy file systems with -l
To: Bernhard Voelker <mail@bernhard-voelker.de>, Coreutils
	<coreutils@gnu.org>, Josef Cejka <jcejka@suse.com>
References: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
Cc: Philipp Thomas <pth@suse.de>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <41d88fa0-047e-6361-87af-443b1f3fa7b4@draigBrady.com>
Date: Mon, 28 Aug 2017 22:42:16 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <c4db6b63-e210-2634-a79a-e93733ed0a57@bernhard-voelker.de>
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]
	[fuzzy]
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: Tue, 29 Aug 2017 05:42:25 -0000

On 31/07/17 16:54, Bernhard Voelker wrote:
> The attached fixes a hang for unaccessible NFS mounts which
> are automounted by systemd.
>=20
> See e.g.
>   http://blog.tomecek.net/post/automount-with-systemd/
> for how to configure such a systemd unit to reproduce.

+  df no longer interacts with dummy file system types, so for example
+  no longer hangs with problematic nfs mounted via system.automount(5).
+  [bug introduced in coreutils-8.21]

Well df by default should not be displaying dummy file systems,
so the stat() avoidance here is a net win I think.
I'll apply this and we can improve the other issues mentioned
in the thread later.

cheers,
P=C3=A1draig


From MAILER-DAEMON Tue Aug 29 02:33:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dma5k-0000dr-CW
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 02:33:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38929)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dma5h-0000be-NZ
	for coreutils@gnu.org; Tue, 29 Aug 2017 02:33:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dma5e-00045l-GX
	for coreutils@gnu.org; Tue, 29 Aug 2017 02:33:37 -0400
Received: from mout.kundenserver.de ([212.227.126.130]:60641)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dma5e-000456-6T
	for coreutils@gnu.org; Tue, 29 Aug 2017 02:33:34 -0400
Received: from [192.168.101.10] ([91.12.163.59]) by mrelayeu.kundenserver.de
	(mreue004 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0LkDhW-1dGG8n3ZTG-00c9N3; Tue, 29 Aug 2017 08:33:31 +0200
Subject: Re: [PATCH] tests: don't fail tests when failing to write here docs
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <20170829050539.3914-1-P@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <f0b44784-b9c3-b4e6-5142-c6c9ebfb04e1@bernhard-voelker.de>
Date: Tue, 29 Aug 2017 08:33:30 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <20170829050539.3914-1-P@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:yqVA4+fyqXLGk2mnzTEV1nRWL25aoamqQA1eETiiljr4OLF9t4z
	C9KuRPzCbOWcm5uWUXTy0PHE/4TilLm8YKoAiixxTfeosR4LCn5scqwtBhxLC1JdkY7+FOT
	uZa7fy1AkqYNv7JbsLrBkf6ADDABELWARsahQpcaR6OGEVPQk3G4oC9JjErB5lEx7zAHOre
	78mOfajlrMRLBSEJnphxw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:tZ1/VhdDUMc=:4uNHHMdbl8+FnJXqx5G+yI
	V62iyi4WJfMVHvjJlzbYIm1emZi/epEvRm6QTOO1P4OJpQ2WUY0OV/wj4kwadyIW4wTwHAK3y
	F+diaaX4QIds+LpoIPWpsJF8fUZneA/t9XUvcDjAl+YYtZv3ifOCJ77r7XngRI16yvLlESInB
	Ub2XbvyIgsusk69R/kmhDh0o3UGr+N/GmI+NXxbkjqXyhQH1GODY6NDMUAHXey1AnJlB84H0y
	n29lykrcfOaFzH1SO15zQ1vZ6yZyWyom4qjYD/6ruvj7xxDftn6rPPF2oMzuLqMbv2Fju1T+I
	vQohhKbGJS7D9t4pPftdX6z/0dErpmCwDQyTRMWEezlpjOHUYeL569a3eUZsLXtiY0ivLpRcH
	YXan0ccBcZcC4SiyAl/fRHK3z/ocWiqr/K1F0UdMiBZOfZ1m99CB7PMtqHs6pYC4I7gMi++Tf
	MRWBkl24x91zhqPijWBSjoKMpmyH+u+mGyuCpUnECvVPnLOxMkLqT9w/1tk9XVAIcTZ8fsb0Q
	ROrv6HUdow6zhvN4RYyVw/w8OtSGfZnIwR0ZvMEYizrw2KWz2HeH2DhN4aAepSc7dHWRMSm3f
	9BgrCdmfi/cnIIE/2jbn/rTEWX4thv1V886kZPNMTv8vjL1Sc65242k6yCQKPLpOxjkzxbiwt
	IBovAuRCH5UwPTyrZ0e+qTBmI1/nDnY+9Boaoa/pv1ZoHw/NUP+3LIV5qKQsmSJMoe8YXmMJp
	ZPVAb/xet/YbRAEP7cnaMq7PUIu/TFfGNruQWGWhKxS7X7axNnZzSdpHkok=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.126.130
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, 29 Aug 2017 06:33:38 -0000

On 08/29/2017 07:05 AM, Pádraig Brady wrote:
> * tests/sample-test: Use framework_error_ rather than fail=1
> * tests/chown/deref.sh: Likewise.
> * tests/chown/preserve-root.sh: Likewise.
> * tests/cp/src-base-dot.sh: Likewise.
> * tests/dd/unblock-sync.sh: Likewise.
> * tests/du/2g.sh: Likewise.
> * tests/du/inacc-dest.sh: Likewise.
> * tests/du/one-file-system.sh: Likewise.
> * tests/fmt/goal-option.sh: Likewise.
> * tests/ln/hard-backup.sh: Likewise.
> * tests/ls/color-dtype-dir.sh: Likewise.
> * tests/ls/m-option.sh: Likewise.
> * tests/ls/stat-dtype.sh: Likewise.
> * tests/ls/time-style-diag.sh: Likewise.
> * tests/ls/x-option.sh: Likewise.
> * tests/misc/chcon.sh: Likewise.
> * tests/misc/nohup.sh: Likewise.
> * tests/misc/od-N.sh: Likewise.
> * tests/misc/sort-compress.sh: Likewise.
> * tests/misc/tac-continue.sh: Likewise.
> * tests/misc/time-style.sh: Likewise.
> * tests/mv/backup-dir.sh: Likewise.
> * tests/mv/dir2dir.sh: Likewise.
> * tests/rm/dir-no-w.sh: Likewise.
> * tests/rm/dir-nonrecur.sh: Likewise.
> * tests/rm/inaccessible.sh: Likewise.
> * tests/rm/interactive-always.sh: Likewise.
> * tests/rm/interactive-once.sh: Likewise.
> * tests/rm/rm3.sh: Likewise.
> * tests/rm/v-slash.sh: Likewise.
> * tests/touch/relative.sh: Likewise.

Nice work, thanks.

BTW: doesn't this not only apply to here documents, but also
to many more of the commands creating the exp and out files?
E.g.
  echo LA:3456789abcdef > in || fail=1

It's a bit harder to find them all, but
  git grep '^[ ]*echo.*||.*fail=' | grep -v ' | '
seems to be a good start.

Have a nice day,
Berny


From MAILER-DAEMON Tue Aug 29 03:39:10 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmb77-00019E-Tz
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 03:39:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53325)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmb75-000196-5h
	for coreutils@gnu.org; Tue, 29 Aug 2017 03:39:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmb71-0006wC-B7
	for coreutils@gnu.org; Tue, 29 Aug 2017 03:39:07 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:42642)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmb71-0006vO-4V
	for coreutils@gnu.org; Tue, 29 Aug 2017 03:39:03 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 A2E4D4AD7;
	Tue, 29 Aug 2017 08:38:58 +0100 (IST)
Subject: Re: [PATCH] tests: don't fail tests when failing to write here docs
To: Bernhard Voelker <mail@bernhard-voelker.de>, coreutils@gnu.org
References: <20170829050539.3914-1-P@draigBrady.com>
	<f0b44784-b9c3-b4e6-5142-c6c9ebfb04e1@bernhard-voelker.de>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <aa5c119d-b417-559d-acf9-f197d3343971@draigBrady.com>
Date: Tue, 29 Aug 2017 00:38:56 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <f0b44784-b9c3-b4e6-5142-c6c9ebfb04e1@bernhard-voelker.de>
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]
	[fuzzy]
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: Tue, 29 Aug 2017 07:39:08 -0000

On 28/08/17 23:33, Bernhard Voelker wrote:
> On 08/29/2017 07:05 AM, P=E1draig Brady wrote:
>> * tests/sample-test: Use framework_error_ rather than fail=3D1
>> * tests/chown/deref.sh: Likewise.
>> * tests/chown/preserve-root.sh: Likewise.
>> * tests/cp/src-base-dot.sh: Likewise.
>> * tests/dd/unblock-sync.sh: Likewise.
>> * tests/du/2g.sh: Likewise.
>> * tests/du/inacc-dest.sh: Likewise.
>> * tests/du/one-file-system.sh: Likewise.
>> * tests/fmt/goal-option.sh: Likewise.
>> * tests/ln/hard-backup.sh: Likewise.
>> * tests/ls/color-dtype-dir.sh: Likewise.
>> * tests/ls/m-option.sh: Likewise.
>> * tests/ls/stat-dtype.sh: Likewise.
>> * tests/ls/time-style-diag.sh: Likewise.
>> * tests/ls/x-option.sh: Likewise.
>> * tests/misc/chcon.sh: Likewise.
>> * tests/misc/nohup.sh: Likewise.
>> * tests/misc/od-N.sh: Likewise.
>> * tests/misc/sort-compress.sh: Likewise.
>> * tests/misc/tac-continue.sh: Likewise.
>> * tests/misc/time-style.sh: Likewise.
>> * tests/mv/backup-dir.sh: Likewise.
>> * tests/mv/dir2dir.sh: Likewise.
>> * tests/rm/dir-no-w.sh: Likewise.
>> * tests/rm/dir-nonrecur.sh: Likewise.
>> * tests/rm/inaccessible.sh: Likewise.
>> * tests/rm/interactive-always.sh: Likewise.
>> * tests/rm/interactive-once.sh: Likewise.
>> * tests/rm/rm3.sh: Likewise.
>> * tests/rm/v-slash.sh: Likewise.
>> * tests/touch/relative.sh: Likewise.
>=20
> Nice work, thanks.
>=20
> BTW: doesn't this not only apply to here documents, but also
> to many more of the commands creating the exp and out files?
> E.g.
>   echo LA:3456789abcdef > in || fail=3D1
>=20
> It's a bit harder to find them all, but
>   git grep '^[ ]*echo.*||.*fail=3D' | grep -v ' | '
> seems to be a good start.

Cool. I fixed those up too



From MAILER-DAEMON Tue Aug 29 04:07:46 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmbYo-0008Pc-JQ
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 04:07:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60613)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmbYm-0008Oe-Oh
	for coreutils@gnu.org; Tue, 29 Aug 2017 04:07:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmbYh-0004mF-QT
	for coreutils@gnu.org; Tue, 29 Aug 2017 04:07:44 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:45624)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmbYh-0004lY-Jn
	for coreutils@gnu.org; Tue, 29 Aug 2017 04:07:39 -0400
Received: from localhost.net (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id CB9A19513;
	Tue, 29 Aug 2017 09:07:36 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] stat,tail: support "AAFS" AppArmor file system
Date: Tue, 29 Aug 2017 01:07:29 -0700
Message-Id: <20170829080729.23066-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 29 Aug 2017 08:07:45 -0000

* src/stat.c (human_fstype): This file system is used
to manage AppArmor policy in the Linux kernel.
---
 src/stat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/stat.c b/src/stat.c
index dcaa580..87b3ff4 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -247,6 +247,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
          a comment.  The S_MAGIC_... name and constant are automatically
          combined to produce the #define directives in fs.h.  */
 
+    case S_MAGIC_AAFS: /* 0x5A3C69F0 local */
+      return "aafs";
     case S_MAGIC_ACFS: /* 0x61636673 remote */
       return "acfs";
     case S_MAGIC_ADFS: /* 0xADF5 local */
-- 
2.9.3



From MAILER-DAEMON Tue Aug 29 04:49:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmcDK-0002YG-6b
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 04:49:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42987)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmcDH-0002Y5-HJ
	for coreutils@gnu.org; Tue, 29 Aug 2017 04:49:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmcDE-0007w2-Ci
	for coreutils@gnu.org; Tue, 29 Aug 2017 04:49:35 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:45762)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>)
	id 1dmcDE-0007vh-1Q; Tue, 29 Aug 2017 04:49:32 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 4F405994F;
	Tue, 29 Aug 2017 09:49:29 +0100 (IST)
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Subject: new snapshot available: coreutils-8.27.99-3ebdc3
To: coreutils@gnu.org
Cc: coordinator@translationproject.org, platform-testers@gnu.org
Message-ID: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Date: Tue, 29 Aug 2017 01:49:17 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="9qfnVaN2hfdJjHqKItaJTo2UG10BB6L0l"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 82.195.144.49
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, 29 Aug 2017 08:49:37 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--9qfnVaN2hfdJjHqKItaJTo2UG10BB6L0l
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Cc: coordinator@translationproject.org, platform-testers@gnu.org
Message-ID: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Subject: new snapshot available: coreutils-8.27.99-3ebdc3
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

We plan to release coreutils-8.28 towards the end of this week,
so any testing you can do on various different systems between now and th=
en
would be most welcome.

--------------------------------------

You can download the coreutils snapshot in xz format (5.2 MB) from:
  https://pixelbeat.org/cu/coreutils-ss.tar.xz

And verify with gpg or md5sum with:
  https://pixelbeat.org/cu/coreutils-ss.tar.xz.sig
  MD5 (coreutils-ss.tar.xz) =3D f38d980b63f88b66bf2415c3edf6313b

--------------------------------------

To test follow this standard procedure:

  tar -xf coreutils-ss.tar.xz
  cd coreutils-8.27.99-3ebdc3/
  ./configure && make check VERBOSE=3Dyes

Failures are reported and details are in tests/test-suite.log

--------------------------------------

Changes in coreutils since v8.27 are summarized at
https://git.sv.gnu.org/cgit/coreutils.git/tree/NEWS
and all commits grouped by author are as follows:

Andreas Schwab (1):
      nproc: fix indentation of usage output

Assaf Gordon (5):
      expr: add multibyte support
      doc: fix join example
      realpath: improve usage description for --relative-{to,base}
      doc: fix realpath index entry
      doc: add 'realpath usage examples' section

Bo Rydberg (1):
      doc: fix awk example for getting penultimate field

Bogdan Drozdowski (1):
      shred: fix invalid pattern generation for certain sizes

Chris Davies (1):
      doc: clarify in dd man page that bs=3D overrides [io]bs=3D

Colin Watson (1):
      env: add --chdir option

Jaak Ristioja (1):
      doc: Fixed typo in timeout man page

Jacob Keller (1):
      expand,unexpand: add support for incremental tab stops

Jim Meyering (10):
      maint: update to work with GCC7's -Werror=3Dimplicit-fallthrough=3D=
5
      maint: avoid spurious "make distcheck" failure
      doc: tweak wording
      tests: groups-dash.sh: avoid false failure
      groups: do not exit early
      maint: fix grammar in a shred.c comment
      doc: correct technicality in chroot's --help output
      chroot: fix typo in preceding change: didn't compile
      gnulib: update to latest and adjust gl/modules/tempname.diff
      build: adjust warning options to work with latest GCC

Josef Cejka (1):
      df: avoid stat() for dummy file systems with -l

Ludovic Court=C3=A8s (1):
      tests: avoid false ulimit failure on some systems

Michael Heimpold (1):
      split: add new --hex-suffixes option

Paul Eggert (25):
      tests: port to tzdb-2017a
      sort: update comment
      tty: handle misconfigured namespaces
      build: update gnulib submodule to latest
      date: adjust to gnulib parse-datetime changes
      maint: remove unused functions and constants
      build: update gnulib submodule to latest
      dd: status=3Dprogress outputs "6 s", not "6.00001 s"
      dd: simplify translator=E2=80=99s jobs
      build: update gnulib submodule to latest
      shred: use explicit_bzero
      build: update gnulib submodule to latest
      shred: avoid rename race
      copy: make backup files more reliably
      copy: sanity-check --suffix
      copy: go back to failing 'cp --backup a~ a'
      build: update gnulib submodule to latest
      copy: more-accurate warning about destruction
      build: update gnulib submodule to latest
      build: update gnulib submodule to latest
      sort: file descriptor discipline
      sort: minor cleanups
      sort: use pthread_sigmask, not sigprocmask
      nohup: simplify by using fcntl
      ptx: fix some integer overflow bugs

Philipp Thomas (1):
      df: avoid querying excluded file systems

Prateek saxena (1):
      uptime: remove inconsistent AM/PM from current time

P=C3=A1draig Brady (45):
      maint: post-release administrivia
      doc: rearrange a recent bug entry to an improvement in NEWS
      build: for factor use C in more cases for arm64 and ppc64
      build: fix missing renameat() on OS X 10.5.8
      tests: avoid a false failure on OS X 10.5.8
      split: ensure input is processed when filters exit early
      split: process more efficiently when filters exit early
      maint: avoid a static analysis warning in expand-common
      md5sum,b2sum,sha*sum: don't erroneously trigger BSD reversed mode
      maint: avoid syntax check failure with wrapped returns_
      doc: refactor and update expand and unexpand --help
      maint: fix syntax-check issues in previous tty commit
      build: update gnulib submodule to latest
      date,touch: test and document large TZ security issue
      doc: update the instructions for generating a coverage report
      maint: fix various typos in recent commits
      mv: distinguish copy and rename operations with --verbose
      copy: don't fail when unable to chown symlinks
      tests: fix issues with recently added tail test
      tail: with --pid, ensure all inotify events are processed
      tail: exit promptly when output no longer writable
      tail: with -f don't warn if doing a blocking read of a tty
      tail: only use inotify with regular files
      maint: use C99 for loop initial declarations where possible
      tests: avoid a false failure on AIX
      maint: resync with blake2 upstream
      shred: remove redundant zeroing of freed memory
      maint: fix recent syntax-check failures
      maint: avoid a syntax-check failure
      tests: fix false failure with large printf formats
      seq: produce consistent error messages upon write error
      sort: handle musl locale differences in --debug reporting
      tests: avoid false failures on AIX
      build: use the appropriate single file include option with xlc
      kill: fix signal number to name lookup on AIX
      tests: fix issues on alpine linux
      maint: avoid a syntax check failure
      tail: reinstate inotify use with FIFOs
      ls: consistently quote symlink targets
      tests: don't fail tests when failing to write files
      doc: remove older ChangeLog items
      ls: support --hyperlink to output file:// URIs
      runcon: disable use of the TIOCSTI ioctl
      all: update gnulib submodule to latest
      stat,tail: support "AAFS" AppArmor file system

Sebastian Kisela (2):
      tail: revert to polling if a followed directory is replaced
      doc: mention `setpriv --no-new-privs` feature in runcon info


thanks!
P=C3=A1draig



--9qfnVaN2hfdJjHqKItaJTo2UG10BB6L0l
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

iQIcBAEBCAAGBQJZpSqXAAoJEN9v2XEwYDfZ3kEP/3P6VDeujo/DLC9W495i1xH3
j+A/2DCMMnHhzhMiki9uSe5K/bqw0sZQ61YWqTQkVNfHlO1sVAbSyrKKwbOIKIW6
KNqGbR61YiNNv8aLfzr762rbTojWOSDQLwZ/tRk8vRRUbgJpMKae/dhoHsXb4ac/
wuTfK6RtEiNjwByvXLHwcZehuiKUpiULbAnxn+EQd5W30hmDiHwzIQirDG7v/GJN
LNK9kbG+FB5x4ZLDb81dStaKAC2jacIIh18cXzv2GmXQEm8kkeYozFcBzKoA0ryp
KHcgFt/3tvbQ2RAiW25WOl6Bo8l747AiKS++cXC96PODfMdDE/LJLE1iRKaVXnYJ
En3B/8XbAL8b6ZUJizNib5yQhF9RuKOFC5ldFYjdtFnwJ8R0PFCfmCUv99nw2BN/
2xDtlV1v6stYwnO87kxEiTlpCDRPY+7pi80AS8YfeCsoAYw+9y6NZkzbe90Rgrda
cLpAECYukhUdlDo22XOTvg19d+HFq8G9mCYxaD4vjqUVp7N0Aoa4fzd8ARMhVkHw
wrReYbkXJ8xzsfkca79MQl3zHjQmsLS/gOetwW4yhZ8YofyzL4OKX9zzOQ8uqLcn
MbbouUSql9T70fITtjtnwQiTutxqq79L7P5bwQftH8MvZlQPBVcfWE4SFb/pS49m
sBt87VccHiBaPgz1qAFH
=PjbP
-----END PGP SIGNATURE-----

--9qfnVaN2hfdJjHqKItaJTo2UG10BB6L0l--


From MAILER-DAEMON Tue Aug 29 06:23:33 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmdgD-0003bZ-Gj
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 06:23:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37547)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1dmdgB-0003bP-8d
	for coreutils@gnu.org; Tue, 29 Aug 2017 06:23:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1dmdg9-0001Vh-Qx
	for coreutils@gnu.org; Tue, 29 Aug 2017 06:23:31 -0400
Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:34080)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <auerswal@unix-ag.uni-kl.de>)
	id 1dmdg9-0001Su-G8
	for coreutils@gnu.org; Tue, 29 Aug 2017 06:23:29 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
	[IPv6:2001:638:208:ef34:0:ff:fe00:65])
	by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
	v7TANJw4006746
	(version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); 
	Tue, 29 Aug 2017 12:23:19 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1])
	by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP
	id v7TANHgZ013359
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256
	verify=NO); Tue, 29 Aug 2017 12:23:17 +0200
Received: (from auerswal@localhost)
	by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id v7TANHhB013358;
	Tue, 29 Aug 2017 12:23:17 +0200
Date: Tue, 29 Aug 2017 12:23:17 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org, platform-testers@gnu.org
Subject: Re: new snapshot available: coreutils-8.27.99-3ebdc3
Message-ID: <20170829102317.GA7978@unix-ag.uni-kl.de>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id
	v7TANJw4006746
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:638:208:120::220
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, 29 Aug 2017 10:23:32 -0000

Hi,

On Tue, Aug 29, 2017 at 01:49:17AM -0700, P=E1draig Brady wrote:
> We plan to release coreutils-8.28 towards the end of this week,
> so any testing you can do on various different systems between now and =
then
> would be most welcome.
> [...]
>   tar -xf coreutils-ss.tar.xz
>   cd coreutils-8.27.99-3ebdc3/
>   ./configure && make check VERBOSE=3Dyes

I have tested the snapshot on a Ubuntu LTS 14.04 x86_64 notebook followin=
g the
above procedure. One FAIL was reported:

----8<----
FAIL: tests/df/df-symlink
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

++ initial_cwd_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3
+++ testdir_prefix_
+++ printf gt
++ pfx_=3Dgt
+++ mktempd_ /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3 gt-df-symlink=
.sh.XXXX
+++ case $# in
+++ destdir_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3
+++ template_=3Dgt-df-symlink.sh.XXXX
+++ MAX_TRIES_=3D4
+++ case $destdir_ in
+++ destdir_slash_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/
+++ case $template_ in
++++ unset TMPDIR
+++ d=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.sh.A=
JTG
+++ case $d in
+++ :
+++ test -d /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.=
sh.AJTG
++++ ls -dgo /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink=
.sh.AJTG
+++ perms=3D'drwx------ 2 4096 Aug 29 12:09 /home/auerswald/tmp/c/coreuti=
ls-8.27.99-3ebdc3/gt-df-symlink.sh.AJTG'
+++ case $perms in
+++ :
+++ echo /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.sh.=
AJTG
+++ return
++ test_dir_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symli=
nk.sh.AJTG
++ cd /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.sh.AJT=
G
++ gl_init_sh_nl_=3D'
'
++ IFS=3D'       =20
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=3D' 0
+ path_dir_=3D./src
+ case $path_dir_ in
+ abs_path_dir_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/./src
+ case $abs_path_dir_ in
+ PATH=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/./src:/home/auers=
wald/tmp/c/coreutils-8.27.99-3ebdc3/src:/home/auerswald/bin:/usr/local/sb=
in:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/gam=
es
+ create_exe_shims_ /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=3D' 0
+ export PATH
+ print_ver_ df
+ require_built_ df
+ skip_=3Dno
+ for i in '"$@"'
+ case " $built_programs " in
+ test no =3D yes
+ test yes =3D yes
+ local i
+ for i in '$*'
+ env df --version
df (GNU coreutils) 8.27.99-3ebdc3
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.h=
tml>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert.
++ df --out=3Dsource .
++ tail -n1
+ disk=3D/home/auerswald/.Private
+ ln -s /home/auerswald/.Private symlink
+ df --out=3Dsource,target /home/auerswald/.Private
+ df --out=3Dsource,target symlink
+ compare exp out
+ compare_dev_null_ exp out
+ test 2 =3D 2
+ test xexp =3D x/dev/null
+ test xout =3D x/dev/null
+ return 2
+ case $? in
+ compare_ exp out
+ diff -u exp out
++ df --output=3Dsource
++ wc -l
++ grep -F /home/auerswald/.Private
+ test 1 =3D 1
+ df --out=3Dsource,target .
+ compare exp out
+ compare_dev_null_ exp out
+ test 2 =3D 2
+ test xexp =3D x/dev/null
+ test xout =3D x/dev/null
+ return 2
+ case $? in
+ compare_ exp out
+ diff -u exp out
--- exp 2017-08-29 12:09:55.555199500 +0200
+++ out 2017-08-29 12:09:55.563199639 +0200
@@ -1,2 +1,2 @@
-Filesystem     Mounted on
-/dev/sda5      /
+Filesystem               Mounted on
+/home/auerswald/.Private /home/auerswald
+ fail=3D1
+ test 1 =3D 1
+ dump_mount_list_
+ cat /proc/self/mountinfo
17 22 0:15 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw
18 22 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
19 22 0:5 / /dev rw,relatime - devtmpfs udev rw,size=3D1975032k,nr_inodes=
=3D493758,mode=3D755
20 19 0:12 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=3D=
5,mode=3D620,ptmxmode=3D000
21 22 0:16 / /run rw,nosuid,noexec,relatime - tmpfs tmpfs rw,size=3D39813=
6k,mode=3D755
22 1 8:5 / / rw,relatime - ext4 /dev/sda5 rw,errors=3Dremount-ro,data=3Do=
rdered
23 17 0:17 / /sys/fs/cgroup rw,relatime - tmpfs none rw,size=3D4k,mode=3D=
755
24 17 0:18 / /sys/fs/fuse/connections rw,relatime - fusectl none rw
25 17 0:6 / /sys/kernel/debug rw,relatime - debugfs none rw
26 17 0:10 / /sys/kernel/security rw,relatime - securityfs none rw
27 21 0:19 / /run/lock rw,nosuid,nodev,noexec,relatime - tmpfs none rw,si=
ze=3D5120k
28 21 0:20 / /run/shm rw,nosuid,nodev,relatime - tmpfs none rw
29 21 0:21 / /run/user rw,nosuid,nodev,noexec,relatime - tmpfs none rw,si=
ze=3D102400k,mode=3D755
31 17 0:23 / /sys/fs/pstore rw,relatime - pstore none rw
30 23 0:22 / /sys/fs/cgroup/cpuset rw,relatime - cgroup cgroup rw,cpuset
32 23 0:24 / /sys/fs/cgroup/cpu rw,relatime - cgroup cgroup rw,cpu
33 23 0:25 / /sys/fs/cgroup/cpuacct rw,relatime - cgroup cgroup rw,cpuacc=
t
34 23 0:26 / /sys/fs/cgroup/memory rw,relatime - cgroup cgroup rw,memory
35 23 0:27 / /sys/fs/cgroup/devices rw,relatime - cgroup cgroup rw,device=
s
36 23 0:28 / /sys/fs/cgroup/freezer rw,relatime - cgroup cgroup rw,freeze=
r
37 23 0:29 / /sys/fs/cgroup/blkio rw,relatime - cgroup cgroup rw,blkio
38 23 0:30 / /sys/fs/cgroup/perf_event rw,relatime - cgroup cgroup rw,per=
f_event
39 23 0:31 / /sys/fs/cgroup/hugetlb rw,relatime - cgroup cgroup rw,hugetl=
b
41 18 0:33 / /proc/sys/fs/binfmt_misc rw,nosuid,nodev,noexec,relatime - b=
infmt_misc binfmt_misc rw
40 21 0:32 / /run/rpc_pipefs rw,relatime - rpc_pipefs rpc_pipefs rw
43 23 0:34 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgr=
oup systemd rw,name=3Dsystemd
44 22 0:35 / /home/auerswald rw,nosuid,nodev,relatime - ecryptfs /home/au=
erswald/.Private rw,ecryptfs_fnek_sig=3D6ddd8201f948e7eb,ecryptfs_sig=3Db=
85d619f28625ea9,ecryptfs_cipher=3Daes,ecryptfs_key_bytes=3D16,ecryptfs_un=
link_sigs
45 29 0:36 / /run/user/1000/gvfs rw,nosuid,nodev,relatime - fuse.gvfsd-fu=
se gvfsd-fuse rw,user_id=3D1000,group_id=3D1000
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=3D1
+ cleanup_
+ :
+ test '' =3D yes
+ cd /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3
+ chmod -R u+rwx /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-sym=
link.sh.AJTG
+ rm -rf /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.sh.=
AJTG
+ exit 1
FAIL tests/df/df-symlink.sh (exit status: 1)
----8<----

Thanks,
Erik
--=20
If it ain't broke, don't fix it.


From MAILER-DAEMON Tue Aug 29 08:43:03 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmfrD-0004iz-Em
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 08:43:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45948)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dmfrB-0004hu-BL
	for coreutils@gnu.org; Tue, 29 Aug 2017 08:43:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dmfr9-0001cs-Uz
	for coreutils@gnu.org; Tue, 29 Aug 2017 08:43:01 -0400
Received: from mx1.redhat.com ([209.132.183.28]:37530)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1dmfr9-0001c3-M1
	for coreutils@gnu.org; Tue, 29 Aug 2017 08:42:59 -0400
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com
	[10.5.11.16])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 9BA47806B2;
	Tue, 29 Aug 2017 12:42:57 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9BA47806B2
Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from kdudka-nb.localnet (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 49C966887F;
	Tue, 29 Aug 2017 12:42:57 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: =?ISO-8859-1?Q?P=E1draig?= Brady <P@draigbrady.com>
Cc: coreutils@gnu.org
Subject: Re: new snapshot available: coreutils-8.27.99-3ebdc3
Date: Tue, 29 Aug 2017 14:43:07 +0200
Message-ID: <5406652.I5bSlMrxR1@kdudka-nb>
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.26]);
	Tue, 29 Aug 2017 12:42:57 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 29 Aug 2017 12:43:02 -0000

On Tuesday, August 29, 2017 10:49:17 AM CEST P=E1draig Brady wrote:
> We plan to release coreutils-8.28 towards the end of this week,
> so any testing you can do on various different systems between now and th=
en
> would be most welcome.
>=20
> --------------------------------------
>=20
> You can download the coreutils snapshot in xz format (5.2 MB) from:
>   https://pixelbeat.org/cu/coreutils-ss.tar.xz
>=20
> And verify with gpg or md5sum with:
>   https://pixelbeat.org/cu/coreutils-ss.tar.xz.sig
>   MD5 (coreutils-ss.tar.xz) =3D f38d980b63f88b66bf2415c3edf6313b
>=20
> --------------------------------------
>=20
> To test follow this standard procedure:
>=20
>   tar -xf coreutils-ss.tar.xz
>   cd coreutils-8.27.99-3ebdc3/
>   ./configure && make check VERBOSE=3Dyes
>=20
> Failures are reported and details are in tests/test-suite.log

tests/misc/runcon-no-reorder.sh fails on my Fedora 25 VM if and only
if coreutils is compiled _without_ having libseccomp-devel installed:

=46AIL: tests/misc/runcon-no-reorder
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D

++ initial_cwd_=3D/home/kdudka/git/coreutils
+++ testdir_prefix_
+++ printf gt
++ pfx_=3Dgt
+++ mktempd_ /home/kdudka/git/coreutils gt-runcon-no-reorder.sh.XXXX
+++ case $# in
+++ destdir_=3D/home/kdudka/git/coreutils
+++ template_=3Dgt-runcon-no-reorder.sh.XXXX
+++ MAX_TRIES_=3D4
+++ case $destdir_ in
+++ destdir_slash_=3D/home/kdudka/git/coreutils/
+++ case $template_ in
++++ unset TMPDIR
+++ d=3D/home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
+++ case $d in
+++ :
+++ test -d /home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
++++ ls -dgo /home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
+++ perms=3D'drwx------. 2 6 Aug 29 14:39 /home/kdudka/git/coreutils/gt-run=
con-no-reorder.sh.bWvO'
+++ case $perms in
+++ :
+++ echo /home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
+++ return
++ test_dir_=3D/home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
++ cd /home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
++ gl_init_sh_nl_=3D'
'
++ IFS=3D'=20
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=3D' 0
+ path_dir_=3D./src
+ case $path_dir_ in
+ abs_path_dir_=3D/home/kdudka/git/coreutils/./src
+ case $abs_path_dir_ in
+ PATH=3D/home/kdudka/git/coreutils/./src:/home/kdudka/git/coreutils/src:/o=
pt/coverity/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/=
usr/sbin:/sbin
+ create_exe_shims_ /home/kdudka/git/coreutils/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=3D' 0
+ export PATH
+ print_ver_ runcon
+ require_built_ runcon
+ skip_=3Dno
+ for i in '"$@"'
+ case " $built_programs " in
+ test no =3D yes
+ test yes =3D yes
+ local i
+ for i in '$*'
+ env runcon --version
runcon (GNU coreutils) 8.27.99-3ebdc3
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.htm=
l>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Russell Coker.
+ diag=3D'runcon: runcon may be used only on a SELinux kernel'
+ echo 'runcon: runcon may be used only on a SELinux kernel'
++ id -Z
+ runcon unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 true -j
+ case $(cat out) in
++ cat out
+ compare exp out
+ compare_dev_null_ exp out
+ test 2 =3D 2
+ test xexp =3D x/dev/null
+ test xout =3D x/dev/null
+ return 2
+ case $? in
+ compare_ exp out
+ diff -u exp out
=2D-- exp 2017-08-29 14:39:57.481307950 +0200
+++ out 2017-08-29 14:39:57.486307987 +0200
@@ -1 +1 @@
=2Druncon: runcon may be used only on a SELinux kernel
+runcon: cannot create session
+ fail=3D1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=3D1
+ cleanup_
+ :
+ test '' =3D yes
+ cd /home/kdudka/git/coreutils
+ chmod -R u+rwx /home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
+ rm -rf /home/kdudka/git/coreutils/gt-runcon-no-reorder.sh.bWvO
+ exit 1
=46AIL tests/misc/runcon-no-reorder.sh (exit status: 1)


From MAILER-DAEMON Tue Aug 29 09:03:55 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmgBP-0001n0-LW
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 09:03:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51276)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dmgBM-0001kk-Fx
	for coreutils@gnu.org; Tue, 29 Aug 2017 09:03:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1dmgBH-0004LK-VV
	for coreutils@gnu.org; Tue, 29 Aug 2017 09:03:52 -0400
Received: from a-painless.mh.aa.net.uk ([81.187.30.51]:35704)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <cjwatson@debian.org>) id 1dmgBH-0004Ks-QA
	for coreutils@gnu.org; Tue, 29 Aug 2017 09:03:47 -0400
Received: from
	3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa
	([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org)
	by a-painless.mh.aa.net.uk with esmtps
	(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
	(envelope-from <cjwatson@debian.org>)
	id 1dmgBG-00082x-Td; Tue, 29 Aug 2017 14:03:46 +0100
Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org)
	by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89)
	(envelope-from <cjwatson@debian.org>)
	id 1dmgBA-0007B2-NN; Tue, 29 Aug 2017 14:03:40 +0100
Date: Tue, 29 Aug 2017 14:03:40 +0100
From: Colin Watson <cjwatson@debian.org>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
Cc: Bernhard Voelker <mail@bernhard-voelker.de>, coreutils@gnu.org
Subject: Re: New utility suggestion: chdir(1)
Message-ID: <20170829130340.37gjeyznwozcwkfp@riva.ucam.org>
References: <20170826181028.l2uzkpjp63al5dbw@riva.ucam.org>
	<f294c348-d57b-f8be-1b03-f243abdb493e@draigBrady.com>
	<20170827072340.k7vylotvcxgxf74w@riva.ucam.org>
	<18b5c1ba-8b1b-c42c-db63-6f745fde6393@bernhard-voelker.de>
	<80008221-8a9e-a684-6016-bb62e474cd18@draigBrady.com>
	<ce2ed123-b113-3c91-c8c8-34bbcfac5cad@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ce2ed123-b113-3c91-c8c8-34bbcfac5cad@draigBrady.com>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 81.187.30.51
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, 29 Aug 2017 13:03:53 -0000

On Mon, Aug 28, 2017 at 08:55:21PM -0700, Pádraig Brady wrote:
> I'll push the attached shortly.
> This supports -C and also requires specifying a command
> when specifying -C, as otherwise you get confusing
> output and no error with `env --chdir command` which would
> just print the environment with the previous version.
> It's of no functional value to print the env while
> also changing dir as far as I can see.

I approve of these changes in my name (with Jim's adjustments).  Thanks.

-- 
Colin Watson                                       [cjwatson@debian.org]


From MAILER-DAEMON Tue Aug 29 12:27:20 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmjMF-0006F3-VP
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 12:27:19 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39289)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmjMD-0006Dh-On
	for coreutils@gnu.org; Tue, 29 Aug 2017 12:27:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmjM8-0006Yg-Ox
	for coreutils@gnu.org; Tue, 29 Aug 2017 12:27:17 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39540)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmjM8-0006Y8-Im
	for coreutils@gnu.org; Tue, 29 Aug 2017 12:27:12 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 1CB124ABC;
	Tue, 29 Aug 2017 17:27:09 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.99-3ebdc3
To: Kamil Dudka <kdudka@redhat.com>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<5406652.I5bSlMrxR1@kdudka-nb>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <e689da9e-2571-bb0d-b397-6228eb25588d@draigBrady.com>
Date: Tue, 29 Aug 2017 09:27:07 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <5406652.I5bSlMrxR1@kdudka-nb>
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]
	[fuzzy]
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: Tue, 29 Aug 2017 16:27:18 -0000

On 29/08/17 05:43, Kamil Dudka wrote:
> On Tuesday, August 29, 2017 10:49:17 AM CEST P=E1draig Brady wrote:
>> We plan to release coreutils-8.28 towards the end of this week,
>> so any testing you can do on various different systems between now and=
 then
>> would be most welcome.
>>
>> --------------------------------------
>>
>> You can download the coreutils snapshot in xz format (5.2 MB) from:
>>   https://pixelbeat.org/cu/coreutils-ss.tar.xz
>>
>> And verify with gpg or md5sum with:
>>   https://pixelbeat.org/cu/coreutils-ss.tar.xz.sig
>>   MD5 (coreutils-ss.tar.xz) =3D f38d980b63f88b66bf2415c3edf6313b
>>
>> --------------------------------------
>>
>> To test follow this standard procedure:
>>
>>   tar -xf coreutils-ss.tar.xz
>>   cd coreutils-8.27.99-3ebdc3/
>>   ./configure && make check VERBOSE=3Dyes
>>
>> Failures are reported and details are in tests/test-suite.log
>=20
> tests/misc/runcon-no-reorder.sh fails on my Fedora 25 VM if and only
> if coreutils is compiled _without_ having libseccomp-devel installed:
>=20
> FAIL: tests/misc/runcon-no-reorder
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

> + diff -u exp out
> --- exp 2017-08-29 14:39:57.481307950 +0200
> +++ out 2017-08-29 14:39:57.486307987 +0200
> @@ -1 +1 @@
> -runcon: runcon may be used only on a SELinux kernel
> +runcon: cannot create session

Indeed my setsid() is not robust because one really needs
to fork first (and check for -1 in the return).

However I've investigated a bit more libseccomp doesn't
provide that much protection. I.E. there are other ways
to input to a tty when passing it to a lower privilege process.

So it looks like libseccomp is not worth it,
and I'll remove that before release I think.

cheers,
P=E1draig


From MAILER-DAEMON Tue Aug 29 13:12:34 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmk41-0004IF-VM
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 13:12:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59831)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmk3y-0004Gh-P8
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:12:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmk3v-0004hp-J9
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:12:30 -0400
Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:34180)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dmk3v-0004hT-Cz
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:12:27 -0400
Received: by mail-io0-x232.google.com with SMTP id n71so23578062iod.1
	for <coreutils@gnu.org>; Tue, 29 Aug 2017 10:12:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=Q8xWBJPehHh8aLzDMaecd58xVzvZ17vrPFqYLNSLgAI=;
	b=c8RKP7GbkBzF4L/TA+kI2yLZfjemJ3w99UfVMaV2hs+c/ScvsUB9xNzli7rikBc9PL
	LAgQ1Q2H6MSfRU9bmrAsy8U7iPoxJLM0ZO9tsi34Kt1NMws8KS37PYPh8LIkjM/oJN5I
	9woVZBmaSYJlGo7Xi7nqSmGkAMoIgamRMxNmenlqE/w7HU8TiypE7t2zQx0rpCoMwR8o
	3jzbzEdj84Xy0SlbCzMSzFBHaf/QmSDcNqbcyH0qfaXZB0ghWMJUpDSQJbycLpwgbegn
	w3jtiPXJOwSr1HROJzUHsiOA8SxLQdeLFp1ulE+BLrD5/RL4pL+HhaI/Sz9+QcP90x5e
	3yPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=Q8xWBJPehHh8aLzDMaecd58xVzvZ17vrPFqYLNSLgAI=;
	b=r+uWiAV0xV6klVfuw7kJjnnkgkdo4nFwcfxWaAFIZeA8E8ge4z4XlAGADI6qFl+drM
	hclgi/p38GcQGz5ZDblzcxLyVwKETcB9C2GxytW9GystNDcjO2VHk8dGeT8w6CB2JJn2
	6GYZIyrXWZqfU7AKyela2JGvwvVvNbKr4XpOgyqgPmjGXgQRUKDeWFeX5YBsmhoPeNdZ
	6G8/BsIdKyjJ4bsTP3nONL85+/VcEJjDeAnnmUgZV81LxKBUe3lskWl5iNZnq4T6HUU5
	EJKwE7a0fkee9GOI4P4Wa703Rr0GwH5WwHVuwqhcr816DUFJbfGlOsmnf9yxL6lA3QK+
	KSzg==
X-Gm-Message-State: AHYfb5jGOu2elfHy63DqqwvVnRH5ts+3IR+5F1zS7WC4io7VGFN+eRKs
	4d8I+sxJFIhZ+xsvQQQ=
X-Received: by 10.36.203.65 with SMTP id u62mr3070431itg.159.1504026745384;
	Tue, 29 Aug 2017 10:12:25 -0700 (PDT)
Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38])
	by smtp.gmail.com with ESMTPSA id
	p197sm1076592itp.32.2017.08.29.10.12.23
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 29 Aug 2017 10:12:24 -0700 (PDT)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
Date: Tue, 29 Aug 2017 11:12:35 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::232
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, 29 Aug 2017 17:12:32 -0000

Hello Pádraig and all,

On 29/08/17 02:49 AM, Pádraig Brady wrote:
> https://pixelbeat.org/cu/coreutils-ss.tar.xz

Few things I noticed (other tests are still running):

1.
Possibly due to the recent "renameat2" addition,
compiling on linux now requires <linux/fs.h> header.
On GNU/Linux systems it is likely part of the "linux-libc-dev"
package and is always available,
but on non-gnu (e.g. AlpineLinux) it is not available by default.
compilation then fails with:
===
CC       lib/argmatch.o
CC       lib/argv-iter.o
CC       lib/backupfile.o
In file included from lib/backupfile.c:26:0:
lib/renameat2.h:22:23: fatal error: linux/fs.h: No such file or directory
# include <linux/fs.h>
^
compilation terminated.
make[2]: *** [Makefile:9125: lib/backupfile.o] Error 1
make[2]: Leaving directory
'/tmp/coreutils-8.27.99-3ebdc3.jaeLHE/coreutils-8.27.99-3ebdc3'
make[1]: *** [Makefile:11720: all-recursive] Error 1
make[1]: Leaving directory
'/tmp/coreutils-8.27.99-3ebdc3.jaeLHE/coreutils-8.27.99-3ebdc3'
make: *** [Makefile:5981: all] Error 2
===

It might be nice to detect this missing header during "configure" ?


2.
On OpenBSD 6.1, FreeBSD 11p1,
"tests/ln/sf-1" fails with "argument list too long".

Open BSD:
===
using SHELL=/bin/sh with 'set -x' corrupts stderr
ln (GNU coreutils) 8.27.99-3ebdc3
Copyright (C) 2017 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 Mike Parker and David MacKenzie.
./tests/ln/sf-1.sh[39]: *: unexpected `*'
./tests/ln/sf-1.sh[49]: ln: Argument list too long
./tests/ln/sf-1.sh[49]: ln: Argument list too long
FAIL tests/ln/sf-1.sh (exit status: 1)
===


FreeBSD:
===
[... trimmed for email ...]
+ ln -s ELOOP_link ELOOP_link
+ ln -s 000000000000000000000000000000000000000000000000000000000000000
./tests/ln/sf-1.sh: ln: Argument list too long
+ fail=1
+ ln -sf missing ENOENT_link
+ ln -sf a/b ENOTDIR_link
+ ln -sf ELOOP_link ELOOP_link
+ ln -sf 0000000000000000000000000000000000000000000000000000000000000
./tests/ln/sf-1.sh: ln: Argument list too long
+ fail=1
+ Exit 1
===


3.
On OpenIndiana 5.11 (SunOS-based), the following fail:

FAIL: tests/misc/csplit-io-err (false positive due to full disk).
FAIL: tests/misc/date-debug (problem in detecting invalid dates)
FAIL: tests/misc/tty (need to investigate)

In the following, the error seems to be:
   "preserving permissions for 'y/x': Operation not applicable"
FAIL: tests/cp/backup-dir
FAIL: tests/cp/cp-parents
FAIL: tests/cp/parent-perm-race
FAIL: tests/cp/preserve-link
FAIL: tests/cp/src-base-dot
FAIL: tests/mv/dup-source
===
Test log is here (722KB):
  https://pretest.housegordon.org/g/5287/logs/test-suite.0.log

I will soon have results from few more OpenSolaris systems
and will see if it occurs there as well.



4.
On FreeBSD 11p1, "tests/misc/stat-birthtime.sh" fails. A snippet:
===
+ touch a
+ stat --format %W a
+ test x1504024567 '=' x1504024567
+ stat --format %X a
+ test x1504024567 '!=' x1504024569
+ stat --format %Y a
+ test x1504024567 '!=' x1504024569
+ stat --format %Z a
+ test x1504024567 '!=' x1504024567
+ time_fail=1
+ expr 5 + 1
+ attempt=6
+ expr 16 '*' 2
+ num_sleeps=32
+ test 6 -le 5
+ test 1 '=' 0
+ fail=1
===


5.
On AIX 7.1 and 7.2, compilation succeeds but generating man pages fail with:
====
...
GEN      man/tail.1
GEN      man/tee.1
GEN      man/test.1
help2man: can't get `--help' info from man/test.td/[
Try `--no-discard-stderr' if option outputs to stderr
make: 1254-004 The error code from the last command is 127.
====
Mentioned before, not a show-stopper:
 https://lists.gnu.org/archive/html/bug-coreutils/2016-01/msg00041.html


-----

Lastly, no test failures on various gnu/liunx systems:
  CentOS 7.0.1406 (x86_64)
  Debian 8.9 (i686)
  Debian 9.1 (x86_64,CC=clang-4.0)
  Debian 9.1 (x86_64,CC=gcc)
  Debian 9.1 (x86_64,CC=gcc-4.9)
  Debian 9.1 (x86_64,CC=gcc-5.4)
  Debian 9.1 (x86_64,CC=gcc-6.4)
  Debian 9.1 (x86_64,CC=gcc-7.2)
  Debian unstable (sparc64)
  Fedora 25 (x86_64)
  Linux 3.10.0-514.26.2.el7.ppc64 (ppc64)
  SUSE LINUX 42.1 (x86_64)
  Trisquel 7.0 (x86_64)
  Ubuntu 14.04 (aarch64)
  Ubuntu 16.04 (x86_64)


All the above tests skipped the gnulib tests, only tested coreutils.


regards,
 -assaf


From MAILER-DAEMON Tue Aug 29 13:14:12 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmk5b-0005F7-Vi
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 13:14:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60887)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmk5Y-0005CQ-NZ
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:14:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmk5V-0005Yx-HY
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:14:08 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39790)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>)
	id 1dmk5V-0005XI-8M; Tue, 29 Aug 2017 13:14:05 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 3317C94CC;
	Tue, 29 Aug 2017 18:14:03 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.99-3ebdc3
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<20170829102317.GA7978@unix-ag.uni-kl.de>
Cc: coreutils@gnu.org, platform-testers@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <ff13ddda-ea5e-1f23-01a3-7248fd956e5c@draigBrady.com>
Date: Tue, 29 Aug 2017 10:14:01 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170829102317.GA7978@unix-ag.uni-kl.de>
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]
	[fuzzy]
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: Tue, 29 Aug 2017 17:14:10 -0000

On 29/08/17 03:23, Erik Auerswald wrote:
> Hi,
>=20
> On Tue, Aug 29, 2017 at 01:49:17AM -0700, P=E1draig Brady wrote:
>> We plan to release coreutils-8.28 towards the end of this week,
>> so any testing you can do on various different systems between now and=
 then
>> would be most welcome.
>> [...]
>>   tar -xf coreutils-ss.tar.xz
>>   cd coreutils-8.27.99-3ebdc3/
>>   ./configure && make check VERBOSE=3Dyes
>=20
> I have tested the snapshot on a Ubuntu LTS 14.04 x86_64 notebook follow=
ing the
> above procedure. One FAIL was reported:
>=20
> ----8<----
> FAIL: tests/df/df-symlink
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
>=20
> ++ initial_cwd_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3
> +++ testdir_prefix_
> +++ printf gt
> ++ pfx_=3Dgt
> +++ mktempd_ /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3 gt-df-symli=
nk.sh.XXXX
> +++ case $# in
> +++ destdir_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3
> +++ template_=3Dgt-df-symlink.sh.XXXX
> +++ MAX_TRIES_=3D4
> +++ case $destdir_ in
> +++ destdir_slash_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/
> +++ case $template_ in
> ++++ unset TMPDIR
> +++ d=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.sh=
.AJTG
> +++ case $d in
> +++ :
> +++ test -d /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlin=
k.sh.AJTG
> ++++ ls -dgo /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symli=
nk.sh.AJTG
> +++ perms=3D'drwx------ 2 4096 Aug 29 12:09 /home/auerswald/tmp/c/coreu=
tils-8.27.99-3ebdc3/gt-df-symlink.sh.AJTG'
> +++ case $perms in
> +++ :
> +++ echo /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.s=
h.AJTG
> +++ return
> ++ test_dir_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-sym=
link.sh.AJTG
> ++ cd /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.sh.A=
JTG
> ++ gl_init_sh_nl_=3D'
> '
> ++ IFS=3D'       =20
> '
> ++ for sig_ in 1 2 3 13 15
> +++ expr 1 + 128
> ++ eval 'trap '\''Exit 129'\'' 1'
> +++ trap 'Exit 129' 1
> ++ for sig_ in 1 2 3 13 15
> +++ expr 2 + 128
> ++ eval 'trap '\''Exit 130'\'' 2'
> +++ trap 'Exit 130' 2
> ++ for sig_ in 1 2 3 13 15
> +++ expr 3 + 128
> ++ eval 'trap '\''Exit 131'\'' 3'
> +++ trap 'Exit 131' 3
> ++ for sig_ in 1 2 3 13 15
> +++ expr 13 + 128
> ++ eval 'trap '\''Exit 141'\'' 13'
> +++ trap 'Exit 141' 13
> ++ for sig_ in 1 2 3 13 15
> +++ expr 15 + 128
> ++ eval 'trap '\''Exit 143'\'' 15'
> +++ trap 'Exit 143' 15
> ++ trap remove_tmp_ 0
> + path_prepend_ ./src
> + test 1 '!=3D' 0
> + path_dir_=3D./src
> + case $path_dir_ in
> + abs_path_dir_=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/./src
> + case $abs_path_dir_ in
> + PATH=3D/home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/./src:/home/aue=
rswald/tmp/c/coreutils-8.27.99-3ebdc3/src:/home/auerswald/bin:/usr/local/=
sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/g=
ames
> + create_exe_shims_ /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/./sr=
c
> + case $EXEEXT in
> + return 0
> + shift
> + test 0 '!=3D' 0
> + export PATH
> + print_ver_ df
> + require_built_ df
> + skip_=3Dno
> + for i in '"$@"'
> + case " $built_programs " in
> + test no =3D yes
> + test yes =3D yes
> + local i
> + for i in '$*'
> + env df --version
> df (GNU coreutils) 8.27.99-3ebdc3
> Copyright (C) 2017 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.
>=20
> Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert.
> ++ df --out=3Dsource .
> ++ tail -n1
> + disk=3D/home/auerswald/.Private
> + ln -s /home/auerswald/.Private symlink
> + df --out=3Dsource,target /home/auerswald/.Private
> + df --out=3Dsource,target symlink
> + compare exp out
> + compare_dev_null_ exp out
> + test 2 =3D 2
> + test xexp =3D x/dev/null
> + test xout =3D x/dev/null
> + return 2
> + case $? in
> + compare_ exp out
> + diff -u exp out
> ++ df --output=3Dsource
> ++ wc -l
> ++ grep -F /home/auerswald/.Private
> + test 1 =3D 1
> + df --out=3Dsource,target .
> + compare exp out
> + compare_dev_null_ exp out
> + test 2 =3D 2
> + test xexp =3D x/dev/null
> + test xout =3D x/dev/null
> + return 2
> + case $? in
> + compare_ exp out
> + diff -u exp out
> --- exp 2017-08-29 12:09:55.555199500 +0200
> +++ out 2017-08-29 12:09:55.563199639 +0200
> @@ -1,2 +1,2 @@
> -Filesystem     Mounted on
> -/dev/sda5      /
> +Filesystem               Mounted on
> +/home/auerswald/.Private /home/auerswald
> + fail=3D1
> + test 1 =3D 1
> + dump_mount_list_
> + cat /proc/self/mountinfo
> 17 22 0:15 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw
> 18 22 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
> 19 22 0:5 / /dev rw,relatime - devtmpfs udev rw,size=3D1975032k,nr_inod=
es=3D493758,mode=3D755
> 20 19 0:12 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=3D=
5,mode=3D620,ptmxmode=3D000
> 21 22 0:16 / /run rw,nosuid,noexec,relatime - tmpfs tmpfs rw,size=3D398=
136k,mode=3D755
> 22 1 8:5 / / rw,relatime - ext4 /dev/sda5 rw,errors=3Dremount-ro,data=3D=
ordered
> 23 17 0:17 / /sys/fs/cgroup rw,relatime - tmpfs none rw,size=3D4k,mode=3D=
755
> 24 17 0:18 / /sys/fs/fuse/connections rw,relatime - fusectl none rw
> 25 17 0:6 / /sys/kernel/debug rw,relatime - debugfs none rw
> 26 17 0:10 / /sys/kernel/security rw,relatime - securityfs none rw
> 27 21 0:19 / /run/lock rw,nosuid,nodev,noexec,relatime - tmpfs none rw,=
size=3D5120k
> 28 21 0:20 / /run/shm rw,nosuid,nodev,relatime - tmpfs none rw
> 29 21 0:21 / /run/user rw,nosuid,nodev,noexec,relatime - tmpfs none rw,=
size=3D102400k,mode=3D755
> 31 17 0:23 / /sys/fs/pstore rw,relatime - pstore none rw
> 30 23 0:22 / /sys/fs/cgroup/cpuset rw,relatime - cgroup cgroup rw,cpuse=
t
> 32 23 0:24 / /sys/fs/cgroup/cpu rw,relatime - cgroup cgroup rw,cpu
> 33 23 0:25 / /sys/fs/cgroup/cpuacct rw,relatime - cgroup cgroup rw,cpua=
cct
> 34 23 0:26 / /sys/fs/cgroup/memory rw,relatime - cgroup cgroup rw,memor=
y
> 35 23 0:27 / /sys/fs/cgroup/devices rw,relatime - cgroup cgroup rw,devi=
ces
> 36 23 0:28 / /sys/fs/cgroup/freezer rw,relatime - cgroup cgroup rw,free=
zer
> 37 23 0:29 / /sys/fs/cgroup/blkio rw,relatime - cgroup cgroup rw,blkio
> 38 23 0:30 / /sys/fs/cgroup/perf_event rw,relatime - cgroup cgroup rw,p=
erf_event
> 39 23 0:31 / /sys/fs/cgroup/hugetlb rw,relatime - cgroup cgroup rw,huge=
tlb
> 41 18 0:33 / /proc/sys/fs/binfmt_misc rw,nosuid,nodev,noexec,relatime -=
 binfmt_misc binfmt_misc rw
> 40 21 0:32 / /run/rpc_pipefs rw,relatime - rpc_pipefs rpc_pipefs rw
> 43 23 0:34 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - c=
group systemd rw,name=3Dsystemd
> 44 22 0:35 / /home/auerswald rw,nosuid,nodev,relatime - ecryptfs /home/=
auerswald/.Private rw,ecryptfs_fnek_sig=3D6ddd8201f948e7eb,ecryptfs_sig=3D=
b85d619f28625ea9,ecryptfs_cipher=3Daes,ecryptfs_key_bytes=3D16,ecryptfs_u=
nlink_sigs
> 45 29 0:36 / /run/user/1000/gvfs rw,nosuid,nodev,relatime - fuse.gvfsd-=
fuse gvfsd-fuse rw,user_id=3D1000,group_id=3D1000
> + Exit 1
> + set +e
> + exit 1
> + exit 1
> + remove_tmp_
> + __st=3D1
> + cleanup_
> + :
> + test '' =3D yes
> + cd /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3
> + chmod -R u+rwx /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-s=
ymlink.sh.AJTG
> + rm -rf /home/auerswald/tmp/c/coreutils-8.27.99-3ebdc3/gt-df-symlink.s=
h.AJTG
> + exit 1
> FAIL tests/df/df-symlink.sh (exit status: 1)
> ----8<----

There was a patch to df in this release, though I don't think it's relate=
d:
https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3Da19ff5d8
It's a one line patch worth testing reverted, but probably not the cause.

I suspect it's the test not handling overmounts like this correctly.
Particularly for you the difference is:

 $ df --out=3Dsource,target /home/auerswald/.Private
 Filesystem     Mounted on
 /dev/sda5      /

 df --out=3Dsource,target '.'
 Filesystem               Mounted on
 /home/auerswald/.Private /home/auerswald

thanks for testing,
P=E1draig


From MAILER-DAEMON Tue Aug 29 13:27:02 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmkI2-0000y2-Ra
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 13:27:02 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35514)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmkI0-0000xv-Pl
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:27:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmkHv-00030R-S8
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:27:00 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39934)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmkHv-0002zo-LI
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:26:55 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 4F05494F4;
	Tue, 29 Aug 2017 18:26:53 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <a59a2426-c3fd-e573-0a15-6d9cc44fdb46@draigBrady.com>
Date: Tue, 29 Aug 2017 10:26:51 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 29 Aug 2017 17:27:01 -0000

On 29/08/17 10:12, Assaf Gordon wrote:
> 2.
> On OpenBSD 6.1, FreeBSD 11p1,
> "tests/ln/sf-1" fails with "argument list too long".
> 
> Open BSD:
> ===
> using SHELL=/bin/sh with 'set -x' corrupts stderr
> ln (GNU coreutils) 8.27.99-3ebdc3
> Copyright (C) 2017 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 Mike Parker and David MacKenzie.
> ./tests/ln/sf-1.sh[39]: *: unexpected `*'
> ./tests/ln/sf-1.sh[49]: ln: Argument list too long
> ./tests/ln/sf-1.sh[49]: ln: Argument list too long
> FAIL tests/ln/sf-1.sh (exit status: 1)
> ===

Oh is the $((1024*1024)) not working on the BSDs?
That construct is used elsewhere in tests?

thanks for testing!


From MAILER-DAEMON Tue Aug 29 13:46:55 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmkbH-0007fx-CB
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 13:46:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41312)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmkbF-0007fh-01
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:46:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmkbB-0003z4-3P
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:46:53 -0400
Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:37689)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dmkbA-0003yr-Uv
	for coreutils@gnu.org; Tue, 29 Aug 2017 13:46:49 -0400
Received: by mail-io0-x241.google.com with SMTP id j99so4486817ioo.4
	for <coreutils@gnu.org>; Tue, 29 Aug 2017 10:46:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=Kl83djpHI62DvzinGi7ND5P56/1WIvlmIIcbCfYJo4Q=;
	b=ceRxOlviR2J7STWYVAiMfy59KnxUNLhawdvp4ZzPwhmYJgZ+Wn5qS1gh4/W0vScxF4
	Ta4kGK0bbfQiUrViYxrx5MGZt0XIoo+HTk5HtkDZzi9r084Jfs/26FBdIICxI0l5UcOq
	DHVf0KiyzXFJdRR8+l6r+zT0EZW6CHIxDkMib4v6gRwJqjoMiKLtMMo6Z5+TC/uGR1Mj
	3r+W4qutR56glvwWtTJbbMIWIHQkxio8ZxEGxdgAsLr4dLJAljY/poq8IflYrBxN3Co2
	SonYEIcp48YRQaza/cAy3rd9XOtXS+qs9IqU6cko0VD3J9NtYKxUItqOQzBwNEauqma7
	siBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=Kl83djpHI62DvzinGi7ND5P56/1WIvlmIIcbCfYJo4Q=;
	b=j+QHIFLBTzAlAltM7LcfBuqfJMNG9bES75454tLwayOox1QhOeXqa8p6TJ7tI6jSzU
	d9Gp+wRGDYKVMoOhujXmNh/D0oa5iUvaQWooobDBLfSf9NwPwjidzAr/zlCpU+PW11Ux
	wVVIinHEYccQbfknciCh5DEUJmmbCP3rxooDU8LkgpFe03EdtXQArCmwaUxp8CPOzZYg
	gCtCYas4rCyKI6j6egcx6lWeLUKi1M50tGkrRvK/iIxCa2bDIH6PGuzE4wt4AooM1POE
	0k+29RXTYsK9zB3Y6S1bKNWYay8OAv93Bc7mvR0aSUlBY/w6P37ot+wKOZ/GkKNQ0ZiZ
	ziww==
X-Gm-Message-State: AHYfb5gDm4CXx6/BairQX7j+Bh5/4vRY6yYs3IPfaOEGHTUezZ5qjxlt
	J25yZzWoeTe0EJxzJmI=
X-Received: by 10.36.156.70 with SMTP id b67mr2940239ite.22.1504028808046;
	Tue, 29 Aug 2017 10:46:48 -0700 (PDT)
Received: from [192.168.88.239] ([184.68.105.38])
	by smtp.gmail.com with ESMTPSA id
	h96sm1592000ioi.24.2017.08.29.10.46.47
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 29 Aug 2017 10:46:47 -0700 (PDT)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
	<a59a2426-c3fd-e573-0a15-6d9cc44fdb46@draigBrady.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <29f7a8f9-24b8-bbd2-aa74-f557f814bb2d@gmail.com>
Date: Tue, 29 Aug 2017 11:46:56 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <a59a2426-c3fd-e573-0a15-6d9cc44fdb46@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::241
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, 29 Aug 2017 17:46:54 -0000

On 29/08/17 11:26 AM, Pádraig Brady wrote:
> On 29/08/17 10:12, Assaf Gordon wrote:
>> 2.
>> On OpenBSD 6.1, FreeBSD 11p1,
>> "tests/ln/sf-1" fails with "argument list too long".
> 
> Oh is the $((1024*1024)) not working on the BSDs?
> That construct is used elsewhere in tests?
> 
Just got results from Mac OS X, which also fail with
"argument list too long", but the log is more helpful:
======
+name_max='*'
+name_limit=1048576
+test '*' -lt 1048576
./tests/ln/sf-1.sh: line 39: test: *: integer expression expected
+name_max=1048576
++expr 1048576 + 1
+name_max_plus1=1048577
+test 1048577 -gt 1
++printf '%0*d' 1048577 0
+long_name=000000000000000000000000000000000000000000000
+for f in ''\'''\''' f
+ln -s missing ENOENT_link
+ln -s a/b ENOTDIR_link
+ln -s ELOOP_link ELOOP_link
+ln -s 0000000000000000000000000000000000000000000000000ENAMETOOLONG_link
./tests/ln/sf-1.sh: line 48:
/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/coreutils-8.27.99-3ebdc3.XXXXXX.X6qm6ILK/coreutils-8.27.99-3ebdc3/./src/ln:
Argument list too long
+fail=1
+for f in ''\'''\''' f
+ln -sf missing ENOENT_link
+ln -sf a/b ENOTDIR_link
+ln -sf ELOOP_link ELOOP_link
+ln -sf 0000000000000000000000000ENAMETOOLONG_link
./tests/ln/sf-1.sh: line 48:
/var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/T/coreutils-8.27.99-3ebdc3.XXXXXX.X6qm6ILK/coreutils-8.27.99-3ebdc3/./src/ln:
Argument list too long
+fail=1
=======

(I trimmed the "0000...." filename for this email).

Seems like test doesn't like '*' as first argument.

Verified with OpenBSD:
  $ test '*' -lt 1
  ksh: *: unexpected `*'

And FreeBSD:
  $ test '*' -lt 1
  test: *: bad number
  $ echo $SHELL
  /bin/sh



-assaf


From MAILER-DAEMON Tue Aug 29 14:06:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmktz-0003nQ-IT
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 14:06:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44826)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmktx-0003nJ-DL
	for coreutils@gnu.org; Tue, 29 Aug 2017 14:06:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmkts-0006vc-B8
	for coreutils@gnu.org; Tue, 29 Aug 2017 14:06:13 -0400
Received: from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]:38546)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dmkts-0006ue-5w
	for coreutils@gnu.org; Tue, 29 Aug 2017 14:06:08 -0400
Received: by mail-io0-x231.google.com with SMTP id 81so24128019ioj.5
	for <coreutils@gnu.org>; Tue, 29 Aug 2017 11:06:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=xDhk2pePmCKkiPnMHDWaFO1gSF+6HT/ZdqVja5tLAks=;
	b=aa+m3Vl8h7g8Tsk9BdMhnb7PUjrYr6Cs7/CJcHWoctzNTQGGgh3H/jseB4UjfU5UmV
	dTMr2ZOyvkxL1Zwp6zxShuXoBjA8RJy6uiR2z84SeKtQzFDDXrPEOma8PgayVIp3BZQK
	hDfspfusGR4smX1nTWhgoyMGHwPaNRm0JKxIQngIPcQKzq0hp9aGW9pxarPhlRNm3Oqq
	5Lx0TpRwqzpQRwLNzge7zDZImM+PvOhKYbhbAtKtsaO3/WygLz+c7VEpnEI8V3izSrFm
	XZwoQG7JV+iOitBibe8Rqt2DnQBuyld7tlDcApx7CjAk4xxjgLee3WrHsHGWIHp64+Za
	853g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=xDhk2pePmCKkiPnMHDWaFO1gSF+6HT/ZdqVja5tLAks=;
	b=cOuEr71nlzP1TW0maeB4dnO/NLTjG2KdSzSjNmJqkK5Y9wrn4tbsOKXeR6M1lGdynh
	A699ptWXPPsSg1nfH1XHhwfESAF5QLMhuMr2BbCm3pZpbzajdM3QyhGBVuOEMgbUpDhB
	msciK/4/PLCJoJSqhQPnZWZqTMdb2KEoaac1I36U2VE4eMMquUHuAnh6SkOOBoNvwEl0
	uj0NtKWxFD4JFKwJfnrxfIII7Tp81mcKRr0KY0h7dRi+oMEhosz577mPbi5wV7kWYrgP
	EYE4RGOwCZip4ebI8PkFW72pKhpRvMbEOL0Scn6boOAhGU3FOMmzEiUUulO9b6Q3RvqW
	Yd0g==
X-Gm-Message-State: AHPjjUg2mOeJrRI6MlrdRJJr3pZ12vy98/wVK2cwLIEM6uEm03yENYRw
	OUMigUH8que6Cd5/9cc=
X-Received: by 10.107.186.196 with SMTP id k187mr1486113iof.329.1504029967181; 
	Tue, 29 Aug 2017 11:06:07 -0700 (PDT)
Received: from [192.168.88.239] ([184.68.105.38])
	by smtp.gmail.com with ESMTPSA id
	f140sm1667771ioe.27.2017.08.29.11.06.06
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 29 Aug 2017 11:06:06 -0700 (PDT)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
Date: Tue, 29 Aug 2017 12:06:15 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::231
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, 29 Aug 2017 18:06:14 -0000

Hello,

On 29/08/17 02:49 AM, Pádraig Brady wrote:
>   https://pixelbeat.org/cu/coreutils-ss.tar.xz

Two more failures


1.
on older Cent OS 6.5, and on OpenSolaris 5.11/i86pc,
"tests/misc/tty" tails.

Cent Os 6.5:

FAIL: tests/misc/tty
====================
+ test -t 0
+ returns_ 1 tty
not a tty
+ returns_ 1 tty -s
+ returns_ 2 tty a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ returns_ 2 tty -s a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ test -w /dev/full
+ test -c /dev/full
+ returns_ 3 tty
tty: standard input: Invalid argument
+ fail=1
+ returns_ 3 tty
tty: write error: No space left on device
+ returns_ 4 tty
+ returns_ 4 tty -s
+ Exit 1
==============

OpenSolaris:
====
[....]
+ test -t 0
+ returns_ 1 tty
not a tty
+ returns_ 1 tty -s
+ fail=1
+ returns_ 2 tty a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ returns_ 2 tty -s a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ test -w /dev/full
+ returns_ 4 tty
+ returns_ 4 tty -s
+ Exit 1
+ set +e
+ exit 1
[....]

On centos the last failure is false-positive (no space left on device,
a problem on my test VM).

The tty test was changed recently:
  commit 937388c3059d321797ac327452d71494fcebc655
  Date:   Wed Apr 5 11:34:42 2017 -0700
  Subject: tty: handle misconfigured namespaces

Could this be related?



2.
Perhaps low priority, but building
TinyCC (tcc) on Debian 9.1/x86, two tests fail:

====
FAIL: tests/misc/sleep
...
+ returns_ 1 timeout 10 sleep nan
+ fail=1
...
======
FAIL: tests/misc/stdbuf
...
+ diff -u exp out
--- exp	2017-08-29 11:15:15.026925252 -0600
+++ out	2017-08-29 11:15:15.126925250 -0600
@@ -1 +1,2 @@
1
+2
+ time_fail=1
...

[.... This fails repeatedly in a loop ... and then ...]
+ attempt=7
++ expr 32 '*' 2
+ num_sleeps=64
+ test 7 -le 6
+ test 1 = 0
+ fail=1
======
Full log here (603KB):
 https://pretest.housegordon.org/g/5307/logs/test-suite.0.log


----

On a separate note,
It seems that this latest coreutil build+test requires more disk space
than before - I seem to be running out of disk space on several VMs now.
Could be due to expected growth (which is fine),
or perhaps some new test leave a large file around?

regards,
 - assaf


From MAILER-DAEMON Tue Aug 29 14:58:05 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmli9-000776-6N
	for mharc-coreutils@gnu.org; Tue, 29 Aug 2017 14:58:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54077)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmli6-00076j-Ip
	for coreutils@gnu.org; Tue, 29 Aug 2017 14:58:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dmli3-0003li-He
	for coreutils@gnu.org; Tue, 29 Aug 2017 14:58:02 -0400
Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:37308)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dmli3-0003lV-Ct
	for coreutils@gnu.org; Tue, 29 Aug 2017 14:57:59 -0400
Received: by mail-io0-x22d.google.com with SMTP id d81so24588425ioj.4
	for <coreutils@gnu.org>; Tue, 29 Aug 2017 11:57:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:from:to:references:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=V0b6L2CcZiTBfNxDGusIqm3VSJQafbgerPsHxBmfeAk=;
	b=DPiTn95S3VX/NgPy+xSI+VDe3/9c46w+VuFvF3Mrneb/nvrhEGeViAFCAG/Nv4OVHW
	kGny6NRkV+Sd96jQxe/zCgGs1kl//lY4quvO5jUtLwzKxBvmLrWZNMQc6fqWrqVlWBzp
	1jCHqYrYI8CRvjFs+fGfyoJ4YZNftLen5Tf9E14dHAED3PaUyZVtO2qNRFV6GcaIoQ4D
	ry3bQDtwjDULgPff14hjM/qNcoLmBSgPHSGcXSPiIcg0ocDcB5uv/6OsD3U82KPz0dtX
	EuWnLzkyQeitfljU+tfG4shKDTuQJSo61k+WHVYGOL9G7D8hI923mSnqvrzNgGBLsV89
	KjjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:from:to:references:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=V0b6L2CcZiTBfNxDGusIqm3VSJQafbgerPsHxBmfeAk=;
	b=BDjGPaLfG7aBd7g5RKnDOHhQ219e8AW1eK5aVrZZOCdCjJ4AlzRjwoHzxRYNbUSI2N
	SBm8O+zl7o25XQ76h6Y0SfJb2MI0TSi11XpEDHzbBUjQUbPoSXbHuDZsh7EgqlmZIuxZ
	LPGCJjmSJZxozStXgFVVcj9DdCpuiT7s3XHDiWaRmJA6DJvTDOPaDhTxB5Gj4tAFOBoU
	t6+gk//tEjC219JntEZ9HUlQ/L/i7BvhsHqbC5Ze5/BfaW3V5Y9lO2/paNqdfHnUYf4Z
	wf+eLCK9HvdzWshEdQD+yzao3BISPl2XUkHMPFVleTjtkYMFFicssZ9Gx53rkwQAa0Ju
	g3kg==
X-Gm-Message-State: AHYfb5js+Tht6nq5+QSMTaPJxlCCVPTLgFil4x/thoablfOLDWXl1JVg
	fqreq6po6/bWx2hjVS4=
X-Received: by 10.107.154.65 with SMTP id c62mr4716888ioe.105.1504033078457;
	Tue, 29 Aug 2017 11:57:58 -0700 (PDT)
Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38])
	by smtp.gmail.com with ESMTPSA id k4sm1190762iti.5.2017.08.29.11.57.57
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 29 Aug 2017 11:57:57 -0700 (PDT)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
From: Assaf Gordon <assafgordon@gmail.com>
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
	<a59a2426-c3fd-e573-0a15-6d9cc44fdb46@draigBrady.com>
	<29f7a8f9-24b8-bbd2-aa74-f557f814bb2d@gmail.com>
Message-ID: <f1f87cb1-ce4e-3cc7-0979-c7d483c8ed8f@gmail.com>
Date: Tue, 29 Aug 2017 12:58:09 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <29f7a8f9-24b8-bbd2-aa74-f557f814bb2d@gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::22d
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, 29 Aug 2017 18:58:03 -0000

Few more:

1.
On CentOS 7/ppc64le, "tests/misc/runcon-no-reorder" fail
(as already reported by Kamil dudka in
https://lists.gnu.org/archive/html/coreutils/2017-08/msg00086.html ).

I see an old thread relating to mismatched 'runcon' error text here:
 https://lists.gnu.org/archive/html/bug-coreutils/2008-06/msg00175.html

The host is gcc112.fsffrance.org (from the GCC compile farm) - easy to
test/reproduce there.


2.
"tests/misc/tty" also fails on OpenSolaris 5.10 and 5.11, i86pc and
sparc.
The log shows:
====
[.....]
+ test -t 0
+ returns_ 1 tty
not a tty
+ returns_ 1 tty -s
+ fail=1
+ returns_ 2 tty a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ returns_ 2 tty -s a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ test -w /dev/full
+ returns_ 4 tty
+ returns_ 4 tty -s
[...]
======


3.
I previously reported 9 failures for OpenIndiana 5.11
( https://lists.gnu.org/archive/html/coreutils/2017-08/msg00089.html
item #3 ).
These do not fail on OpenSolaris 5.10/5.11 i86pc/sparc.
So perhaps a problem specific to OpenIndiana.


4.
"tests/ln/sf-1" also fails on older BSDs (OpenBSD 5.9, 6.0, FreeBSD 9.3,
10.1).



regards,
 - assaf



From MAILER-DAEMON Wed Aug 30 03:01:52 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmx0a-0000Jo-KB
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 03:01:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43643)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmx0Y-0000Jh-P8
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:01:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmx0S-0003OZ-PE
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:01:50 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:54484)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmx0S-0003Nu-Eh
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:01:44 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 E3694149;
	Wed, 30 Aug 2017 08:01:41 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
	<a59a2426-c3fd-e573-0a15-6d9cc44fdb46@draigBrady.com>
	<29f7a8f9-24b8-bbd2-aa74-f557f814bb2d@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <aabdca3a-519d-46db-ddfa-c6281c4dc06b@draigBrady.com>
Date: Wed, 30 Aug 2017 00:01:39 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <29f7a8f9-24b8-bbd2-aa74-f557f814bb2d@gmail.com>
Content-Type: multipart/mixed; boundary="------------9BFD073A22E03FAA35590E7D"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 30 Aug 2017 07:01:52 -0000

This is a multi-part message in MIME format.
--------------9BFD073A22E03FAA35590E7D
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 29/08/17 10:46, Assaf Gordon wrote:
> On 29/08/17 11:26 AM, P=C3=A1draig Brady wrote:
>> On 29/08/17 10:12, Assaf Gordon wrote:
>>> 2.
>>> On OpenBSD 6.1, FreeBSD 11p1,
>>> "tests/ln/sf-1" fails with "argument list too long".
>>
>> Oh is the $((1024*1024)) not working on the BSDs?
>> That construct is used elsewhere in tests?
>>
> Just got results from Mac OS X, which also fail with
> "argument list too long", but the log is more helpful:
> =3D=3D=3D=3D=3D=3D
> +name_max=3D'*'
> +name_limit=3D1048576
> +test '*' -lt 1048576
> ./tests/ln/sf-1.sh: line 39: test: *: integer expression expected
> +name_max=3D1048576
> ++expr 1048576 + 1
> +name_max_plus1=3D1048577

> Argument list too long
> +fail=3D1
> =3D=3D=3D=3D=3D=3D=3D

The attached should fix up this stat test issue,
and improve `stat -f -c %l` on FreeBSD and OpenBSD.

cheers,
P=C3=A1draig

--------------9BFD073A22E03FAA35590E7D
Content-Type: text/x-patch;
 name="bsd-stat-f-l.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="bsd-stat-f-l.patch"

=46rom f169345506ac5a095cd100d016c84dc44b33e851 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D <P@draigBrady.com>
Date: Tue, 29 Aug 2017 23:42:54 -0700
Subject: [PATCH] stat: fix determination of max name length on BSD system=
s

We only use one of statfs or statvfs for `stat -f`
and on the BSDs we use statfs which doesn't have the
f_namelen member.  However on OpenBSD and later FreeBSD
systems statfs does provide f_namemax, so use that.

* NEWS: Mention the improvement for OpenBSD and FreeBSD.
* m4/stat-prog.m4: Check for f_namemax in the statfs struct.
* src/stat.c: Return '?' rather than '*' when we can't
determine the max length of the file system.
* tests/ln/sf-1.sh: This test was failing on all BSDs
due to '*' being returned for the max length which
caused the test to attempt to create 1Mi+1 names.
The test now uses a short name when we can't determine
the max name length to use.

Reported by Assaf Gordon on various BSD based systems.
---
 NEWS             | 3 +++
 m4/stat-prog.m4  | 5 +++--
 src/stat.c       | 7 +++++--
 tests/ln/sf-1.sh | 8 +++-----
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/NEWS b/NEWS
index 94806bd..cc4a56e 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,9 @@ GNU coreutils NEWS                                   =
 -*- outline -*-
=20
   mv --verbose now distinguishes rename and copy operations.
=20
+  stat -f -c %l, used to output the max file name length on a file syste=
m,
+  is now supported on FreeBSD and OpenBSD.
+
   tail -f now exits immediately if the output is piped
   and the reader of the pipe terminates.
=20
diff --git a/m4/stat-prog.m4 b/m4/stat-prog.m4
index 8d29232..13c2dbb 100644
--- a/m4/stat-prog.m4
+++ b/m4/stat-prog.m4
@@ -72,8 +72,9 @@ AC_INCLUDES_DEFAULT
       [AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], [1],
          [Define to 1 if the f_fsid member of struct statvfs is an integ=
er.])])
   else
-    AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_type,
-                     struct statfs.f_frsize],,, [$statfs_includes])
+    AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_namemax,
+                      struct statfs.f_type, struct statfs.f_frsize],,,
+                     [$statfs_includes])
     if test $ac_cv_header_OS_h !=3D yes; then
       AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
diff --git a/src/stat.c b/src/stat.c
index 87b3ff4..19f5438 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -92,6 +92,8 @@
 # define HAVE_STRUCT_STATXFS_F_TYPE HAVE_STRUCT_STATFS_F_TYPE
 # if HAVE_STRUCT_STATFS_F_NAMELEN
 #  define SB_F_NAMEMAX(S) ((S)->f_namelen)
+# elif HAVE_STRUCT_STATFS_F_NAMEMAX
+#  define SB_F_NAMEMAX(S) ((S)->f_namemax)
 # endif
 # define STATFS statfs
 # if HAVE_OS_H /* BeOS */
@@ -139,8 +141,9 @@ statfs (char const *filename, struct fs_info *buf)
 #ifdef SB_F_NAMEMAX
 # define OUT_NAMEMAX out_uint
 #else
-/* NetBSD 1.5.2 has neither f_namemax nor f_namelen.  */
-# define SB_F_NAMEMAX(S) "*"
+/* Depending on whether statvfs or statfs is used,
+   neither f_namemax or f_namelen may be available.  */
+# define SB_F_NAMEMAX(S) "?"
 # define OUT_NAMEMAX out_string
 #endif
=20
diff --git a/tests/ln/sf-1.sh b/tests/ln/sf-1.sh
index 492fce9..c6dafdf 100755
--- a/tests/ln/sf-1.sh
+++ b/tests/ln/sf-1.sh
@@ -33,12 +33,10 @@ esac
=20
 # Ensure we replace symlinks that don't or can't link to an existing tar=
get.
 # coreutils-8.22 would fail to replace {ENOTDIR,ELOOP,ENAMETOOLONG}_link=
 below.
-name_max=3D$(stat -f -c %l .) || skip_ 'Error determining NAME_MAX'
-# Apply a limit since AIX returns 2^32-1 which would trigger resource is=
sues.
-name_limit=3D$((1024*1024))
-test "$name_max" -lt "$name_limit" || name_max=3D"$name_limit"
+# We apply a limit since AIX returns 2^32-1 which would trigger resource=
 issues.
+name_max=3D$(stat -f -c %l .) && test "$name_max" -lt $((1024*1024)) ||
+  name_max=3D1 # skip this portion of the test
 name_max_plus1=3D$(expr $name_max + 1)
-test $name_max_plus1 -gt 1 || skip_ 'Error determining NAME_MAX'
 long_name=3D$(printf '%0*d' $name_max_plus1 0)
=20
 for f in '' f; do
--=20
2.9.3


--------------9BFD073A22E03FAA35590E7D--


From MAILER-DAEMON Wed Aug 30 03:11:21 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmx9l-0002A1-Sp
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 03:11:21 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45482)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1dmx9k-00029J-3X
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:11:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1dmx9j-00078H-7O
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:11:20 -0400
Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:48027)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <auerswal@unix-ag.uni-kl.de>)
	id 1dmx9g-00076A-Ea; Wed, 30 Aug 2017 03:11:16 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
	[IPv6:2001:638:208:ef34:0:ff:fe00:65])
	by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
	v7U7BESY010060
	(version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); 
	Wed, 30 Aug 2017 09:11:14 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1])
	by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP
	id v7U7BCAM032419
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256
	verify=NO); Wed, 30 Aug 2017 09:11:12 +0200
Received: (from auerswal@localhost)
	by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id v7U7BCC5032418;
	Wed, 30 Aug 2017 09:11:12 +0200
Date: Wed, 30 Aug 2017 09:11:12 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org, platform-testers@gnu.org
Subject: Re: new snapshot available: coreutils-8.27.99-3ebdc3
Message-ID: <20170830071112.GB31140@unix-ag.uni-kl.de>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<20170829102317.GA7978@unix-ag.uni-kl.de>
	<ff13ddda-ea5e-1f23-01a3-7248fd956e5c@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <ff13ddda-ea5e-1f23-01a3-7248fd956e5c@draigBrady.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id
	v7U7BESY010060
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:638:208:120::220
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, 30 Aug 2017 07:11:21 -0000

Hi P=E1draig,

On Tue, Aug 29, 2017 at 10:14:01AM -0700, P=E1draig Brady wrote:
> On 29/08/17 03:23, Erik Auerswald wrote:
> > On Tue, Aug 29, 2017 at 01:49:17AM -0700, P=E1draig Brady wrote:
> >> We plan to release coreutils-8.28 towards the end of this week,
> >> so any testing you can do on various different systems between now a=
nd then
> >> would be most welcome.
> >> [...]
> >>   tar -xf coreutils-ss.tar.xz
> >>   cd coreutils-8.27.99-3ebdc3/
> >>   ./configure && make check VERBOSE=3Dyes
> >=20
> > I have tested the snapshot on a Ubuntu LTS 14.04 x86_64 notebook foll=
owing the
> > above procedure. One FAIL was reported:
> > [...]
>=20
> There was a patch to df in this release, though I don't think it's rela=
ted:
> https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3Da19ff5d8
> It's a one line patch worth testing reverted, but probably not the caus=
e.

The test tests/df/df-symlink still fails the same way with the above
patch reverted.

> I suspect it's the test not handling overmounts like this correctly.

That was my initial thought as well. Please note that this overmount is p=
art
of the "encrypted home dir" feature of Ubuntu, thus probably quite common.

> Particularly for you the difference is:
>=20
>  $ df --out=3Dsource,target /home/auerswald/.Private
>  Filesystem     Mounted on
>  /dev/sda5      /
>=20
>  df --out=3Dsource,target '.'
>  Filesystem               Mounted on
>  /home/auerswald/.Private /home/auerswald

Ubuntu installed into one partition with encrypted home directory.

Thanks,
Erik
--=20
A distributed system is one in which the failure of a computer you didn't
even know existed can render your own computer unusable.
                        -- Leslie Lamport


From MAILER-DAEMON Wed Aug 30 03:20:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmxIj-0003tD-St
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 03:20:37 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46872)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmxIh-0003t6-I5
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:20:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmxIc-0003Cy-EH
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:20:35 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:54582)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmxIc-0003Bh-89
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:20:30 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 B2EBD1FA;
	Wed, 30 Aug 2017 08:20:28 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <c6cb1064-7c87-614a-4e11-381a6c76d8bc@draigBrady.com>
Date: Wed, 30 Aug 2017 00:20:26 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
Content-Type: multipart/mixed; boundary="------------02FA7EC7FF089C91AF2BEAB6"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 30 Aug 2017 07:20:36 -0000

This is a multi-part message in MIME format.
--------------02FA7EC7FF089C91AF2BEAB6
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 29/08/17 10:12, Assaf Gordon wrote:
> 1.
> Possibly due to the recent "renameat2" addition,
> compiling on linux now requires <linux/fs.h> header.
> On GNU/Linux systems it is likely part of the "linux-libc-dev"
> package and is always available,
> but on non-gnu (e.g. AlpineLinux) it is not available by default.
> compilation then fails with:
> ===
> CC       lib/argmatch.o
> CC       lib/argv-iter.o
> CC       lib/backupfile.o
> In file included from lib/backupfile.c:26:0:
> lib/renameat2.h:22:23: fatal error: linux/fs.h: No such file or directory
> # include <linux/fs.h>

gnulib patch attached

--------------02FA7EC7FF089C91AF2BEAB6
Content-Type: text/x-patch;
 name="alpine-linux-fs-h.patch"
Content-Disposition: attachment;
 filename="alpine-linux-fs-h.patch"
Content-Transfer-Encoding: quoted-printable

>From 58c0514fa38c16ebef9db95e215195570862f872 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D <P@draigBrady.com>
Date: Wed, 30 Aug 2017 00:16:39 -0700
Subject: [PATCH] renameat2: fix compilation on alpine linux

* m4/renameat.m4: Check for <linux/fs.h> presence.
* lib/renameat2.h: Only include <linux/fs.h> if present.
Reported by Assaf Gordon on Alpine Linux.
---
 ChangeLog       | 7 +++++++
 lib/renameat2.h | 2 +-
 m4/renameat.m4  | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 994123a..0b3c06a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-30  P=C3=A1draig Brady  <P@draigBrady.com>
+
+	renameat2: fix compilation on alpine linux
+	* m4/renameat.m4: Check for <linux/fs.h> presence.
+	* lib/renameat2.h: Only include <linux/fs.h> if present.
+	Reported by Assaf Gordon on Alpine Linux.
+
 2017-08-24  Paul Eggert  <eggert@cs.ucla.edu>
=20
 	glob: try to port recent changes to MS-Windows
diff --git a/lib/renameat2.h b/lib/renameat2.h
index da3d78c..f69929b 100644
--- a/lib/renameat2.h
+++ b/lib/renameat2.h
@@ -18,7 +18,7 @@
=20
 /* Get RENAME_* macros from linux/fs.h if present, otherwise supply
    the traditional Linux values.  */
-#ifdef __linux__
+#if HAVE_LINUX_FS_H
 # include <linux/fs.h>
 #endif
 #ifndef RENAME_NOREPLACE
diff --git a/m4/renameat.m4 b/m4/renameat.m4
index cfbfe15..1b97774 100644
--- a/m4/renameat.m4
+++ b/m4/renameat.m4
@@ -14,6 +14,7 @@ AC_DEFUN([gl_FUNC_RENAMEAT],
   AC_REQUIRE([gl_FUNC_RENAME])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_HEADERS([linux/fs.h])
   AC_CHECK_FUNCS_ONCE([renameat])
   if test $ac_cv_func_renameat =3D no; then
     HAVE_RENAMEAT=3D0
--=20
2.9.3


--------------02FA7EC7FF089C91AF2BEAB6--


From MAILER-DAEMON Wed Aug 30 03:59:25 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmxuG-0004I9-TA
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 03:59:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55107)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmxuF-0004H8-6E
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:59:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmxuC-0006cZ-4m
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:59:23 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:54704)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmxuB-0006c8-UF
	for coreutils@gnu.org; Wed, 30 Aug 2017 03:59:20 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 482409495;
	Wed, 30 Aug 2017 08:59:17 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
	<a59a2426-c3fd-e573-0a15-6d9cc44fdb46@draigBrady.com>
	<29f7a8f9-24b8-bbd2-aa74-f557f814bb2d@gmail.com>
	<f1f87cb1-ce4e-3cc7-0979-c7d483c8ed8f@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <a565a9f1-1075-cb33-6231-6e8e2941c90f@draigBrady.com>
Date: Wed, 30 Aug 2017 00:59:14 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <f1f87cb1-ce4e-3cc7-0979-c7d483c8ed8f@gmail.com>
Content-Type: multipart/mixed; boundary="------------0B4C6131363AA77CAA0681C0"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 30 Aug 2017 07:59:24 -0000

This is a multi-part message in MIME format.
--------------0B4C6131363AA77CAA0681C0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 29/08/17 11:58, Assaf Gordon wrote:
> "tests/misc/tty" also fails on OpenSolaris 5.10 and 5.11, i86pc and
> sparc.
> The log shows:
> =3D=3D=3D=3D
> [.....]
> + test -t 0
> + returns_ 1 tty
> not a tty
> + returns_ 1 tty -s
> + fail=3D1

Hopefully the attached will address this.

thanks,
P=C3=A1draig

--------------0B4C6131363AA77CAA0681C0
Content-Type: text/x-patch;
 name="solaris-isatty.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="solaris-isatty.patch"

>From 9bd06744cd0efbb53bfbe3bffe11b98a6531c83f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 30 Aug 2017 00:55:34 -0700
Subject: [PATCH] tty: treat EINVAL the same as ENOTTY

* src/tty.c (main): All systems mention that EINVAL
may be returned as well as (the POSIX compliant) ENOTTY.
Reported by Assaf Gordon on OpenSolaris 5.10 and 5.11.
---
 src/tty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tty.c b/src/tty.c
index e84c353..994b356 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -119,7 +119,7 @@ main (int argc, char **argv)
 
   if (silent)
     return (isatty (STDIN_FILENO) ? EXIT_SUCCESS
-            : errno == ENOTTY ? TTY_STDIN_NOTTY
+            : (errno == ENOTTY || errno == EINVAL) ? TTY_STDIN_NOTTY
             : TTY_STDIN_ERROR);
 
   int status = EXIT_SUCCESS;
@@ -127,7 +127,7 @@ main (int argc, char **argv)
 
   if (! tty)
     {
-      if (errno != ENOTTY)
+      if (errno != ENOTTY && errno != EINVAL)
         error (TTY_STDIN_ERROR, errno, _("standard input"));
       tty = _("not a tty");
       status = TTY_STDIN_NOTTY;
-- 
2.9.3


--------------0B4C6131363AA77CAA0681C0--


From MAILER-DAEMON Wed Aug 30 04:03:34 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmxyI-0005mC-Bj
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 04:03:34 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55610)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmxyG-0005m5-6L
	for coreutils@gnu.org; Wed, 30 Aug 2017 04:03:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmxyD-00089t-3o
	for coreutils@gnu.org; Wed, 30 Aug 2017 04:03:32 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:54722)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmxyC-00089a-TA
	for coreutils@gnu.org; Wed, 30 Aug 2017 04:03:29 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 4361994AC;
	Wed, 30 Aug 2017 09:03:27 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.99-3ebdc3
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<20170829102317.GA7978@unix-ag.uni-kl.de>
	<ff13ddda-ea5e-1f23-01a3-7248fd956e5c@draigBrady.com>
	<20170830071112.GB31140@unix-ag.uni-kl.de>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <001c8c0b-a555-a6c7-2d0f-2b5b318e8caf@draigBrady.com>
Date: Wed, 30 Aug 2017 01:03:25 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170830071112.GB31140@unix-ag.uni-kl.de>
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]
	[fuzzy]
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: Wed, 30 Aug 2017 08:03:33 -0000

On 30/08/17 00:11, Erik Auerswald wrote:
> Hi P=E1draig,
>=20
> On Tue, Aug 29, 2017 at 10:14:01AM -0700, P=E1draig Brady wrote:
>> On 29/08/17 03:23, Erik Auerswald wrote:
>>> On Tue, Aug 29, 2017 at 01:49:17AM -0700, P=E1draig Brady wrote:
>>>> We plan to release coreutils-8.28 towards the end of this week,
>>>> so any testing you can do on various different systems between now a=
nd then
>>>> would be most welcome.
>>>> [...]
>>>>   tar -xf coreutils-ss.tar.xz
>>>>   cd coreutils-8.27.99-3ebdc3/
>>>>   ./configure && make check VERBOSE=3Dyes
>>>
>>> I have tested the snapshot on a Ubuntu LTS 14.04 x86_64 notebook foll=
owing the
>>> above procedure. One FAIL was reported:
>>> [...]
>>
>> There was a patch to df in this release, though I don't think it's rel=
ated:
>> https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3Da19ff5d8
>> It's a one line patch worth testing reverted, but probably not the cau=
se.
>=20
> The test tests/df/df-symlink still fails the same way with the above
> patch reverted.
>=20
>> I suspect it's the test not handling overmounts like this correctly.
>=20
> That was my initial thought as well. Please note that this overmount is=
 part
> of the "encrypted home dir" feature of Ubuntu, thus probably quite comm=
on.
>=20
>> Particularly for you the difference is:
>>
>>  $ df --out=3Dsource,target /home/auerswald/.Private
>>  Filesystem     Mounted on
>>  /dev/sda5      /
>>
>>  df --out=3Dsource,target '.'
>>  Filesystem               Mounted on
>>  /home/auerswald/.Private /home/auerswald
>=20
> Ubuntu installed into one partition with encrypted home directory.

Thanks for confirming that.
I'll add that as a new issue to be handled in df


From MAILER-DAEMON Wed Aug 30 04:29:28 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmyNM-0003pk-5o
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 04:29:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:32887)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmyNI-0003nB-13
	for coreutils@gnu.org; Wed, 30 Aug 2017 04:29:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmyND-00011V-7l
	for coreutils@gnu.org; Wed, 30 Aug 2017 04:29:24 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:57722)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmyND-00010R-00
	for coreutils@gnu.org; Wed, 30 Aug 2017 04:29:19 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 F0A7A9500;
	Wed, 30 Aug 2017 09:29:16 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <e23ca7f9-51ec-c34c-0989-85f891f55fc2@draigBrady.com>
Date: Wed, 30 Aug 2017 01:29:14 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
Content-Type: multipart/mixed; boundary="------------7728AD05620CB411FDAE4925"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 30 Aug 2017 08:29:26 -0000

This is a multi-part message in MIME format.
--------------7728AD05620CB411FDAE4925
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 29/08/17 11:06, Assaf Gordon wrote:
> Hello,
>=20
> On 29/08/17 02:49 AM, P=C3=A1draig Brady wrote:
>>   https://pixelbeat.org/cu/coreutils-ss.tar.xz
>=20
> Two more failures
>=20
>=20
> 1.
> on older Cent OS 6.5, and on OpenSolaris 5.11/i86pc,
> "tests/misc/tty" tails.
>=20
> Cent Os 6.5:
>=20
> FAIL: tests/misc/tty
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> + test -t 0
> + returns_ 1 tty
> not a tty
> + returns_ 1 tty -s
> + returns_ 2 tty a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + returns_ 2 tty -s a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + test -w /dev/full
> + test -c /dev/full
> + returns_ 3 tty
> tty: standard input: Invalid argument
> + fail=3D1
> + returns_ 3 tty
> tty: write error: No space left on device
> + returns_ 4 tty
> + returns_ 4 tty -s
> + Exit 1
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> OpenSolaris:
> =3D=3D=3D=3D
> [....]
> + test -t 0
> + returns_ 1 tty
> not a tty
> + returns_ 1 tty -s
> + fail=3D1
> + returns_ 2 tty a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + returns_ 2 tty -s a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + test -w /dev/full
> + returns_ 4 tty
> + returns_ 4 tty -s
> + Exit 1
> + set +e
> + exit 1
> [....]

The centos failure looks to be a test failure.
Updated tty patch is attached.

cheers


--------------7728AD05620CB411FDAE4925
Content-Type: text/x-patch;
 name="solaris-isatty.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="solaris-isatty.patch"

>From 2e3b00d0af7977ba53e1e8e6800940835b6b18fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 30 Aug 2017 00:55:34 -0700
Subject: [PATCH] tty: fix exit code on Solaris

* src/tty.c (main): All systems mention that EINVAL
may be returned as well as (the POSIX compliant) ENOTTY.
* tests/misc/tty.sh: Fix a test issue where we assume
standard input is always a valid tty.
Reported by Assaf Gordon on OpenSolaris 5.10 and 5.11.
---
 src/tty.c         | 4 ++--
 tests/misc/tty.sh | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/tty.c b/src/tty.c
index e84c353..994b356 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -119,7 +119,7 @@ main (int argc, char **argv)
 
   if (silent)
     return (isatty (STDIN_FILENO) ? EXIT_SUCCESS
-            : errno == ENOTTY ? TTY_STDIN_NOTTY
+            : (errno == ENOTTY || errno == EINVAL) ? TTY_STDIN_NOTTY
             : TTY_STDIN_ERROR);
 
   int status = EXIT_SUCCESS;
@@ -127,7 +127,7 @@ main (int argc, char **argv)
 
   if (! tty)
     {
-      if (errno != ENOTTY)
+      if (errno != ENOTTY && errno != EINVAL)
         error (TTY_STDIN_ERROR, errno, _("standard input"));
       tty = _("not a tty");
       status = TTY_STDIN_NOTTY;
diff --git a/tests/misc/tty.sh b/tests/misc/tty.sh
index 5931350..904b5d6 100755
--- a/tests/misc/tty.sh
+++ b/tests/misc/tty.sh
@@ -32,7 +32,9 @@ returns_ 2 tty a || fail=1
 returns_ 2 tty -s a || fail=1
 
 if test -w /dev/full && test -c /dev/full; then
-  returns_ 3 tty >/dev/full || fail=1
+  if test -t 0; then
+    returns_ 3 tty >/dev/full || fail=1
+  fi
   returns_ 3 tty </dev/null >/dev/full || fail=1
 fi
 
-- 
2.9.3


--------------7728AD05620CB411FDAE4925--


From MAILER-DAEMON Wed Aug 30 05:00:22 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmyrG-0006iW-9q
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 05:00:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43819)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmyrD-0006gM-PI
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:00:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmyr7-0007Yu-W0
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:00:19 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:57870)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dmyr7-0007YB-QD
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:00:13 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 2F5AA986C;
	Wed, 30 Aug 2017 10:00:11 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<6c96f28d-a823-dd82-ee31-658a0fa85aa0@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <7f68a284-47f2-6fe0-b2ea-3822d7a076b3@draigBrady.com>
Date: Wed, 30 Aug 2017 02:00:08 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <6c96f28d-a823-dd82-ee31-658a0fa85aa0@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]
	[fuzzy]
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: Wed, 30 Aug 2017 09:00:20 -0000

On 29/08/17 10:12, Assaf Gordon wrote:
> 4.
> On FreeBSD 11p1, "tests/misc/stat-birthtime.sh" fails. A snippet:
> =3D=3D=3D
> + touch a
> + stat --format %W a
> + test x1504024567 '=3D' x1504024567
> + stat --format %X a
> + test x1504024567 '!=3D' x1504024569
> + stat --format %Y a
> + test x1504024567 '!=3D' x1504024569
> + stat --format %Z a
> + test x1504024567 '!=3D' x1504024567
> + time_fail=3D1
> + expr 5 + 1
> + attempt=3D6
> + expr 16 '*' 2
> + num_sleeps=3D32
> + test 6 -le 5
> + test 1 '=3D' 0
> + fail=3D1
> =3D=3D=3D

Weird. So ctime is not updated even though mtime was?
That looks like a FreeBSD issue discrepancy.
I'm not going to look into that immediately though


From MAILER-DAEMON Wed Aug 30 05:13:10 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmz3e-0003iU-4z
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 05:13:10 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47027)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmz3b-0003iJ-I3
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:13:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dmz3W-0005jI-EN
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:13:07 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:57938)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>)
	id 1dmz3W-0005j2-7d; Wed, 30 Aug 2017 05:13:02 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 828F99894;
	Wed, 30 Aug 2017 10:12:59 +0100 (IST)
Subject: new snapshot available: coreutils-8.27.103-db8d1
To: coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Cc: coordinator@translationproject.org, platform-testers@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
Date: Wed, 30 Aug 2017 02:12:57 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.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]
	[fuzzy]
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: Wed, 30 Aug 2017 09:13:08 -0000

We plan to release coreutils-8.28 towards the end of this week,
so any testing you can do on various different systems between now and th=
en
would be most welcome.

--------------------------------------

You can download the coreutils snapshot in xz format (5.2 MB) from:
  https://pixelbeat.org/cu/coreutils-ss.tar.xz

And verify with gpg or md5sum with:
  https://pixelbeat.org/cu/coreutils-ss.tar.xz.sig
  MD5 (coreutils-ss.tar.xz) =3D a1712bf70c4fc51ee47a4aea20180514

--------------------------------------

To test follow this standard procedure:

  tar -xf coreutils-ss.tar.xz
  cd coreutils-8.27.103-db8d1/
  ./configure && make check VERBOSE=3Dyes

Failures are reported and details are in tests/test-suite.log

--------------------------------------

Changes since the previous snapshot are:

commit db8d1bb92c7431546625e3222b3494b6e81e0ae0
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 01:33:06 2017 -0700

    build: fix build of renameat2 on Alpine Linux

    * gnulib: The only change included in this update
    it the added check for the presence of <linux/fs.h>
    which is not present on Alpine Linux by default.
    Reported by Assaf Gordon

commit d95294982960a4a81889722fd79f1fedc04c8ee5
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 00:55:34 2017 -0700

    tty: fix exit code with EINVAL

    * src/tty.c (main): All systems mention that isatty()
    man return EINVAL as well as (the POSIX compliant) ENOTTY.
    Also Centos 6 was seen to return EINVAL from ttyname().
    * tests/misc/tty.sh: Fix a test issue where we assume
    standard input is always a valid tty.
    Reported by Assaf Gordon on OpenSolaris 5.10 and 5.11,
    and Centos 6.5

commit f5d7c0842ef7adc2be6e85f9ef66b35ebbbd6a61
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 00:27:41 2017 -0700

    runcon: revert "disable use of the TIOCSTI ioctl"

    This reverts commit v8.27-97-g8cb06d4 because
    the setsid() fallback was not implemented correctly
    and disabling the ioctl was not a complete solution
    to the security issue of the child being passed
    the tty of the parent.

    Given runcon is not really a sandbox command,
    the advice is to use `runcon ... setsid ...`
    to avoid this particular issue.

    Reported by Assaf Gordon and Kamil Dudka

commit f169345506ac5a095cd100d016c84dc44b33e851
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Tue Aug 29 23:42:54 2017 -0700

    stat: fix determination of max name length on BSD systems

    We only use one of statfs or statvfs for `stat -f`
    and on the BSDs we use statfs which doesn't have the
    f_namelen member.  However on OpenBSD and later FreeBSD
    systems statfs does provide f_namemax, so use that.

    * NEWS: Mention the improvement for OpenBSD and FreeBSD.
    * m4/stat-prog.m4: Check for f_namemax in the statfs struct.
    * src/stat.c: Return '?' rather than '*' when we can't
    determine the max length of the file system.
    * tests/ln/sf-1.sh: This test was failing on all BSDs
    due to '*' being returned for the max length which
    caused the test to attempt to create 1Mi+1 names.
    The test now uses a short name when we can't determine
    the max name length to use.

    Reported by Assaf Gordon on various BSD based systems.

thanks,
P=C3=A1draig.


From MAILER-DAEMON Wed Aug 30 05:20:22 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dmzAb-0006zY-VZ
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 05:20:21 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49157)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <yugandharbhoomi@gmail.com>) id 1dmzAa-0006zO-Gj
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:20:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <yugandharbhoomi@gmail.com>) id 1dmzAW-0008LH-Lu
	for coreutils@gnu.org; Wed, 30 Aug 2017 05:20:20 -0400
Received: from mail-it0-x22c.google.com ([2607:f8b0:4001:c0b::22c]:38626)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <yugandharbhoomi@gmail.com>)
	id 1dmzAT-0008K8-QG; Wed, 30 Aug 2017 05:20:13 -0400
Received: by mail-it0-x22c.google.com with SMTP id 77so4935890itj.1;
	Wed, 30 Aug 2017 02:20:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=eg0orkAF1ABG2VazKUQZdeQFB9ytbEFWR18dmnGfXaA=;
	b=XrqRVk6DTmw/u4bQ2dYlkhQCAFHL7R3feYx9Qgul0xlx0BdKJIiiiY36C4/pmwjgF7
	NT6mqI7gz3++ogY3Bfo1D37WEaC6w1sZapUt6RGhtn1FeNyxdZ/0HyICwRkR7mqCzqj7
	99JDi16x0gEP4Uj7D63uQ+r9JJXRzxIjGWJ3jEk2Az2FUjYz6Fc1aXBbdc1bD6HmURsD
	8e9g6dkrqAAL+M/L1DXk6akb4seGTyzOO/feIT21f1uwkEfd53t9rSHLdagWvXG3OMRJ
	orTOpqFPW96IMxe4nxid/H0TdZ7+BuLDawjKCN+dQpX1HjZwmcDW9XnDCWjI+DflEkOP
	a7Pw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=eg0orkAF1ABG2VazKUQZdeQFB9ytbEFWR18dmnGfXaA=;
	b=E6aopplcubrFSGlEfvY/5AuvhEGkAQqogqcPzV1L2BEVPIFOfHTV5rbzjrvwMjVx6y
	pYt9kdNe5tqbVeYPDCQV3waeXFg2JeY0EGDyten4n++sd0HsD/QD33rC8D9nz2dUhsLn
	ZPDYrfg9F3zn/ZXa47Og4DE8bFqazyi3/KZJtHrZb7LU7nK1KYeZHh12zjAFIzTzuOZA
	ABlt5tr1daEhSIiSvpR4ggRsmHtaRuTUKi+ie2ptzfqaYV8AFMGbqAZXpabg+hamWF6L
	df/MeGS7A5dav1lXTscJEkdwBRgEulMf9Bv6crWFU2YDHVCyfBYEKTSDIW+PL1P1CP7Y
	KELQ==
X-Gm-Message-State: AHYfb5g/9przyElk1Ml8oOyhQBvAGOvKvC3mmFQZ8CrerAYn0bjRrTG9
	Br7wuvZWcmiFRe9NpRfxumREYSPCL6EB
X-Received: by 10.36.237.8 with SMTP id r8mr914708ith.125.1504084812969; Wed,
	30 Aug 2017 02:20:12 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.155.193 with HTTP; Wed, 30 Aug 2017 02:20:12 -0700 (PDT)
In-Reply-To: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
From: Ravinder <yugandharbhoomi@gmail.com>
Date: Wed, 30 Aug 2017 14:50:12 +0530
Message-ID: <CAMO4kbCSHRUR-1Cr7w8GmAH7P1LAyUwicgprN=RRQrPiYb3V5g@mail.gmail.com>
Subject: Re: Need to know technical support for GnuWin32: CoreUtils 5.3.0
	versions
To: bug-coreutils@gnu.org, coreutils@gnu.org
Cc: Ravinder.padigela@in.ibm.com
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c0b::22c
Content-Type: text/plain; charset="UTF-8"
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: Wed, 30 Aug 2017 09:20:21 -0000

Hi,

Could you please help us on the below.

Regards,
Ravinder. P.

On Thu, Aug 24, 2017 at 4:54 PM, Ravinder <yugandharbhoomi@gmail.com> wrote:

> Hi,
>
> We are using GnuWin32: CoreUtils 5.3.0 versions in our project, so
> requesting you to know whether the technical support is still giving for
> these versions, so that we will plan our project to use the latest version
> of GnuWin32: CoreUtils.
>
> Kindly feel free & revert me ASAP.
>
>
> Thanks!!!
>
>
> Regard's,
> Ravinder. P.
>

From MAILER-DAEMON Wed Aug 30 06:14:50 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dn01K-0000xM-2u
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 06:14:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60612)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1dn01H-0000sa-T0
	for coreutils@gnu.org; Wed, 30 Aug 2017 06:14:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1dn01H-0008Dr-3w
	for coreutils@gnu.org; Wed, 30 Aug 2017 06:14:47 -0400
Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:39340)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <auerswal@unix-ag.uni-kl.de>)
	id 1dn01A-00086g-1B; Wed, 30 Aug 2017 06:14:40 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
	[IPv6:2001:638:208:ef34:0:ff:fe00:65])
	by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
	v7UAEbOn011330
	(version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); 
	Wed, 30 Aug 2017 12:14:37 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1])
	by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP
	id v7UAEaBA008109
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256
	verify=NO); Wed, 30 Aug 2017 12:14:36 +0200
Received: (from auerswal@localhost)
	by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id v7UAEZW0008108;
	Wed, 30 Aug 2017 12:14:35 +0200
Date: Wed, 30 Aug 2017 12:14:35 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org, platform-testers@gnu.org
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
Message-ID: <20170830101435.GC31140@unix-ag.uni-kl.de>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id
	v7UAEbOn011330
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:638:208:120::220
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, 30 Aug 2017 10:14:48 -0000

Hi,

On Wed, Aug 30, 2017 at 02:12:57AM -0700, P=E1draig Brady wrote:
> We plan to release coreutils-8.28 towards the end of this week,
> so any testing you can do on various different systems between now and =
then
> would be most welcome.

For what it's worth, the new snapshot did not introduce any new FAILs on
my Ubuntu 14.04 system.

Thanks,
Erik
--=20
Simplicity is prerequisite for reliability.
                        -- Edsger W. Dijkstra


From MAILER-DAEMON Wed Aug 30 07:50:49 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dn1WD-0004p6-Mu
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 07:50:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56193)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dn1WB-0004nk-D4
	for coreutils@gnu.org; Wed, 30 Aug 2017 07:50:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kdudka@redhat.com>) id 1dn1WA-0006GL-AR
	for coreutils@gnu.org; Wed, 30 Aug 2017 07:50:47 -0400
Received: from mx1.redhat.com ([209.132.183.28]:36402)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kdudka@redhat.com>) id 1dn1WA-0006G5-3k
	for coreutils@gnu.org; Wed, 30 Aug 2017 07:50:46 -0400
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com
	[10.5.11.16])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id BC70F7EA92;
	Wed, 30 Aug 2017 11:50:44 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BC70F7EA92
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=kdudka@redhat.com
Received: from localhost.localdomain (unknown [10.43.2.37])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 92C0F98141;
	Wed, 30 Aug 2017 11:50:43 +0000 (UTC)
From: Kamil Dudka <kdudka@redhat.com>
To: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Cc: coreutils@gnu.org,
	Assaf Gordon <assafgordon@gmail.com>
Subject: [PATCH] expr: plug a memory leak in eval6()
Date: Wed, 30 Aug 2017 13:50:42 +0200
Message-Id: <20170830115042.22438-1-kdudka@redhat.com>
In-Reply-To: <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
References: <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.28]);
	Wed, 30 Aug 2017 11:50:45 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 30 Aug 2017 11:50:48 -0000

* src/expr.c (eval6): Free memory allocated by mbs_logical_substr().

Introduced in v8.27-47-ga9f2be5.  Detected by Coverity Analysis:

Error: RESOURCE_LEAK:
src/expr.c:849: alloc_fn: Storage is returned from allocation function "mbs_logical_substr".
src/expr.c:275:5: alloc_fn: Storage is returned from allocation function "xstrdup".
lib/xmalloc.c:121:3: alloc_fn: Storage is returned from allocation function "xmemdup".
lib/xmalloc.c:113:3: alloc_fn: Storage is returned from allocation function "xmalloc".
lib/xmalloc.c:41:11: alloc_fn: Storage is returned from allocation function "malloc".
lib/xmalloc.c:41:11: var_assign: Assigning: "p" = "malloc(n)".
lib/xmalloc.c:44:3: return_alloc: Returning allocated memory "p".
lib/xmalloc.c:113:3: identity_transfer: Passing "xmalloc(s)" as argument 1 to function "memcpy", which returns that argument. [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/xmalloc.c:113:3: return_alloc_fn: Directly returning storage allocated by "memcpy".
lib/xmalloc.c:121:3: return_alloc_fn: Directly returning storage allocated by "xmemdup".
src/expr.c:275:5: return_alloc_fn: Directly returning storage allocated by "xstrdup".
src/expr.c:849: var_assign: Assigning: "s" = storage returned from "mbs_logical_substr(l->u.s, pos, len)".
src/expr.c:850: noescape: Resource "s" is not freed or pointed-to in "str_value".
src/expr.c:488:24: noescape: "str_value(char const *)" does not free or save its parameter "s".
src/expr.c:851: leaked_storage: Variable "s" going out of scope leaks the storage it points to.
849|             char *s = mbs_logical_substr (l->u.s, pos, len);
850|             v = str_value (s);
851|->         }
852|         freev (l);
853|         freev (i1);
---
 src/expr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/expr.c b/src/expr.c
index 795140c..0f6f87a 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -848,6 +848,7 @@ eval6 (bool evaluate)
 
           char *s = mbs_logical_substr (l->u.s, pos, len);
           v = str_value (s);
+          free(s);
         }
       freev (l);
       freev (i1);
-- 
2.9.5



From MAILER-DAEMON Wed Aug 30 09:16:23 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dn2r1-0005Tw-PK
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 09:16:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48447)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dn2qs-0005Pu-3g
	for coreutils@gnu.org; Wed, 30 Aug 2017 09:16:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dn2qr-0000F7-6W
	for coreutils@gnu.org; Wed, 30 Aug 2017 09:16:14 -0400
Received: from mx1.redhat.com ([209.132.183.28]:39046)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eblake@redhat.com>)
	id 1dn2qi-000094-Ke; Wed, 30 Aug 2017 09:16:04 -0400
Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com
	[10.5.11.13])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id AE7974ACBB;
	Wed, 30 Aug 2017 13:16:03 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AE7974ACBB
Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=eblake@redhat.com
Received: from [10.10.122.186] (ovpn-122-186.rdu2.redhat.com [10.10.122.186])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 174B57090A;
	Wed, 30 Aug 2017 13:16:01 +0000 (UTC)
Subject: Re: Need to know technical support for GnuWin32: CoreUtils 5.3.0
	versions
To: Ravinder <yugandharbhoomi@gmail.com>, bug-coreutils@gnu.org,
	coreutils@gnu.org
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
	<CAMO4kbCSHRUR-1Cr7w8GmAH7P1LAyUwicgprN=RRQrPiYb3V5g@mail.gmail.com>
Cc: Ravinder.padigela@in.ibm.com
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <2562a558-88c8-6915-3fc9-a08b47a0549d@redhat.com>
Date: Wed, 30 Aug 2017 08:16:00 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <CAMO4kbCSHRUR-1Cr7w8GmAH7P1LAyUwicgprN=RRQrPiYb3V5g@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="GpjHhQSwiQvmwiLxpXollCsSq0V3ROF7r"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.38]);
	Wed, 30 Aug 2017 13:16:03 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 30 Aug 2017 13:16:22 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--GpjHhQSwiQvmwiLxpXollCsSq0V3ROF7r
From: Eric Blake <eblake@redhat.com>
To: Ravinder <yugandharbhoomi@gmail.com>, bug-coreutils@gnu.org,
 coreutils@gnu.org
Cc: Ravinder.padigela@in.ibm.com
Message-ID: <2562a558-88c8-6915-3fc9-a08b47a0549d@redhat.com>
Subject: Re: Need to know technical support for GnuWin32: CoreUtils 5.3.0
 versions
References: <CAMO4kbBmzxsenoBKqzg_1oVYOSaVs6-cN_3B9OajoZqqC0YkJA@mail.gmail.com>
 <CAMO4kbCSHRUR-1Cr7w8GmAH7P1LAyUwicgprN=RRQrPiYb3V5g@mail.gmail.com>
In-Reply-To: <CAMO4kbCSHRUR-1Cr7w8GmAH7P1LAyUwicgprN=RRQrPiYb3V5g@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 08/30/2017 04:20 AM, Ravinder wrote:
> Hi,
>=20
> Could you please help us on the below.

I'm afraid you're not going to get any additional help from this list
beyond the answers you've already been given, because we don't have any
further answers:
http://debbugs.gnu.org/28224

Repeatedly asking the wrong list, when you've already been told it is
the wrong list, and when you have already been pointed to the website of
the downstream GnuWin32 distribution that you should be asking instead,
is not winning you any friends.

--=20
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

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

iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlmmupEACgkQp6FrSiUn
Q2pktwgAnr8cmbPN4VqJTIIqpQ5v5FCZQyrgp9OetccMQQfEd8QRuoG0/9rA+y4d
zJ35alAEkBW06n6hcaJ1Xq+s3SmT150YXCKtAhyrYimbzepRwm5flwF4iYMLKRdo
1+P3zLrry2m6MYj6C+Fz74wefYALZFuGzIFQhklUmVP251UtwM1T5J0pEfck5ULq
XSVMH3BXHlvn5Tbbw+zJ5Bjh0cqRxjEQdz9D7Rbr5k07DMJMoN8lsj2tFzq0adnV
eVMwz4X4jce1cF6V4D+/gK3kSx5kb3Yk8nnvDmPrE1cxuRu4Yd0NrRCSWyvUekBR
800LEAoFyBdOVqxLwmynBEioqqGstQ==
=XtV0
-----END PGP SIGNATURE-----

--GpjHhQSwiQvmwiLxpXollCsSq0V3ROF7r--


From MAILER-DAEMON Wed Aug 30 14:52:50 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dn86c-00070p-Jz
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 14:52:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35183)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dn86a-00070W-18
	for coreutils@gnu.org; Wed, 30 Aug 2017 14:52:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dn86X-00009r-CK
	for coreutils@gnu.org; Wed, 30 Aug 2017 14:52:48 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58560)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dn86X-000089-6h
	for coreutils@gnu.org; Wed, 30 Aug 2017 14:52:45 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 B68A894B3;
	Wed, 30 Aug 2017 19:52:42 +0100 (IST)
Subject: Re: [PATCH] expr: plug a memory leak in eval6()
To: Kamil Dudka <kdudka@redhat.com>
References: <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
	<20170830115042.22438-1-kdudka@redhat.com>
Cc: coreutils@gnu.org, Assaf Gordon <assafgordon@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <719eedbd-bd3f-cc2d-886b-7c820550fd7c@draigBrady.com>
Date: Wed, 30 Aug 2017 11:52:40 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170830115042.22438-1-kdudka@redhat.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 30 Aug 2017 18:52:50 -0000

On 30/08/17 04:50, Kamil Dudka wrote:
> * src/expr.c (eval6): Free memory allocated by mbs_logical_substr().
> 
> Introduced in v8.27-47-ga9f2be5.  Detected by Coverity Analysis:

> src/expr.c:851: leaked_storage: Variable "s" going out of scope leaks the storage it points to.
> 849|             char *s = mbs_logical_substr (l->u.s, pos, len);
> 850|             v = str_value (s);
> 851|->         }
> 852|         freev (l);
> 853|         freev (i1);

> ---
>  src/expr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/expr.c b/src/expr.c
> index 795140c..0f6f87a 100644
> --- a/src/expr.c
> +++ b/src/expr.c
> @@ -848,6 +848,7 @@ eval6 (bool evaluate)
>  
>            char *s = mbs_logical_substr (l->u.s, pos, len);
>            v = str_value (s);
> +          free(s);
>          }
>        freev (l);
>        freev (i1);
> -- 2.9.5

Excellent.
Applied

Thank you!


From MAILER-DAEMON Wed Aug 30 20:21:49 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnDEz-0000Ni-Eu
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 20:21:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49575)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnDEw-0000Ka-G7
	for coreutils@gnu.org; Wed, 30 Aug 2017 20:21:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnDEs-0000Gi-KR
	for coreutils@gnu.org; Wed, 30 Aug 2017 20:21:45 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:34372)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnDEs-0000FU-Dq
	for coreutils@gnu.org; Wed, 30 Aug 2017 20:21:42 -0400
Received: from localhost.net (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id D72BE4ADC;
	Thu, 31 Aug 2017 01:21:39 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: skip tests upon failure to set SELinux context
Date: Wed, 30 Aug 2017 17:21:30 -0700
Message-Id: <20170831002130.5321-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 31 Aug 2017 00:21:47 -0000

On some setups the root:object_r:tmp_t context is invalid.
This does indicate a limitation in the test framework,
but for now we'll relax this to skipping the tests.
The tests still run on a Fedora 25 system for example.

* tests/cp/cp-a-selinux.sh: Upon chcon error, skip rather than ERROR.
* tests/install/install-Z-selinux.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/runcon-no-reorder.sh: Likewise.
* tests/misc/selinux.sh: Likewise.
* tests/mkdir/restorecon.sh: Likewise.
---
 tests/cp/cp-a-selinux.sh           | 2 +-
 tests/install/install-Z-selinux.sh | 2 +-
 tests/misc/chcon.sh                | 2 +-
 tests/misc/runcon-no-reorder.sh    | 2 +-
 tests/misc/selinux.sh              | 3 +--
 tests/mkdir/restorecon.sh          | 2 +-
 6 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/tests/cp/cp-a-selinux.sh b/tests/cp/cp-a-selinux.sh
index de07406..5db1f5b 100755
--- a/tests/cp/cp-a-selinux.sh
+++ b/tests/cp/cp-a-selinux.sh
@@ -33,7 +33,7 @@ mls_enabled_ && ctx="$ctx:s0"
 
 # Check basic functionality - before check on fixed context mount
 touch c || framework_failure_
-chcon $ctx c || framework_failure_
+chcon $ctx c || skip "Failed to set context: $ctx"
 cp -a c d 2>err || framework_failure_
 cp --preserve=context c e || framework_failure_
 cp --preserve=all c f || framework_failure_
diff --git a/tests/install/install-Z-selinux.sh b/tests/install/install-Z-selinux.sh
index ad2e1cd..e3d2048 100755
--- a/tests/install/install-Z-selinux.sh
+++ b/tests/install/install-Z-selinux.sh
@@ -24,7 +24,7 @@ require_selinux_
 mkdir subdir || framework_failure_
 ctx='root:object_r:tmp_t'
 mls_enabled_ && ctx="$ctx:s0"
-chcon "$ctx" subdir || framework_failure_
+chcon "$ctx" subdir || skip "Failed to set context: $ctx"
 cd subdir
 
 # Since in a tmp_t dir, dirs can be created as user_tmp_t ...
diff --git a/tests/misc/chcon.sh b/tests/misc/chcon.sh
index 13a72a0..55fcc63 100755
--- a/tests/misc/chcon.sh
+++ b/tests/misc/chcon.sh
@@ -35,7 +35,7 @@ r1=object_r
 t1=tmp_t
 range=s0
 ctx=$u1:$r1:$t1:$range
-chcon $ctx f || fail=1
+chcon $ctx f || skip "Failed to set context: $ctx"
 stat --printf='f|%C\n' f > out || fail=1
 
 # Use --reference.
diff --git a/tests/misc/runcon-no-reorder.sh b/tests/misc/runcon-no-reorder.sh
index 370771b..f905cfc 100755
--- a/tests/misc/runcon-no-reorder.sh
+++ b/tests/misc/runcon-no-reorder.sh
@@ -30,7 +30,7 @@ echo "$diag" > exp || framework_failure_
 runcon $(id -Z) true -j 2> out && > exp
 
 # When run on a system with no /selinux/context (i.e., in a chroot),
-# it chcon fails with this: "runcon: invalid context: \
+# it fails with this: "runcon: invalid context: \
 # root:system_r:unconfined_t:s0-s0:c0.c1023: No such file or directory"
 # That diagnostic is ok, too, so map it to the more common one.
 case $(cat out) in
diff --git a/tests/misc/selinux.sh b/tests/misc/selinux.sh
index ee1217a..bc6da96 100755
--- a/tests/misc/selinux.sh
+++ b/tests/misc/selinux.sh
@@ -33,8 +33,7 @@ mkfifo_or_skip_ p
 ctx='root:object_r:tmp_t'
 mls_enabled_ && ctx="$ctx:s0"
 
-chcon $ctx f d p ||
-  skip_ '"chcon '$ctx' ..." failed'
+chcon $ctx f d p || skip "Failed to set context: $ctx"
 
 # inspect that context with both ls -Z and stat.
 for i in d f p; do
diff --git a/tests/mkdir/restorecon.sh b/tests/mkdir/restorecon.sh
index fa74b33..e117ed9 100755
--- a/tests/mkdir/restorecon.sh
+++ b/tests/mkdir/restorecon.sh
@@ -23,7 +23,7 @@ require_selinux_
 mkdir subdir || framework_failure_
 ctx='root:object_r:tmp_t'
 mls_enabled_ && ctx="$ctx:s0"
-chcon "$ctx" subdir || framework_failure_
+chcon "$ctx" subdir || skip "Failed to set context: $ctx"
 cd subdir
 
 # --- mkdir -Z ---
-- 
2.9.3



From MAILER-DAEMON Wed Aug 30 20:31:29 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnDOK-0002lF-V6
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 20:31:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50520)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnDOI-0002l6-Dp
	for coreutils@gnu.org; Wed, 30 Aug 2017 20:31:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnDOD-00036i-Gg
	for coreutils@gnu.org; Wed, 30 Aug 2017 20:31:26 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:34392)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnDOD-00036O-A2
	for coreutils@gnu.org; Wed, 30 Aug 2017 20:31:21 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 7F1064B1B;
	Thu, 31 Aug 2017 01:31:19 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Assaf Gordon <assafgordon@gmail.com>, Paul Eggert <eggert@CS.UCLA.EDU>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <bb7319d4-9048-6113-96a8-3010bcd2f333@draigBrady.com>
Date: Wed, 30 Aug 2017 17:31:17 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <a1658a3a-5831-b5b9-0683-72190021e356@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]
	[fuzzy]
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, 31 Aug 2017 00:31:27 -0000

On 29/08/17 11:06, Assaf Gordon wrote:
> On a separate note,
> It seems that this latest coreutil build+test requires more disk space
> than before - I seem to be running out of disk space on several VMs now=
.
> Could be due to expected growth (which is fine),
> or perhaps some new test leave a large file around?

I notice the new test-fts in gnulib was taking a while,
and it creates 128K files/dirs on a quick look.
Perhaps that's triggering the issue?

Do you see the issue if you ignore the gnulib tests with:
  make check SUBDIRS=3D.

cheers,
P=C3=A1draig


From MAILER-DAEMON Wed Aug 30 21:08:39 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnDyJ-0004lm-Qb
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 21:08:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55405)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dnDyH-0004lb-TJ
	for coreutils@gnu.org; Wed, 30 Aug 2017 21:08:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dnDyC-0006Da-0r
	for coreutils@gnu.org; Wed, 30 Aug 2017 21:08:37 -0400
Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:33063)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dnDyB-0006D2-RX
	for coreutils@gnu.org; Wed, 30 Aug 2017 21:08:31 -0400
Received: by mail-io0-x22d.google.com with SMTP id s101so13913906ioe.0
	for <coreutils@gnu.org>; Wed, 30 Aug 2017 18:08:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=subject:to:references:from:message-id:date:user-agent:mime-version
	:in-reply-to:content-language:content-transfer-encoding;
	bh=dN00WbSQEsEi1V+0m5eoin7CTsLgG4EROYjnKSE6GQ0=;
	b=VaF0DfU/GQqYnoXDRfObTVwPNGXhgSw+C07FVwt032LQITfL5SBPGKCOqBV5n/fSP7
	aVF8zKN7OoGYoUAXyd26jyqkw/5cyZ13AGF0P6aRRmatTY0Qw+gDFgARDXEBEtynvScG
	6QUpTmIcxX2wjRDNIaG5G8EPrSjVAt/FY/sPS3iyYDxzUxgC+iOsgEWxXsVr6coU7fwa
	BZaSv7s/x9L+Y5iyKYMNh7lTKTOqoU7rFMD3MrK28kAfCbpn54TOPn1QEedbLyuRzhXC
	5JOeBg8YRHvLGMk72CMwl5cdbBhB60jGIwAVGOB/rFoayb2c6aJ+tg2Jstu/DmHJvnUk
	lUgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-language
	:content-transfer-encoding;
	bh=dN00WbSQEsEi1V+0m5eoin7CTsLgG4EROYjnKSE6GQ0=;
	b=S59YhVx0TCwi0KutcCjXcRFdt5uoow7bGCvhg6oZX/fh9vhPHYdcqF7etAfMl2+nSy
	//3BrnMphsUmeX8hjTMcaP0xxyEqfZ8AQgbkuWTas16u6ta190ZgN8GC5jZPpI36Twoc
	Sf/ogj4+l9JyG/xUbW/ssN9P1oGA9cUEx+O02JChFV3mSLYdE2n6q1yLMDLiwzgDoafz
	kM93wCjhATdqLs240S/zBU2LlhPrbcSy3JtaovDf5tqvll1QzU1opze2DcxsTizzYZmq
	dKknX752gnCn29LgIPdjMX4X/mSMkgc1BdmbV6EJTHiaI7JRXJOa22pvlibyhsULIP4f
	KAcQ==
X-Gm-Message-State: AHPjjUjaW+P+r8Vb6H+qBgxTbzYVzVzEVYdEgibB55f8Md/ZH2t5Invk
	vRdkL7RwJE+Vid1OB0Y=
X-Received: by 10.107.10.94 with SMTP id u91mr1241555ioi.115.1504141708681;
	Wed, 30 Aug 2017 18:08:28 -0700 (PDT)
Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38])
	by smtp.gmail.com with ESMTPSA id
	e24sm3215223ioj.63.2017.08.30.18.08.26
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Wed, 30 Aug 2017 18:08:26 -0700 (PDT)
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
From: Assaf Gordon <assafgordon@gmail.com>
Message-ID: <db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
Date: Wed, 30 Aug 2017 19:08:36 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4001:c06::22d
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, 31 Aug 2017 01:08:39 -0000

Hello Pádraig and all,

On 30/08/17 03:12 AM, Pádraig Brady wrote:
>   https://pixelbeat.org/cu/coreutils-ss.tar.xz
>   tar -xf coreutils-ss.tar.xz
>   cd coreutils-8.27.103-db8d1/
>   ./configure && make check VERBOSE=yes

Many previously issues are now fixed.

New failures:

On alpine-Linux (musl-libc and busybox) - everything now compiles fine,
but two tests fail:

====
FAIL: tests/misc/tty
[...]
+ test -t 0
+ returns_ 1 tty
not a tty
+ returns_ 1 tty -s
+ fail=1
+ returns_ 2 tty a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ returns_ 2 tty -s a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ test -w /dev/full
+ test -c /dev/full
+ test -t 0
+ returns_ 3 tty
tty: write error
+ returns_ 4 tty
not a tty
+ fail=1
+ returns_ 4 tty -s
+ Exit 1
+ set +e
+ exit 1
======
FAIL: tests/ln/sf-1
[...]
+ printf %0*d 256 0
ash: %0*d: invalid format
+ long_name=
+ ln -s missing ENOENT_link
+ ln -s a/b ENOTDIR_link
+ ln -s ELOOP_link ELOOP_link
+ ln -s  ENAMETOOLONG_link
ln: failed to create symbolic link 'ENAMETOOLONG_link' -> '': No such
file or directory
+ fail=1
+ ln -sf missing ENOENT_link
+ ln -sf a/b ENOTDIR_link
+ ln -sf ELOOP_link ELOOP_link
+ ln -sf  ENAMETOOLONG_link
ln: failed to create symbolic link 'ENAMETOOLONG_link' -> '': No such
file or directory
+ fail=1
+ Exit 1
======
(I guess printf(1) in Busybox's "ash" does not accept this format).


On Mac OS X, a gnulib test fails (but no coreutils test failures):
====
FAIL: test-utime
================

test-utime.c:112: assertion 'utime (BASE "link/", NULL) == -1' failed
FAIL test-utime (exit status: 134)
====



Existing Failures;

On OpenSolaris 5.10/5.11, "tests/misc/tty" still fails:
===
+ test -t 0
+ returns_ 1 tty
not a tty
+ returns_ 1 tty -s
+ fail=1
+ returns_ 2 tty a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ returns_ 2 tty -s a
tty: extra operand 'a'
Try 'tty --help' for more information.
+ test -w /dev/full
+ returns_ 4 tty
+ returns_ 4 tty -s
+ Exit 1
+ set +e
+ exit 1
+ exit 1
===



regards,
 - assaf



From MAILER-DAEMON Wed Aug 30 22:12:41 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnEyH-000055-BP
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 22:12:41 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37187)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnEyE-0008WU-AX
	for coreutils@gnu.org; Wed, 30 Aug 2017 22:12:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnEyA-0002wp-BO
	for coreutils@gnu.org; Wed, 30 Aug 2017 22:12:38 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:40504)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnEyA-0002wA-4g
	for coreutils@gnu.org; Wed, 30 Aug 2017 22:12:34 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 BC76C94D3;
	Thu, 31 Aug 2017 03:12:31 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
	<db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
Date: Wed, 30 Aug 2017 19:12:28 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <db7e3c69-9895-e1a8-aab9-02ba960255bb@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]
	[fuzzy]
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, 31 Aug 2017 02:12:39 -0000

On 30/08/17 18:08, Assaf Gordon wrote:
> Hello P=C3=A1draig and all,
>=20
> On 30/08/17 03:12 AM, P=C3=A1draig Brady wrote:
>>   https://pixelbeat.org/cu/coreutils-ss.tar.xz
>>   tar -xf coreutils-ss.tar.xz
>>   cd coreutils-8.27.103-db8d1/
>>   ./configure && make check VERBOSE=3Dyes
>=20
> Many previously issues are now fixed.
>=20
> New failures:
>=20
> On alpine-Linux (musl-libc and busybox) - everything now compiles fine,
> but two tests fail:
>=20
> =3D=3D=3D=3D
> FAIL: tests/misc/tty
> [...]
> + test -t 0
> + returns_ 1 tty
> not a tty
> + returns_ 1 tty -s
> + fail=3D1
> + returns_ 2 tty a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + returns_ 2 tty -s a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + test -w /dev/full
> + test -c /dev/full
> + test -t 0
> + returns_ 3 tty
> tty: write error
> + returns_ 4 tty
> not a tty
> + fail=3D1
> + returns_ 4 tty -s
> + Exit 1
> + set +e
> + exit 1
> =3D=3D=3D=3D=3D=3D
> FAIL: tests/ln/sf-1
> [...]
> + printf %0*d 256 0
> ash: %0*d: invalid format

> (I guess printf(1) in Busybox's "ash" does not accept this format).

Indeed:
$ sudo dnf install busybox
$ busybox ash -c 'printf %0*d 256 0'
ash: %0*d: invalid format

Since this is the only ash specific issue it seems, I'll avoid like:

-long_name=3D$(printf '%0*d' $name_max_plus1 0)
+long_name=3D$(yes 0 | head -n$name_max_plus1 | tr -d '\n')

>=20
> On Mac OS X, a gnulib test fails (but no coreutils test failures):
> =3D=3D=3D=3D
> FAIL: test-utime
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> test-utime.c:112: assertion 'utime (BASE "link/", NULL) =3D=3D -1' fail=
ed
> FAIL test-utime (exit status: 134)
> =3D=3D=3D=3D
>=20
>=20
>=20
> Existing Failures;
>=20
> On OpenSolaris 5.10/5.11, "tests/misc/tty" still fails:
> =3D=3D=3D
> + test -t 0
> + returns_ 1 tty
> not a tty
> + returns_ 1 tty -s
> + fail=3D1
> + returns_ 2 tty a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + returns_ 2 tty -s a
> tty: extra operand 'a'
> Try 'tty --help' for more information.
> + test -w /dev/full
> + returns_ 4 tty
> + returns_ 4 tty -s
> + Exit 1
> + set +e
> + exit 1
> + exit 1
> =3D=3D=3D

Looks like solaris doesn't distinguish ENOTTY and EBADF
It returns ENOENT in all isatty() failure cases :/

I might change things so that tty doesn't distinguish
these failure cases on input.
I.E. just return 1 for all errors on input

cheers,
P=C3=A1draig


From MAILER-DAEMON Wed Aug 30 23:42:04 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnGMm-0006rD-4r
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 23:42:04 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54376)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnGMi-0006r7-Sc
	for coreutils@gnu.org; Wed, 30 Aug 2017 23:42:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnGMe-0006TB-E9
	for coreutils@gnu.org; Wed, 30 Aug 2017 23:42:00 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:40786)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnGMe-0006Qq-2x
	for coreutils@gnu.org; Wed, 30 Aug 2017 23:41:56 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 6364D9A67;
	Thu, 31 Aug 2017 04:41:53 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
	<db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
	<61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <3b963a2b-acb3-a35a-c867-f8594a886595@draigBrady.com>
Date: Wed, 30 Aug 2017 20:41:51 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------940313FC74DE49DAAF5E2961"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 31 Aug 2017 03:42:03 -0000

This is a multi-part message in MIME format.
--------------940313FC74DE49DAAF5E2961
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 30/08/17 19:12, P=C3=A1draig Brady wrote:
> On 30/08/17 18:08, Assaf Gordon wrote:
>> Hello P=C3=A1draig and all,
>>
>> On 30/08/17 03:12 AM, P=C3=A1draig Brady wrote:
>>>   https://pixelbeat.org/cu/coreutils-ss.tar.xz
>>>   tar -xf coreutils-ss.tar.xz
>>>   cd coreutils-8.27.103-db8d1/
>>>   ./configure && make check VERBOSE=3Dyes
>>
>> Many previously issues are now fixed.
>>
>> New failures:
>>
>> On alpine-Linux (musl-libc and busybox) - everything now compiles fine=
,
>> but two tests fail:
>>
>> =3D=3D=3D=3D
>> FAIL: tests/misc/tty
>> [...]
>> + test -t 0
>> + returns_ 1 tty
>> not a tty
>> + returns_ 1 tty -s
>> + fail=3D1
>> + returns_ 2 tty a
>> tty: extra operand 'a'
>> Try 'tty --help' for more information.
>> + returns_ 2 tty -s a
>> tty: extra operand 'a'
>> Try 'tty --help' for more information.
>> + test -w /dev/full
>> + test -c /dev/full
>> + test -t 0
>> + returns_ 3 tty
>> tty: write error
>> + returns_ 4 tty
>> not a tty
>> + fail=3D1
>> + returns_ 4 tty -s
>> + Exit 1
>> + set +e
>> + exit 1
>> =3D=3D=3D=3D=3D=3D
>> FAIL: tests/ln/sf-1
>> [...]
>> + printf %0*d 256 0
>> ash: %0*d: invalid format
>=20
>> (I guess printf(1) in Busybox's "ash" does not accept this format).
>=20
> Indeed:
> $ sudo dnf install busybox
> $ busybox ash -c 'printf %0*d 256 0'
> ash: %0*d: invalid format
>=20
> Since this is the only ash specific issue it seems, I'll avoid like:
>=20
> -long_name=3D$(printf '%0*d' $name_max_plus1 0)
> +long_name=3D$(yes 0 | head -n$name_max_plus1 | tr -d '\n')
>=20
>>
>> On Mac OS X, a gnulib test fails (but no coreutils test failures):
>> =3D=3D=3D=3D
>> FAIL: test-utime
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>
>> test-utime.c:112: assertion 'utime (BASE "link/", NULL) =3D=3D -1' fai=
led
>> FAIL test-utime (exit status: 134)
>> =3D=3D=3D=3D
>>
>>
>>
>> Existing Failures;
>>
>> On OpenSolaris 5.10/5.11, "tests/misc/tty" still fails:
>> =3D=3D=3D
>> + test -t 0
>> + returns_ 1 tty
>> not a tty
>> + returns_ 1 tty -s
>> + fail=3D1
>> + returns_ 2 tty a
>> tty: extra operand 'a'
>> Try 'tty --help' for more information.
>> + returns_ 2 tty -s a
>> tty: extra operand 'a'
>> Try 'tty --help' for more information.
>> + test -w /dev/full
>> + returns_ 4 tty
>> + returns_ 4 tty -s
>> + Exit 1
>> + set +e
>> + exit 1
>> + exit 1
>> =3D=3D=3D
>=20
> Looks like solaris doesn't distinguish ENOTTY and EBADF
> It returns ENOENT in all isatty() failure cases :/
>=20
> I might change things so that tty doesn't distinguish
> these failure cases on input.
> I.E. just return 1 for all errors on input

I'm going with the two attached patches to avoid these issues.

cheers,
P=C3=A1draig


--------------940313FC74DE49DAAF5E2961
Content-Type: text/x-patch;
 name="alpine.tests.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="alpine.tests.patch"

>From 5ee9c8f7a6d3f2cec5eb4b086f05a60f67c8b052 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 30 Aug 2017 20:05:31 -0700
Subject: [PATCH 1/2] tests: avoid printf '0*d' construct unsupported by ash

* tests/ln/sf-1.sh: Generate specific length with space padding
which is supported.
Reported by Assaf Gordon on Alpine Linux.
---
 tests/ln/sf-1.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ln/sf-1.sh b/tests/ln/sf-1.sh
index c6dafdf..36d5b29 100755
--- a/tests/ln/sf-1.sh
+++ b/tests/ln/sf-1.sh
@@ -37,7 +37,7 @@ esac
 name_max=$(stat -f -c %l .) && test "$name_max" -lt $((1024*1024)) ||
   name_max=1 # skip this portion of the test
 name_max_plus1=$(expr $name_max + 1)
-long_name=$(printf '%0*d' $name_max_plus1 0)
+long_name=$(printf '%*s' $name_max_plus1 | tr ' ' '0')
 
 for f in '' f; do
   ln -s$f missing ENOENT_link || fail=1
-- 
2.9.3


>From 2f98755bb8c5af989d495999419f0db1097afc38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 30 Aug 2017 20:14:22 -0700
Subject: [PATCH 2/2] tty: don't distinguish input errors

* src/tty.c (main): Don't distinguish ENOTTY from other errors,
because isatty() doesn't portably distinguish errors.
Solaris returns ENOENT for all input errors for example.
Musl also returns ENOENT, and ENODEV may be returned as disscussed at:
http://openwall.com/lists/musl/2017/04/06/6
* tests/misc/tty.sh: Adjust accordingly.
---
 src/tty.c         | 9 ++-------
 tests/misc/tty.sh | 5 ++---
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/tty.c b/src/tty.c
index 994b356..5e88c87 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -35,8 +35,7 @@ enum
   {
     TTY_STDIN_NOTTY = 1,
     TTY_FAILURE = 2,
-    TTY_WRITE_ERROR = 3,
-    TTY_STDIN_ERROR = 4
+    TTY_WRITE_ERROR = 3
   };
 
 /* The official name of this program (e.g., no 'g' prefix).  */
@@ -118,17 +117,13 @@ main (int argc, char **argv)
   errno = ENOENT;
 
   if (silent)
-    return (isatty (STDIN_FILENO) ? EXIT_SUCCESS
-            : (errno == ENOTTY || errno == EINVAL) ? TTY_STDIN_NOTTY
-            : TTY_STDIN_ERROR);
+    return isatty (STDIN_FILENO) ? EXIT_SUCCESS : TTY_STDIN_NOTTY;
 
   int status = EXIT_SUCCESS;
   char const *tty = ttyname (STDIN_FILENO);
 
   if (! tty)
     {
-      if (errno != ENOTTY && errno != EINVAL)
-        error (TTY_STDIN_ERROR, errno, _("standard input"));
       tty = _("not a tty");
       status = TTY_STDIN_NOTTY;
     }
diff --git a/tests/misc/tty.sh b/tests/misc/tty.sh
index 904b5d6..aa3203b 100755
--- a/tests/misc/tty.sh
+++ b/tests/misc/tty.sh
@@ -27,6 +27,8 @@ fi
 
 returns_ 1 tty </dev/null || fail=1
 returns_ 1 tty -s </dev/null || fail=1
+returns_ 1 tty <&- 2>/dev/null || fail=1
+returns_ 1 tty -s <&- || fail=1
 
 returns_ 2 tty a || fail=1
 returns_ 2 tty -s a || fail=1
@@ -38,7 +40,4 @@ if test -w /dev/full && test -c /dev/full; then
   returns_ 3 tty </dev/null >/dev/full || fail=1
 fi
 
-returns_ 4 tty <&- 2>/dev/null || fail=1
-returns_ 4 tty -s <&- || fail=1
-
 Exit $fail
-- 
2.9.3


--------------940313FC74DE49DAAF5E2961--


From MAILER-DAEMON Wed Aug 30 23:46:39 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnGRC-0007yu-TP
	for mharc-coreutils@gnu.org; Wed, 30 Aug 2017 23:46:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54965)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnGRA-0007yJ-N1
	for coreutils@gnu.org; Wed, 30 Aug 2017 23:46:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnGR5-00035T-P8
	for coreutils@gnu.org; Wed, 30 Aug 2017 23:46:36 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:40816)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnGR5-00034V-I9
	for coreutils@gnu.org; Wed, 30 Aug 2017 23:46:31 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 DD0819A92;
	Thu, 31 Aug 2017 04:46:29 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
	<db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
	<61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
	<3b963a2b-acb3-a35a-c867-f8594a886595@draigBrady.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <e059767a-caf0-5c8d-669d-32018b9aa001@draigBrady.com>
Date: Wed, 30 Aug 2017 20:46:27 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <3b963a2b-acb3-a35a-c867-f8594a886595@draigBrady.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]
	[fuzzy]
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, 31 Aug 2017 03:46:37 -0000

On 30/08/17 20:41, P=C3=A1draig Brady wrote:

>> Looks like solaris doesn't distinguish ENOTTY and EBADF
>> It returns ENOENT in all isatty() failure cases :/
>>
>> I might change things so that tty doesn't distinguish
>> these failure cases on input.
>> I.E. just return 1 for all errors on input
>=20
> I'm going with the two attached patches to avoid these issues.

Oops, with these doc adjustments on top:

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 5a0c476..eb17462 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -15123,7 +15123,6 @@ Exit status:
 1 if standard input is a non-terminal file
 2 if given incorrect arguments
 3 if a write error occurs
-4 if standard input is closed or its type cannot be determined
 @end display


diff --git a/src/tty.c b/src/tty.c
index 5e88c87..c02a0d0 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -17,7 +17,7 @@
 /* Displays "not a tty" if stdin is not a terminal.
    Displays nothing if -s option is given.
    Exit status 0 if stdin is a tty, 1 if not a tty, 2 if usage error,
-   3 if write error, 4 for other stdin errors.
+   3 if write error.




From MAILER-DAEMON Thu Aug 31 01:05:57 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnHfx-0005ha-BJ
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 01:05:57 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37997)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1dnHfv-0005hT-Fn
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:05:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1dnHfs-0005cd-C7
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:05:55 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44114)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eggert@cs.ucla.edu>) id 1dnHfs-0005aY-5v
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:05:52 -0400
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id D1B50160865;
	Wed, 30 Aug 2017 22:05:48 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id Td9JV_y3Cdcn; Wed, 30 Aug 2017 22:05:48 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by zimbra.cs.ucla.edu (Postfix) with ESMTP id 208D5160080;
	Wed, 30 Aug 2017 22:05:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
	by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 1d7U7dGbbQ8R; Wed, 30 Aug 2017 22:05:48 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.184.153])
	by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 001AB160056;
	Wed, 30 Aug 2017 22:05:47 -0700 (PDT)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Assaf Gordon <assafgordon@gmail.com>
Cc: coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
	<bb7319d4-9048-6113-96a8-3010bcd2f333@draigBrady.com>
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
Message-ID: <b7462e2c-31d2-e301-9cfa-ce517b3659a9@cs.ucla.edu>
Date: Wed, 30 Aug 2017 22:05:42 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <bb7319d4-9048-6113-96a8-3010bcd2f333@draigBrady.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 131.179.128.68
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, 31 Aug 2017 05:05:56 -0000

P=C3=A1draig Brady wrote:
> I notice the new test-fts in gnulib was taking a while,
> and it creates 128K files/dirs on a quick look.

It creates 65,000 directories and 4 files. On my old desktop (no flash, j=
ust=20
hard disk, ext4, Fedora 26) it takes 17 s real time. If this is too much,=
 I=20
suppose we can mark the test as expensive, or remove it.


From MAILER-DAEMON Thu Aug 31 01:15:08 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnHoq-0008Uc-FE
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 01:15:08 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39441)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnHoo-0008T3-1E
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:15:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnHoj-00088S-2S
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:15:06 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:41102)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnHoi-00088B-SD
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:15:00 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 062749D1A;
	Thu, 31 Aug 2017 06:14:57 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Paul Eggert <eggert@cs.ucla.edu>, Assaf Gordon <assafgordon@gmail.com>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
	<bb7319d4-9048-6113-96a8-3010bcd2f333@draigBrady.com>
	<b7462e2c-31d2-e301-9cfa-ce517b3659a9@cs.ucla.edu>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <01c6be1f-b0e3-6825-e263-582dc987eac8@draigBrady.com>
Date: Wed, 30 Aug 2017 22:14:55 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <b7462e2c-31d2-e301-9cfa-ce517b3659a9@cs.ucla.edu>
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]
	[fuzzy]
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, 31 Aug 2017 05:15:06 -0000

On 30/08/17 22:05, Paul Eggert wrote:
> P=C3=A1draig Brady wrote:
>> I notice the new test-fts in gnulib was taking a while,
>> and it creates 128K files/dirs on a quick look.
>=20
> It creates 65,000 directories and 4 files. On my old desktop (no flash,=
 just=20
> hard disk, ext4, Fedora 26) it takes 17 s real time. If this is too muc=
h, I=20
> suppose we can mark the test as expensive, or remove it.

Yes that would be useful to mark as expensive
(I didn't know one could mark gnulib tests as such)

As well as the 17s, I see:

$ mkdir t && cd t
$ seq 65535 | xargs mkdir
$ du -hs .
285M

cheers,
P=C3=A1draig


From MAILER-DAEMON Thu Aug 31 01:42:35 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnIFP-0008K4-7k
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 01:42:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43710)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnIFN-0008Ic-D4
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:42:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnIFM-0004md-Cp
	for coreutils@gnu.org; Thu, 31 Aug 2017 01:42:33 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:41198)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>)
	id 1dnIFH-0004lf-Oh; Thu, 31 Aug 2017 01:42:27 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 DFE519DE0;
	Thu, 31 Aug 2017 06:42:24 +0100 (IST)
Subject: Re: [platform-testers] new snapshot available:
	coreutils-8.27.99-3ebdc3
To: Paul Eggert <eggert@cs.ucla.edu>, Assaf Gordon <assafgordon@gmail.com>
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<a1658a3a-5831-b5b9-0683-72190021e356@gmail.com>
	<bb7319d4-9048-6113-96a8-3010bcd2f333@draigBrady.com>
	<b7462e2c-31d2-e301-9cfa-ce517b3659a9@cs.ucla.edu>
	<01c6be1f-b0e3-6825-e263-582dc987eac8@draigBrady.com>
Cc: coreutils@gnu.org, "gnulib >> bug-gnulib" <bug-gnulib@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <bbb035c6-44ec-3c2c-4d7a-ca2c3c5c44e1@draigBrady.com>
Date: Wed, 30 Aug 2017 22:42:22 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <01c6be1f-b0e3-6825-e263-582dc987eac8@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------03FFDE7834BD06B08A8BF280"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 31 Aug 2017 05:42:34 -0000

This is a multi-part message in MIME format.
--------------03FFDE7834BD06B08A8BF280
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 30/08/17 22:14, P=C3=A1draig Brady wrote:
> On 30/08/17 22:05, Paul Eggert wrote:
>> P=C3=A1draig Brady wrote:
>>> I notice the new test-fts in gnulib was taking a while,
>>> and it creates 128K files/dirs on a quick look.
>>
>> It creates 65,000 directories and 4 files. On my old desktop (no flash=
, just=20
>> hard disk, ext4, Fedora 26) it takes 17 s real time. If this is too mu=
ch, I=20
>> suppose we can mark the test as expensive, or remove it.
>=20
> Yes that would be useful to mark as expensive
> (I didn't know one could mark gnulib tests as such)
>=20
> As well as the 17s, I see:
>=20
> $ mkdir t && cd t
> $ seq 65535 | xargs mkdir
> $ du -hs .
> 285M

The attached gnulib patch seems to exclude the test as coreutils
uses --with-tests with gnulib-tool

cheers,
P=C3=A1draig


--------------03FFDE7834BD06B08A8BF280
Content-Type: text/x-patch;
 name="fts-tests-longrunning.patch"
Content-Disposition: attachment;
 filename="fts-tests-longrunning.patch"
Content-Transfer-Encoding: quoted-printable

>From a17c2cc8bf457f35789f74aa771cd15ec71c7253 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D <P@draigBrady.com>
Date: Wed, 30 Aug 2017 22:32:23 -0700
Subject: [PATCH] fts-tests: tag as a longrunning-test so not included by
 default

* modules/fts-tests: This test takes about 20s on current systems,
and uses about 285M of space.
---
 ChangeLog         | 6 ++++++
 modules/fts-tests | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 0b3c06a..24429da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-08-30  P=C3=A1draig Brady  <P@draigBrady.com>
=20
+	fts-tests: tag as a longrunning-test so not included by default
+	* modules/fts-tests: This test takes about 20s on current systems,
+	and uses about 285M of space.
+
+2017-08-30  P=C3=A1draig Brady  <P@draigBrady.com>
+
 	renameat2: fix compilation on alpine linux
 	* m4/renameat.m4: Check for <linux/fs.h> presence.
 	* lib/renameat2.h: Only include <linux/fs.h> if present.
diff --git a/modules/fts-tests b/modules/fts-tests
index 1651290..1a9dce0 100644
--- a/modules/fts-tests
+++ b/modules/fts-tests
@@ -1,3 +1,6 @@
+Status:
+longrunning-test
+
 Files:
 tests/test-fts.c
=20
--=20
2.9.3


--------------03FFDE7834BD06B08A8BF280--


From MAILER-DAEMON Thu Aug 31 02:06:20 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnIcO-0006x7-FG
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 02:06:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46789)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <harri@afaics.de>) id 1dnIcM-0006wy-GQ
	for coreutils@gnu.org; Thu, 31 Aug 2017 02:06:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <harri@afaics.de>) id 1dnIcH-0004NL-Fh
	for coreutils@gnu.org; Thu, 31 Aug 2017 02:06:18 -0400
Received: from out.selfhost.de ([82.98.82.95]:43574 helo=outgoing.selfhost.de)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <harri@afaics.de>) id 1dnIcH-0004Dj-4h
	for coreutils@gnu.org; Thu, 31 Aug 2017 02:06:13 -0400
Received: (qmail 22678 invoked from network); 31 Aug 2017 06:05:58 -0000
Received: from unknown (HELO mailhost.afaics.de)
	(postmaster@xqrsonfo.mail.selfhost.de@84.166.174.103)
	by mailout.selfhost.de with ESMTPA; 31 Aug 2017 06:05:58 -0000
Received: from localhost (mailhost.afaics.de [local])
	by mailhost.afaics.de (OpenSMTPD) with ESMTPA id 073ce5b8
	for <coreutils@gnu.org>; Thu, 31 Aug 2017 06:05:57 +0000 (UTC)
From: Harald Dunkel <harri@afaics.de>
To: coreutils@gnu.org
Subject: suggestion for a new recursive directory ls
Date: Thu, 31 Aug 2017 08:05:57 +0200
Message-ID: <87mv6gi856.fsf@sylvester.afaics.de>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy]
X-Received-From: 82.98.82.95
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, 31 Aug 2017 06:06:19 -0000

Hi folks,

One of my favorites is

	ls -ld `find /some/dir -print`

It creates a much better readable output than "ls -R".

Its shortcomings are clear: 2 many arguments on the command
line, takes an awful lot of time to execute, problems with
space chars, etc. Surely this command line could be optimized.

I would like to suggest to implement a new recursive directory
feature in ls itself, and to introduce a new command line
option ("ls -e"?).


Just a suggestion, of course. Keep on your good work

Harri


From MAILER-DAEMON Thu Aug 31 02:41:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnJAB-0005pk-Qn
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 02:41:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51472)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnJA9-0005oL-2d
	for coreutils@gnu.org; Thu, 31 Aug 2017 02:41:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnJA6-0005S4-0e
	for coreutils@gnu.org; Thu, 31 Aug 2017 02:41:13 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:41418)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnJA5-0005Nt-QW
	for coreutils@gnu.org; Thu, 31 Aug 2017 02:41:09 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 348199FA3;
	Thu, 31 Aug 2017 07:41:07 +0100 (IST)
Subject: Re: suggestion for a new recursive directory ls
To: Harald Dunkel <harri@afaics.de>, coreutils@gnu.org
References: <87mv6gi856.fsf@sylvester.afaics.de>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <ec913884-8863-260c-edf3-e25193140053@draigBrady.com>
Date: Wed, 30 Aug 2017 23:41:04 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <87mv6gi856.fsf@sylvester.afaics.de>
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]
	[fuzzy]
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, 31 Aug 2017 06:41:14 -0000

On 30/08/17 23:05, Harald Dunkel wrote:
> Hi folks,
>=20
> One of my favorites is
>=20
> 	ls -ld `find /some/dir -print`
>=20
> It creates a much better readable output than "ls -R".
>=20
> Its shortcomings are clear: 2 many arguments on the command
> line, takes an awful lot of time to execute, problems with
> space chars, etc. Surely this command line could be optimized.
>=20
> I would like to suggest to implement a new recursive directory
> feature in ls itself, and to introduce a new command line
> option ("ls -e"?).
>=20
>=20
> Just a suggestion, of course. Keep on your good work

This would be more scalable:

  find . -printf '%P\0' | xargs -r0 ls -ld --color

Though the sorting would be off as chunked by xargs,
and not done per directory.

There is also the -ls option to find if you don't need colors

To get good sorting per directory an option like you suggest could be use=
ful,
though TBH I'm not sure there are enough benefits over the
existing ls format to warrant a new option.

Another option is to use: tree -DugsipfC

cheers,
P=E1draig


From MAILER-DAEMON Thu Aug 31 03:01:59 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnJUF-00061t-92
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 03:01:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57268)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnJUC-0005zT-3Q
	for coreutils@gnu.org; Thu, 31 Aug 2017 03:01:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnJU5-0006RM-UR
	for coreutils@gnu.org; Thu, 31 Aug 2017 03:01:56 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:41528)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>)
	id 1dnJU5-0006Of-Lz; Thu, 31 Aug 2017 03:01:49 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 62821A14E;
	Thu, 31 Aug 2017 08:01:46 +0100 (IST)
Subject: new snapshot available: coreutils-8.27.108-2ba96
To: coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Cc: platform-testers@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <d4cc0f46-fd39-cc28-e3b3-28b0192e13a4@draigBrady.com>
Date: Thu, 31 Aug 2017 00:01:37 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="QosvMQXiHUx0VlfVjoesHWRWcbbOhTbJo"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 82.195.144.49
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, 31 Aug 2017 07:01:57 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--QosvMQXiHUx0VlfVjoesHWRWcbbOhTbJo
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Cc: platform-testers@gnu.org
Message-ID: <d4cc0f46-fd39-cc28-e3b3-28b0192e13a4@draigBrady.com>
Subject: new snapshot available: coreutils-8.27.108-2ba96
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
In-Reply-To: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

We plan to release coreutils-8.28 towards the end of this week,
so any testing you can do on various different systems between now and th=
en
would be most welcome.

--------------------------------------

You can download the coreutils snapshot in xz format (5.2 MB) from:
  https://pixelbeat.org/cu/coreutils-ss.tar.xz

And verify with gpg or md5sum with:
  https://pixelbeat.org/cu/coreutils-ss.tar.xz.sig
  MD5 (coreutils-ss.tar.xz) =3D 25c9aafb97b9ab17a2e748f46d3217f2

--------------------------------------

To test follow this standard procedure:

  tar -xf coreutils-ss.tar.xz
  cd coreutils-8.27.108-2ba96/
  ./configure && make check VERBOSE=3Dyes

Failures are reported and details are in tests/test-suite.log

--------------------------------------

Changes since the previous snapshot are:

commit 2ba96977c9480171df8b119bbb5545b8f7bdbdb5
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 22:49:24 2017 -0700

    tests: exclude the expensive gnulib fts-tests

    * gnulib: The only change in this gnulib update
    is the tagging of the fts-tests module as longrunning,
    which gnulib-tool currently implicitly excludes.
    This test was seen to take about 20s and 285MB.
    Reported by Assaf Gordon on space restricted VMs.

commit 173bee1bdffa53cd6c6f572fea46411eaec38b17
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 20:14:22 2017 -0700

    tty: don't distinguish input errors

    * src/tty.c (main): Don't distinguish ENOTTY from other errors,
    because isatty() doesn't portably distinguish errors.
    Solaris returns ENOENT for all input errors for example.
    Musl also returns ENOENT, and ENODEV may be returned as disscussed at=
:
    http://openwall.com/lists/musl/2017/04/06/6
    * tests/misc/tty.sh: Adjust accordingly.

commit 5ee9c8f7a6d3f2cec5eb4b086f05a60f67c8b052
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 20:05:31 2017 -0700

    tests: avoid printf '0*d' construct unsupported by ash

    * tests/ln/sf-1.sh: Generate specific length with space padding
    which is supported.
    Reported by Assaf Gordon on Alpine Linux.

commit 1e8c4582102ad62dcf2a7cc80aae64e200dc92ce
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Wed Aug 30 17:16:23 2017 -0700

    tests: skip tests upon failure to set SELinux context

    On some setups the root:object_r:tmp_t context is invalid.
    This does indicate a limitation in the test framework,
    but for now we'll relax this to skipping the tests.
    The tests still run on a Fedora 25 system for example.

    * tests/cp/cp-a-selinux.sh: Upon chcon error, skip rather than ERROR.=

    * tests/install/install-Z-selinux.sh: Likewise.
    * tests/misc/chcon.sh: Likewise.
    * tests/misc/runcon-no-reorder.sh: Likewise.
    * tests/misc/selinux.sh: Likewise.
    * tests/mkdir/restorecon.sh: Likewise.

commit 87a95504bb01a8662c08bd0a7367c5cc92286aa3
Author: Kamil Dudka <kdudka@redhat.com>
Date:   Wed Aug 30 13:50:42 2017 +0200

    expr: fix a recently introduced memory leak

    * src/expr.c (eval6): Free memory allocated by mbs_logical_substr().

    Introduced in v8.27-47-ga9f2be5.  Detected by Coverity Analysis:

    Error: RESOURCE_LEAK:
    src/expr.c:851: leaked_storage: Variable "s" going out of scope
    leaks the storage it points to.
    849|             char *s =3D mbs_logical_substr (l->u.s, pos, len);
    850|             v =3D str_value (s);
    851|->         }
    852|         freev (l);
    853|         freev (i1);

cheers,
P=C3=A1draig


--QosvMQXiHUx0VlfVjoesHWRWcbbOhTbJo
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

iQIcBAEBCAAGBQJZp7RRAAoJEN9v2XEwYDfZHtkP+wYy6oZ5TnAcEHJ8yycWmQDp
vi+hu4Lle5FMOFLkXDd1g2Zn+JzZYb+CN8JGW/hm8z/uc1SdXLUgM+vIrMYNcQUL
N7KPtA+i2xqySg9L3qwIabUAv2xZvGtfM1zzhtk6f6BnMK6aKp5xioDldXKqBCIF
OvS4EqloiGJRa7KOz9Bx2Nd6MNZYofZ+FPPbUF+l80jVBe8iwXycmLDtIZ0rnfgU
FNqvJTWhmShIJvZdMc5LWb+isDt/m2bPnuPoJJ/pfYLyWo5vkvU7u2He/+0Vkw5s
rUvlBYVnct0ud/NTFvonlJXa5yNteUiW2GKDq/pA4/dwQzcVpPInWlhzFLH/EYtp
FwvuGFg3CDG4pSjJsxKiPAdk7g/HRBgtSWrRkODE3Bn990lkqQDE6QyN2IkSmWKX
s6imoE4MEquaLuWYfLYg7wz+Da7UDj3rkf36bYR1emfGfUhJX0uRNUkgaTCJWZjS
jP6AXpbLOnvs13T0xifR9Jf3+ShiYtNb4E5GK0AXHNv66Y+xEQRc9ARzyj1e/52a
lIj/jq+PK3bF+DaoFEQCdiw3uJ6QOn3WiBboXiym2bkkPcmlUyna0nddmK51fgcb
mWNJbU4OpEYnCA6L+7EwXTKsTce91cOjRN0bFdqe5a09IFjXlqkI+ZbqvpjGIl8B
UZcAip84A8TZjMI+dxPh
=+nPy
-----END PGP SIGNATURE-----

--QosvMQXiHUx0VlfVjoesHWRWcbbOhTbJo--


From MAILER-DAEMON Thu Aug 31 08:59:51 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnP4Z-0004Bq-E1
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 08:59:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49805)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dnP4W-0004A2-SZ
	for coreutils@gnu.org; Thu, 31 Aug 2017 08:59:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dnP4S-0001UM-Aw
	for coreutils@gnu.org; Thu, 31 Aug 2017 08:59:48 -0400
Received: from mx1.redhat.com ([209.132.183.28]:58622)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eblake@redhat.com>) id 1dnP4S-0001U7-1K
	for coreutils@gnu.org; Thu, 31 Aug 2017 08:59:44 -0400
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
	[10.5.11.11])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id E371A8046E
	for <coreutils@gnu.org>; Thu, 31 Aug 2017 12:59:42 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E371A8046E
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=eblake@redhat.com
Received: from [10.10.122.186] (ovpn-122-186.rdu2.redhat.com [10.10.122.186])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 848A992BBA;
	Thu, 31 Aug 2017 12:59:42 +0000 (UTC)
To: "coreutils@gnu.org" <coreutils@gnu.org>
From: Eric Blake <eblake@redhat.com>
Subject: potential exec/nohup/timeout improvement for Linux:
	prctl(PR_SET_PDEATHSIG)
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Cc: "Richard W.M. Jones" <rjones@redhat.com>
Message-ID: <7f682972-57f4-4719-51cf-1ac10eaca29a@redhat.com>
Date: Thu, 31 Aug 2017 07:59:41 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.3.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="5oH08Ft1GXtg1qXhp9wTh3BkaaW0Pjb5d"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.28]);
	Thu, 31 Aug 2017 12:59:43 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Thu, 31 Aug 2017 12:59:50 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--5oH08Ft1GXtg1qXhp9wTh3BkaaW0Pjb5d
From: Eric Blake <eblake@redhat.com>
To: "coreutils@gnu.org" <coreutils@gnu.org>
Cc: "Richard W.M. Jones" <rjones@redhat.com>
Message-ID: <7f682972-57f4-4719-51cf-1ac10eaca29a@redhat.com>
Subject: potential exec/nohup/timeout improvement for Linux:
 prctl(PR_SET_PDEATHSIG)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Rich Jones just taught me about Linux' prctl(PR_SET_PDEATHSIG), which
allows you to run a helper executable that will automatically be killed
if its parent process dies.  I'm trying to figure out if coreutils
should provide support for that API via any of its existing wrapper
utilities (in fact, it sounds somewhat like the opposite of nohup -
instead of spawning a child process that survives the shell's death, we
want to be able to spawn a child process that automatically cleans
itself up on the shell's death).  Or maybe we make a new wrapper
utility.  However, since the functionality is currently Linux-only, I'm
also wondering if coreutils is still a good choice for this
functionality, or if we should pursue exposing it in some other package
of useful shell utilities.

--=20
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

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

iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlmoCD0ACgkQp6FrSiUn
Q2pIXAgAjfKNrzzwmiTztbk3HvSDprC/u67tqAsCxMWhkleh0eQAgPp5h4fELNTB
DNg97V7/4NZ3dLn6ngfcQSdYlB5N3Eg9VbPQxbPAwdLxs56KM3xSdAokIfalKtYp
6iMjxNe0Cb6O4nwoDzE3pS/4xHkI4EDzLp1PLWljOzCZXyK47dwQSS5kD9t7FliI
iU5pYFugmuEItKZOwNieIMR2vrtUzxIW/apDIt57Sf3bykGD2Fo2fpdW9CQ3MiOY
5vbOrMF0mL0Hn/KhIDl640fD1mkqJ80llT0UHUO+E54Giy8kUq5zqm1AyxFUdI8j
7RFhrt8ptGE37pinoXSAvkjMpaKTIg==
=WEYt
-----END PGP SIGNATURE-----

--5oH08Ft1GXtg1qXhp9wTh3BkaaW0Pjb5d--


From MAILER-DAEMON Thu Aug 31 09:02:55 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnP7X-0005F0-4d
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 09:02:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51019)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dnP7R-0005Eg-VD
	for coreutils@gnu.org; Thu, 31 Aug 2017 09:02:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1dnP7N-0003Ic-C8
	for coreutils@gnu.org; Thu, 31 Aug 2017 09:02:49 -0400
Received: from mx1.redhat.com ([209.132.183.28]:44711)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <eblake@redhat.com>) id 1dnP7N-0003Hz-2B
	for coreutils@gnu.org; Thu, 31 Aug 2017 09:02:45 -0400
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
	[10.5.11.11])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id DEB5785543;
	Thu, 31 Aug 2017 13:02:43 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DEB5785543
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=eblake@redhat.com
Received: from [10.10.122.186] (ovpn-122-186.rdu2.redhat.com [10.10.122.186])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 25F148FC17;
	Thu, 31 Aug 2017 13:02:42 +0000 (UTC)
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
	<db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
	<61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <08cd20a3-c5e9-10a3-8a81-3237ac6dacaf@redhat.com>
Date: Thu, 31 Aug 2017 08:02:42 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="x2HcDIlk1xcokDGIsGnQrII9PwGVx4IuC"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.28]);
	Thu, 31 Aug 2017 13:02:44 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Thu, 31 Aug 2017 13:02:54 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--x2HcDIlk1xcokDGIsGnQrII9PwGVx4IuC
From: Eric Blake <eblake@redhat.com>
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
 Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
Message-ID: <08cd20a3-c5e9-10a3-8a81-3237ac6dacaf@redhat.com>
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
 <08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
 <db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
 <61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
In-Reply-To: <61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 08/30/2017 09:12 PM, P=C3=A1draig Brady wrote:

>> FAIL: tests/ln/sf-1
>> [...]
>> + printf %0*d 256 0
>> ash: %0*d: invalid format
>=20
>> (I guess printf(1) in Busybox's "ash" does not accept this format).
>=20
> Indeed:
> $ sudo dnf install busybox
> $ busybox ash -c 'printf %0*d 256 0'
> ash: %0*d: invalid format
>=20
> Since this is the only ash specific issue it seems, I'll avoid like:
>=20
> -long_name=3D$(printf '%0*d' $name_max_plus1 0)
> +long_name=3D$(yes 0 | head -n$name_max_plus1 | tr -d '\n')

Couldn't we also ensure that we are using coreutils' printf, as in $(env
printf '%0*d' ...), so that we aren't depending upon sh's builtins?


--=20
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

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

iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlmoCPIACgkQp6FrSiUn
Q2pL6Qf+Jg9wZrcQ385mFCXpcQptQmKk2n2RWbT2WAdiPOeunHgZ5HiaR+hp/1av
I5uCrKMuGDU5ZQ8jtmVsgszXWnqAsVwvvJeYHxxLQffO2mp8Ie90w6cxAKu1fFlL
gojGpZveMogUuWJkbTuMf63dXQYy8xmj22qLziv5G0SIyRm3MUH/ndrfOoxq20QK
EbqmUX0kSwHxFnZktQhwUwmCL1JcsOfWIbUDAcLArNlOq9LAkg8Uab+liDzY/Nw4
xNQ1Zf3i1Oyu/McwK+7hmZIRkF7qf329mVlAoBCt6nqQ9F9s9KUB0L0KTkhI9ioU
xZ6cZCxrpPvvdPfZqfEEquXcidFqvg==
=qOU8
-----END PGP SIGNATURE-----

--x2HcDIlk1xcokDGIsGnQrII9PwGVx4IuC--


From MAILER-DAEMON Thu Aug 31 09:49:28 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnPqZ-0001IZ-Ut
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 09:49:27 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39481)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <harald.dunkel@aixigo.de>) id 1dnKUy-0008My-33
	for coreutils@gnu.org; Thu, 31 Aug 2017 04:06:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <harald.dunkel@aixigo.de>) id 1dnKUt-000849-0o
	for coreutils@gnu.org; Thu, 31 Aug 2017 04:06:48 -0400
Received: from mail.aixigo.de ([5.145.142.10]:3414)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <harald.dunkel@aixigo.de>)
	id 1dnKUs-0007o0-O1
	for coreutils@gnu.org; Thu, 31 Aug 2017 04:06:42 -0400
Received: from srvvm01.ac.aixigo.de (mail.ac.aixigo.de [172.19.96.11])
	by gate5a.ac.aixigo.de (OpenSMTPD) with ESMTPS id 65cb49d4
	(TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <coreutils@gnu.org>;
	Thu, 31 Aug 2017 10:06:19 +0200 (CEST)
Received: from dpcl082.ac.aixigo.de (dpcl082.ac.aixigo.de [172.19.97.128])
	by srvvm01.ac.aixigo.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
	v7V86Jco055987; Thu, 31 Aug 2017 10:06:19 +0200
Date: Thu, 31 Aug 2017 10:06:19 +0200
From: Harald Dunkel <harald.dunkel@aixigo.de>
To: coreutils@gnu.org
Subject: Re: suggestion for a new recursive directory ls
Message-ID: <20170831100619.1d0c5e79@dpcl082.ac.aixigo.de>
In-Reply-To: <ec913884-8863-260c-edf3-e25193140053@draigBrady.com>
References: <87mv6gi856.fsf@sylvester.afaics.de>
	<ec913884-8863-260c-edf3-e25193140053@draigBrady.com>
Organization: aixigo AG
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: clamav-milter 0.99.2 at srvvm01.ac.aixigo.de
X-Virus-Status: Clean
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 5.145.142.10
X-Mailman-Approved-At: Thu, 31 Aug 2017 09:49: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: Thu, 31 Aug 2017 08:06:49 -0000

Hi P=C3=A1draig,

I highly appreciate your clever optimizations, but as written=20
before, I am looking for a new feature in /bin/ls. A recursion
is already in. ls produces just a weird output, so I would assume=20
this new feature is easy to implement.

Harri


From MAILER-DAEMON Thu Aug 31 10:06:16 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnQ6q-0007Mm-Fc
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 10:06:16 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35328)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rjones@redhat.com>) id 1dnPu5-0002oD-MX
	for coreutils@gnu.org; Thu, 31 Aug 2017 09:53:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rjones@redhat.com>) id 1dnPu0-0005gz-T6
	for coreutils@gnu.org; Thu, 31 Aug 2017 09:53:05 -0400
Received: from mx1.redhat.com ([209.132.183.28]:51746)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <rjones@redhat.com>) id 1dnPu0-0005g6-NT
	for coreutils@gnu.org; Thu, 31 Aug 2017 09:53:00 -0400
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
	[10.5.11.14])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id AAD6E20B19
	for <coreutils@gnu.org>; Thu, 31 Aug 2017 13:52:59 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AAD6E20B19
Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com;
	dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com;
	spf=fail smtp.mailfrom=rjones@redhat.com
Received: from localhost (ovpn-117-64.ams2.redhat.com [10.36.117.64])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 55C24B32B5;
	Thu, 31 Aug 2017 13:52:58 +0000 (UTC)
Date: Thu, 31 Aug 2017 14:52:58 +0100
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
Subject: Re: potential exec/nohup/timeout improvement for Linux:
	prctl(PR_SET_PDEATHSIG)
Message-ID: <20170831135257.GY20914@redhat.com>
References: <7f682972-57f4-4719-51cf-1ac10eaca29a@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <7f682972-57f4-4719-51cf-1ac10eaca29a@redhat.com>
User-Agent: Mutt/1.5.20 (2009-12-10)
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.30]);
	Thu, 31 Aug 2017 13:52:59 +0000 (UTC)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 209.132.183.28
X-Mailman-Approved-At: Thu, 31 Aug 2017 10:06: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, 31 Aug 2017 13:53:10 -0000


On Thu, Aug 31, 2017 at 07:59:41AM -0500, Eric Blake wrote:
> Rich Jones just taught me about Linux' prctl(PR_SET_PDEATHSIG), which
> allows you to run a helper executable that will automatically be killed
> if its parent process dies.  I'm trying to figure out if coreutils
> should provide support for that API via any of its existing wrapper
> utilities (in fact, it sounds somewhat like the opposite of nohup -
> instead of spawning a child process that survives the shell's death, we
> want to be able to spawn a child process that automatically cleans
> itself up on the shell's death).  Or maybe we make a new wrapper
> utility.  However, since the functionality is currently Linux-only, I'm
> also wondering if coreutils is still a good choice for this
> functionality, or if we should pursue exposing it in some other package
> of useful shell utilities.

My idea (I'll leave it to someone else to implement) would be some
kind of cleanup wrapper for shell scripts, like:

  autocleanup [-s TERM] someprog &

If the main script exits, someprog gets killed automatically.  No need
for traps etc.

Note that =E2=80=98PR_SET_PDEATHSIG=E2=80=99 is passed through exec to no=
n-setuid
processes so this is fairly simple to implement.  For setuid it would
fail silently, and testing for setuid might be problematic or racy I
suppose.

Of course this is all Linux-only.  Do other kernels implement anything
like this?  We could use it for nbdkit:

https://github.com/libguestfs/nbdkit/commit/370b554fb38be7360815af70d5e01=
75842c451c6

Rich.

--=20
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rj=
ones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/


From MAILER-DAEMON Thu Aug 31 10:35:43 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnQZL-0000Xh-Mw
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 10:35:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47150)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <addw@phcomp.co.uk>) id 1dnQZJ-0000WS-LS
	for coreutils@gnu.org; Thu, 31 Aug 2017 10:35:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <addw@phcomp.co.uk>) id 1dnQZF-0003qB-EG
	for coreutils@gnu.org; Thu, 31 Aug 2017 10:35:41 -0400
Received: from freshmint.phcomp.co.uk ([78.32.209.33]:55256
	helo=mint.phcomp.co.uk)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <addw@phcomp.co.uk>) id 1dnQZF-0003eL-6l
	for coreutils@gnu.org; Thu, 31 Aug 2017 10:35:37 -0400
Received: from addw by mint.phcomp.co.uk with local (Exim 4.89)
	(envelope-from <addw@phcomp.co.uk>) id 1dnQYh-0007sc-Br
	for coreutils@gnu.org; Thu, 31 Aug 2017 15:35:03 +0100
Date: Thu, 31 Aug 2017 15:35:03 +0100
From: Alain Williams <addw@phcomp.co.uk>
To: coreutils@gnu.org
Subject: Re: potential exec/nohup/timeout improvement for Linux:
	prctl(PR_SET_PDEATHSIG)
Message-ID: <20170831143503.GF8096@phcomp.co.uk>
References: <7f682972-57f4-4719-51cf-1ac10eaca29a@redhat.com>
	<20170831135257.GY20914@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20170831135257.GY20914@redhat.com>
Organization: Parliament Hill Computers Ltd
User-Agent: Mutt/1.5.20 (2009-12-10)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 78.32.209.33
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, 31 Aug 2017 14:35:43 -0000

On Thu, Aug 31, 2017 at 02:52:58PM +0100, Richard W.M. Jones wrote:
> 
> On Thu, Aug 31, 2017 at 07:59:41AM -0500, Eric Blake wrote:
> > Rich Jones just taught me about Linux' prctl(PR_SET_PDEATHSIG), which
> > allows you to run a helper executable that will automatically be killed
> > if its parent process dies.  I'm trying to figure out if coreutils
> > should provide support for that API via any of its existing wrapper
> > utilities (in fact, it sounds somewhat like the opposite of nohup -
> > instead of spawning a child process that survives the shell's death, we
> > want to be able to spawn a child process that automatically cleans
> > itself up on the shell's death).  Or maybe we make a new wrapper
> > utility.  However, since the functionality is currently Linux-only, I'm
> > also wondering if coreutils is still a good choice for this
> > functionality, or if we should pursue exposing it in some other package
> > of useful shell utilities.
> 
> My idea (I'll leave it to someone else to implement) would be some
> kind of cleanup wrapper for shell scripts, like:
> 
>   autocleanup [-s TERM] someprog &

But beware: that Linux octopus systemd will probably get in the way. It has been
killing 'nohup' sessions for about a year.

Look at systemd-run(1) for some ways round this.

> If the main script exits, someprog gets killed automatically.  No need
> for traps etc.
> 
> Note that ‘PR_SET_PDEATHSIG’ is passed through exec to non-setuid
> processes so this is fairly simple to implement.  For setuid it would
> fail silently, and testing for setuid might be problematic or racy I
> suppose.
> 
> Of course this is all Linux-only.  Do other kernels implement anything
> like this?  We could use it for nbdkit:
> 
> https://github.com/libguestfs/nbdkit/commit/370b554fb38be7360815af70d5e0175842c451c6

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>


From MAILER-DAEMON Thu Aug 31 12:59:53 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnSor-0002Ba-AI
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 12:59:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37122)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kaushal.modi@gmail.com>) id 1dnRVK-0003bv-OU
	for coreutils@gnu.org; Thu, 31 Aug 2017 11:35:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kaushal.modi@gmail.com>) id 1dnRVJ-000567-88
	for coreutils@gnu.org; Thu, 31 Aug 2017 11:35:38 -0400
Received: from mail-yw0-x22c.google.com ([2607:f8b0:4002:c05::22c]:35572)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <kaushal.modi@gmail.com>)
	id 1dnRVI-00055R-Ta
	for coreutils@gnu.org; Thu, 31 Aug 2017 11:35:37 -0400
Received: by mail-yw0-x22c.google.com with SMTP id s187so5158865ywf.2
	for <coreutils@gnu.org>; Thu, 31 Aug 2017 08:35:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=ZglQVfM80IgVmWh9l0f9d1J0OVxMzI9dHeWyxVLb3tw=;
	b=cC7U8EXhcBqmuqKs9EKBDRW7wlsT8mjaV1cJ7HjfZMhNHZwa4Wbea7Af3Sjp+5a/ER
	63qIm3aDkZXQX8zehSs9NzeM9fuuKESe1nkT3wXcrNpdOiEsYe/tMVOkFI5A+EWHfPbt
	0CX05CBAdIbDXkz+WKa8pN73/pBZFlLW5mWhl7ADbb4RYN5eN8QPNgNVxqBP8ezrnShX
	6sYmMRepodfIYx6duIHPoI0A2O1/2p0tR8E+OnbWjegqUxMNVKz4cop2RJ5Fgd/0dLX8
	VTOA2HcV9sGmp0fTFGgB5bQYgkZ7ZyAVOEQJ19bNfMw66B1LJADvoszTySPiTEMbZaCu
	Lc5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=ZglQVfM80IgVmWh9l0f9d1J0OVxMzI9dHeWyxVLb3tw=;
	b=aTNIq8oZmx5EyQU5MqEte+g8rYiQqs42dZ7dshgZvcU5zNN+nN8mfF8vTzuVU6wcvA
	zLRUaT0Wqhf3vVvZFGyC4+L72fGpR0WHHv3xnYy1Ht8u2Teuztc9L0Ky6m3cvZapl0sy
	Hwp5ohVJXOPKmQup5+1t1T6rz9hmtJnOSFtwETT24ECCctYej0vkyzKowjHq8mnRLrKr
	er7hNGcS3vaGyEkiwPTHQVqELgnbHqKOfZE6UMrinoCSOr9cz8AWNUsyoTKE/6X2YkFI
	lgKtLgoy20IlVi9Nw+VtjBukjL0TxX+/4qJi0SwpvIVVhgC1AT9fh3OVR0EmqVV/i/NA
	3dUQ==
X-Gm-Message-State: AHYfb5g4Up4CZLJTa/+g1vbYiIPt7/IHAIjaGGw2rUmLWF/F0ixriWUR
	lmFbhmaZb1deHEtChoUQ5gF2KY0P5w==
X-Google-Smtp-Source: ADKCNb40xNJlo0C63onqbb7uRzqhgXV04TUwHAgU/SoGS2LMCbmc9IXEDQCnuADZ97Jve4Y/jrE4/EUviIeaHDsIcjY=
X-Received: by 10.129.145.137 with SMTP id i131mr5278494ywg.6.1504193735770;
	Thu, 31 Aug 2017 08:35:35 -0700 (PDT)
MIME-Version: 1.0
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Thu, 31 Aug 2017 15:35:24 +0000
Message-ID: <CAFyQvY0J+VhQ99qrG_2huKXt-a8n3SQfYP9GY1gUx-+ymZkP4Q@mail.gmail.com>
Subject: Help with building;
	fails because of "undefined reference to `__gmpz_inits'"
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4002:c05::22c
X-Mailman-Approved-At: Thu, 31 Aug 2017 12:59:52 -0400
Content-Type: text/plain; charset="UTF-8"
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, 31 Aug 2017 15:35:40 -0000

Hello,

I was trying to build coreutils using the latest version on master branch.
I followed README-hacking and everything went fine with the ./bootstrap
step. ./configure also worked fine. But make failed with these errors:

  src/factor.o: In function `mp_prime_p':
  /home/kmodi/downloads/git/coreutils/src/factor.c:1395: undefined
reference to `__gmpz_inits'
  /home/kmodi/downloads/git/coreutils/src/factor.c:1459: undefined
reference to `__gmpz_clears'
  src/factor.o: In function `mp_factor_using_pollard_rho':
  /home/kmodi/downloads/git/coreutils/src/factor.c:1682: undefined
reference to `__gmpz_inits'
  /home/kmodi/downloads/git/coreutils/src/factor.c:1762: undefined
reference to `__gmpz_clears'
  collect2: error: ld returned 1 exit status
  make[2]: *** [Makefile:7944: src/factor] Error 1
  make[2]: Leaving directory '/home/kmodi/downloads/git/coreutils'
  make[1]: *** [Makefile:11705: all-recursive] Error 1
  make[1]: Leaving directory '/home/kmodi/downloads/git/coreutils'
  make: *** [Makefile:5966: all] Error 2

So I tried building from the tarball of the latest stable release v8.27.
That too failed with the same error.

    CCLD     src/factor
  src/factor.o: In function `mp_prime_p':
  /home/kmodi/downloads/coreutils-8.27/src/factor.c:1395: undefined
reference to `__gmpz_inits'
  /home/kmodi/downloads/coreutils-8.27/src/factor.c:1459: undefined
reference to `__gmpz_clears'
  src/factor.o: In function `mp_factor_using_pollard_rho':
  /home/kmodi/downloads/coreutils-8.27/src/factor.c:1682: undefined
reference to `__gmpz_inits'
  /home/kmodi/downloads/coreutils-8.27/src/factor.c:1762: undefined
reference to `__gmpz_clears'
  collect2: error: ld returned 1 exit status
  make[2]: *** [Makefile:7880: src/factor] Error 1
  make[2]: Leaving directory '/home/kmodi/downloads/coreutils-8.27'
  make[1]: *** [Makefile:11631: all-recursive] Error 1
  make[1]: Leaving directory '/home/kmodi/downloads/coreutils-8.27'
  make: *** [Makefile:5922: all] Error 2

I have 0 knowledge with C programming. But I know how to build software
locally on my machine. Here is the full config.log:
https://gist.githubusercontent.com/kaushalmodi/fee42913c6e13010c3bd19f77da097f8/raw/0b5bece1f682c2cbfe26a4c15b28427cec44db61/config.txt

Any help will be appreciated.

Thanks.
-- 

Kaushal Modi

From MAILER-DAEMON Thu Aug 31 12:59:53 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnSor-0002CH-Fi
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 12:59:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54633)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kaushal.modi@gmail.com>) id 1dnSZw-0006mp-GJ
	for coreutils@gnu.org; Thu, 31 Aug 2017 12:44:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kaushal.modi@gmail.com>) id 1dnSZv-00017Z-K0
	for coreutils@gnu.org; Thu, 31 Aug 2017 12:44:28 -0400
Received: from mail-yw0-x234.google.com ([2607:f8b0:4002:c05::234]:33475)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <kaushal.modi@gmail.com>)
	id 1dnSZv-00017T-FC
	for coreutils@gnu.org; Thu, 31 Aug 2017 12:44:27 -0400
Received: by mail-yw0-x234.google.com with SMTP id s143so1050637ywg.0
	for <coreutils@gnu.org>; Thu, 31 Aug 2017 09:44:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:references:in-reply-to:from:date:message-id:subject:to; 
	bh=Xr73C0TWVOv9zbY8RjWnsu3C2lq66CLP73H9A7sgeLw=;
	b=H4MEgZ7ZF0JLxcAnxiwJV+nKLmG6EBLmcxI+HAEkobotiBAVqrEiZ8i8wEuamZ0sa9
	Ih2daYArYJ0sxoVdi9PBD8NnLM9l0JzYWb3RbALINVGMGDluq/Kku3T5D/hbqgbTQjE5
	coKf4T/GIKwA7JM/rs3KzEcsPIGDDNkROvB/vBq3rpZkmToXuiBh25k2ff1jVJlcMKgj
	ehhl/9aEvovVM0/CPH6EcNPdd49dhUAWZkRMBwOQlVTfa8WLbjgquS64D5t9oy3BvcuN
	7gxaIaAm5zp3s23djy4MfY+2tMlDloptPsA87AnvooYBCu1TPGzMxcAfksz7piHauoRd
	oBkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:references:in-reply-to:from:date
	:message-id:subject:to;
	bh=Xr73C0TWVOv9zbY8RjWnsu3C2lq66CLP73H9A7sgeLw=;
	b=OaDgDUBL+Y356orLgYrh+PGvZu8B3mFj1hMRRe51sfLFCMJu3E87AqmQkBYY/4rJFX
	b7GRPCqu1MAcSLTvBf3Bukak0sK6imKM9RxpxSEdL3E3iWGyDPJSldlkJV26/SuCX9iY
	JGEb4y0H6+Vd+YIOa3rLs5aFhdVdD0VxJPbRROsD8ga9EP7/PO9AJjk3JgiaUtPKGXgm
	dI/HDDyvMP4ZQ8zncfZB6byPPpooH7212OJR3k5bJu861+8KsFMqbfdoXgas73ymKDLv
	e4Mf/WZZKZEK/GO8Psr6P5UwU2XhDuxsRt5XYidxS7PVyFBzbOlC88cIGJL42YdMLafD
	PFPg==
X-Gm-Message-State: AHYfb5iesnVQYfJl0uFofWzrSBWwhiUEplXy5VvNsa3j9XCkh2ZQN1nu
	8ZCIoQ4ccMunrNymZTgaQbvRMiy/Qw==
X-Google-Smtp-Source: ADKCNb4pFfhxV4NDPXZXY/HAQK2mPkbITVHsodn2uhVky3Uko5GffMqPc+zbIfO2fxyEgQ5sAtlTMcPEWRrLoSnhJXk=
X-Received: by 10.37.4.6 with SMTP id 6mr1794502ybe.225.1504197866256; Thu, 31
	Aug 2017 09:44:26 -0700 (PDT)
MIME-Version: 1.0
References: <CAFyQvY0J+VhQ99qrG_2huKXt-a8n3SQfYP9GY1gUx-+ymZkP4Q@mail.gmail.com>
In-Reply-To: <CAFyQvY0J+VhQ99qrG_2huKXt-a8n3SQfYP9GY1gUx-+ymZkP4Q@mail.gmail.com>
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Thu, 31 Aug 2017 16:44:15 +0000
Message-ID: <CAFyQvY2QiWSn_xbahhvXC8828obujoO6N9b6Ft-X2Q-q1z8G-w@mail.gmail.com>
Subject: Re: Help with building;
	fails because of "undefined reference to `__gmpz_inits'"
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4002:c05::234
X-Mailman-Approved-At: Thu, 31 Aug 2017 12:59:52 -0400
Content-Type: text/plain; charset="UTF-8"
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, 31 Aug 2017 16:44:33 -0000

On Thu, Aug 31, 2017 at 11:35 AM Kaushal Modi <kaushal.modi@gmail.com>
wrote:

>
>     CCLD     src/factor
>   src/factor.o: In function `mp_prime_p':
>   /home/kmodi/downloads/coreutils-8.27/src/factor.c:1395: undefined
> reference to `__gmpz_inits'
>   /home/kmodi/downloads/coreutils-8.27/src/factor.c:1459: undefined
> reference to `__gmpz_clears'
>   src/factor.o: In function `mp_factor_using_pollard_rho':
>   /home/kmodi/downloads/coreutils-8.27/src/factor.c:1682: undefined
> reference to `__gmpz_inits'
>   /home/kmodi/downloads/coreutils-8.27/src/factor.c:1762: undefined
> reference to `__gmpz_clears'
>   collect2: error: ld returned 1 exit status
>   make[2]: *** [Makefile:7880: src/factor] Error 1
>   make[2]: Leaving directory '/home/kmodi/downloads/coreutils-8.27'
>   make[1]: *** [Makefile:11631: all-recursive] Error 1
>   make[1]: Leaving directory '/home/kmodi/downloads/coreutils-8.27'
>   make: *** [Makefile:5922: all] Error 2
>

Please ignore that.

This got fixed after installing the gmp library locally to $FOO dir and
doing:

./configure --prefix="${coreutils_install_dir}" CPPFLAGS=-I"${FOO}/include"
LDFLAGS=-L"${FOO}/lib"
-- 

Kaushal Modi

From MAILER-DAEMON Thu Aug 31 22:45:29 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dnbxZ-0000qk-A1
	for mharc-coreutils@gnu.org; Thu, 31 Aug 2017 22:45:29 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49801)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnbxW-0000qJ-Gq
	for coreutils@gnu.org; Thu, 31 Aug 2017 22:45:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dnbxR-0007Fm-L6
	for coreutils@gnu.org; Thu, 31 Aug 2017 22:45:26 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:46640)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dnbxR-0007FT-Ex
	for coreutils@gnu.org; Thu, 31 Aug 2017 22:45:21 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
	[73.158.116.184])
	(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 48F6F9D11;
	Fri,  1 Sep 2017 03:45:18 +0100 (IST)
Subject: Re: new snapshot available: coreutils-8.27.103-db8d1
To: Eric Blake <eblake@redhat.com>, Assaf Gordon <assafgordon@gmail.com>,
	coreutils@gnu.org
References: <0679a156-cea7-165c-c79f-85952ff77784@draigBrady.com>
	<08a74e72-6121-ba16-e1b8-5201857370fa@draigBrady.com>
	<db7e3c69-9895-e1a8-aab9-02ba960255bb@gmail.com>
	<61e44df8-b782-9b40-1b72-eea86aa16e05@draigBrady.com>
	<08cd20a3-c5e9-10a3-8a81-3237ac6dacaf@redhat.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <b68fd7a6-0139-4dc0-06f5-36d215039e5e@draigBrady.com>
Date: Thu, 31 Aug 2017 19:45:14 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <08cd20a3-c5e9-10a3-8a81-3237ac6dacaf@redhat.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]
	[fuzzy]
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, 01 Sep 2017 02:45:27 -0000

On 31/08/17 06:02, Eric Blake wrote:
> On 08/30/2017 09:12 PM, P=C3=A1draig Brady wrote:
>=20
>>> FAIL: tests/ln/sf-1
>>> [...]
>>> + printf %0*d 256 0
>>> ash: %0*d: invalid format
>>
>>> (I guess printf(1) in Busybox's "ash" does not accept this format).
>>
>> Indeed:
>> $ sudo dnf install busybox
>> $ busybox ash -c 'printf %0*d 256 0'
>> ash: %0*d: invalid format
>>
>> Since this is the only ash specific issue it seems, I'll avoid like:
>>
>> -long_name=3D$(printf '%0*d' $name_max_plus1 0)
>> +long_name=3D$(yes 0 | head -n$name_max_plus1 | tr -d '\n')
>=20
> Couldn't we also ensure that we are using coreutils' printf, as in $(en=
v
> printf '%0*d' ...), so that we aren't depending upon sh's builtins?

Indeed that would be best.
I went with the more portable $(printf '%*s' $name_max_plus1 ...)
before I received this.

cheers,
P=C3=A1draig



