From MAILER-DAEMON Tue May 01 03:55:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SP7vs-0007ev-LW
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 03:55:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46311)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <hpa@zytor.com>) id 1SP599-00009C-7j
	for coreutils@gnu.org; Tue, 01 May 2012 00:57:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <hpa@zytor.com>) id 1SP596-00017a-EV
	for coreutils@gnu.org; Tue, 01 May 2012 00:57:06 -0400
Received: from terminus.zytor.com ([198.137.202.10]:56752)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <hpa@zytor.com>) id 1SP596-000150-3h
	for coreutils@gnu.org; Tue, 01 May 2012 00:57:04 -0400
Received: from tazenda.hos.anvin.org ([IPv6:2001:470:861f::feed:face:f00d])
	(authenticated bits=0)
	by mail.zytor.com (8.14.5/8.14.5) with ESMTP id q414FVqJ010450
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=OK);
	Mon, 30 Apr 2012 21:15:32 -0700
Message-ID: <4F9F635E.6070908@zytor.com>
Date: Mon, 30 Apr 2012 21:15:26 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:11.0) Gecko/20120329 Thunderbird/11.0.1
MIME-Version: 1.0
To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
Subject: Re: Another rfe:  "cp" this time
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
In-Reply-To: <4F9ABCD8.1070009@draigBrady.com>
X-Enigmail-Version: 1.4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by terminus.zytor.com id
	q414FVqJ010450
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 198.137.202.10
X-Mailman-Approved-At: Tue, 01 May 2012 03:55:35 -0400
Cc: Bruce Korb <bruce.korb@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 04:57:08 -0000

On 04/27/2012 08:35 AM, P=C3=A1draig Brady wrote:
>=20
> Yes, cp is bad for high latency links as it has a
> 32KiB buffer which it serially reads to and writes from.
>=20

Why this that, though?  At least for file-to-file copy, it could
certainly do much better with mmap() + write().

32K is so 1990.

	-hpa


--=20
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.



From MAILER-DAEMON Tue May 01 04:17:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SP8Gy-0005v0-4Z
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 04:17:24 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47787)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SP8Gv-0005uf-66
	for coreutils@gnu.org; Tue, 01 May 2012 04:17:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SP8Gt-0000Aw-II
	for coreutils@gnu.org; Tue, 01 May 2012 04:17:20 -0400
Received: from mx1.redhat.com ([209.132.183.28]:5266)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SP8Gt-0000AF-AD
	for coreutils@gnu.org; Tue, 01 May 2012 04:17:19 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q418HFtA021174
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 1 May 2012 04:17:15 -0400
Received: from [10.36.116.24] (ovpn-116-24.ams2.redhat.com [10.36.116.24])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q418HCNB023770
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Tue, 1 May 2012 04:17:14 -0400
Message-ID: <4F9F9C08.8040407@draigBrady.com>
Date: Tue, 01 May 2012 09:17:12 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: Another rfe:  "cp" this time
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com>
In-Reply-To: <4F9F635E.6070908@zytor.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q418HFtA021174
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Bruce Korb <bruce.korb@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:17:22 -0000

On 05/01/2012 05:15 AM, H. Peter Anvin wrote:
> On 04/27/2012 08:35 AM, P=C3=A1draig Brady wrote:
>>
>> Yes, cp is bad for high latency links as it has a
>> 32KiB buffer which it serially reads to and writes from.
>>
>=20
> Why this that, though?  At least for file-to-file copy, it could
> certainly do much better with mmap() + write().
>=20
> 32K is so 1990.

Well 2009 which is when we changed from 4K (blksize) :)

Just yesterday we bumped to 64K to minimize system
call overhead, which on modern machines give another
10% speed increase when copy files from cache.

Though it should be emphasised that the bottle neck is
usually in the devices/network and so optimizations at
this level do not help in the general case, and your
point about avoiding the copy (with mmap) is a good one,
but in the same camp.

We have looked at higher level constructs to improve efficiency.

fiemap() to avoid reading holes or empty extents from input.
However XFS needs to sync a file first before fiemap is representative,
so we only enable that functionality for sparse files.
ext4 also has some issues with this currently, but could
be adjusted I understand.

We also looked into using fallocate to optimize writing NULs
to the output, as well as improving extent layout in the dest,
and giving immediate ENOSPC. Again XFS is problematic here
as it has overloaded fallocate() to align any allocations
on 1MB (configurable) boundaries, which introduces fragmentation
if used generally. We could restrict fallocate() to large files
I suppose. I'm also inclined to adjust fallocate() in the kernel
to accept a FALLOC_FL_ALIGN flag, that xfs tools could use to enable
this functionality.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Tue May 01 11:43:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPFEl-0005T3-Ug
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 11:43:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36747)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPFEi-0005R3-T4
	for coreutils@gnu.org; Tue, 01 May 2012 11:43:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPFEg-0004Wg-Mg
	for coreutils@gnu.org; Tue, 01 May 2012 11:43:32 -0400
Received: from mail-gy0-f169.google.com ([209.85.160.169]:63259)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPFEg-0004WU-FP
	for coreutils@gnu.org; Tue, 01 May 2012 11:43:30 -0400
Received: by ghrr18 with SMTP id r18so2341354ghr.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 08:43:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:content-transfer-encoding;
	bh=UJi9UpnKK9VgnkXPljPBNxhcSsowjHfM5PJVmIlmGPc=;
	b=yf4bfnNlzQwdZa4BBELsbBLyOtULQFtFFLDFrU0N/2DBcayWYN1BQJBY0f3dLLCLzj
	RwpKQ8UwnFz/brcTlFBzEkxFPM+XtI9y1QBKaH3GvXX4t80URRophLWFivL5fNys5a1I
	4X/Sjkhd3MrzvCUY/JHgvdFjQVfMbWfer2Cff/BRT2fxNqpBfKqjftkFV7dU/fqB7+kr
	qvpoL2s/akkH+SxCziMhB/c7amw9ph/uzyd90EAp/QIhT5YchQYguj8BHARHHK/nXBx6
	3lYfKNThE1Xc/2pkdZWhFkALsfsYJeGeVjjqwnI2tOJ6MdN9Ge5NIO8aBOQAvgNHZ5sR
	GApQ==
Received: by 10.50.57.129 with SMTP id i1mr2416717igq.33.1335887007741; Tue,
	01 May 2012 08:43:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.43.51.193 with HTTP; Tue, 1 May 2012 08:43:07 -0700 (PDT)
In-Reply-To: <4F9F9C08.8040407@draigBrady.com>
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com> <4F9F9C08.8040407@draigBrady.com>
From: Bruce Korb <bruce.korb@gmail.com>
Date: Tue, 1 May 2012 08:43:07 -0700
Message-ID: <CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
Subject: Re: Another rfe: "cp" this time
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigbrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.160.169
Cc: coreutils@gnu.org, "H. Peter Anvin" <hpa@zytor.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:43:34 -0000

On Tue, May 1, 2012 at 1:17 AM, P=E1draig Brady <P@draigbrady.com> wrote:
> On 05/01/2012 05:15 AM, H. Peter Anvin wrote:
>> On 04/27/2012 08:35 AM, P=E1draig Brady wrote:
>>> 32KiB buffer which it serially reads to and writes from.
>> Why this that, though? =A0At least for file-to-file copy, it could
>> certainly do much better with mmap() + write().
>>
>> 32K is so 1990.
>
> Well 2009 which is when we changed from 4K (blksize) :)
>
> Just yesterday we bumped to 64K to minimize system
> call overhead, which on modern machines give another
> 10% speed increase when copy files from cache.
>
> Though it should be emphasised that the bottle neck is
> usually in the devices/network and so optimizations at
> this level do not help in the general case, and your

My particular whole issue is the network bottle neck.  Doing
the copy as sequential reads of any size results in an empty
pipe while each piece gets acked.  I don't know what would
happen were the file mmaped.  Would the fs layer do sequential
readahead or would it send out requests for more data before
earlier requests are satisfied?  It'd likely take reading code to
find out, but I'm guessing it will wind up serialized just like
the read 32K at a time basic copy.  64K would help if it caused
however many concurrent requests for pieces of the 64K, but
that isn't likely either.  The big deal (for me) is to get enough
concurrent requests going so the long wide pipe can be kept
full of data.  However that needs to happen.

Cheers - Bruce


From MAILER-DAEMON Tue May 01 12:56:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPGNd-0004dP-Fl
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 12:56:49 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54938)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPGNb-0004d9-A6
	for coreutils@gnu.org; Tue, 01 May 2012 12:56:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPGNZ-0007eE-JL
	for coreutils@gnu.org; Tue, 01 May 2012 12:56:46 -0400
Received: from mx.meyering.net ([88.168.87.75]:36134)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPGNZ-0007e6-Br
	for coreutils@gnu.org; Tue, 01 May 2012 12:56:45 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 7F4B8600DF;
	Tue,  1 May 2012 18:56:43 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bruce Korb <bruce.korb@gmail.com>
Subject: Re: Another rfe: "cp" this time
In-Reply-To: <4F9EA0B2.1050202@gmail.com> (Bruce Korb's message of "Mon, 30
	Apr 2012 07:24:50 -0700")
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<CAKRnqN+130RH8gMzAkANK2sC81fBa-8ow8MDWTFaY85KMDTcLQ@mail.gmail.com>
	<4F9ADBB2.9080808@draigBrady.com> <4F9AFA32.3040301@draigBrady.com>
	<4F9B0F4D.8070902@gmail.com> <4F9B4F59.5070801@gnu.org>
	<4F9EA0B2.1050202@gmail.com>
Date: Tue, 01 May 2012 18:56:43 +0200
Message-ID: <871un3vnzo.fsf@rho.meyering.net>
Lines: 52
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 16:56:48 -0000

Bruce Korb wrote:
> On 04/27/12 19:00, Bruce Korb wrote:
>>> Link? no. Copy? yes. But it is a long way from...
>>
>> Not only not ready for prime time, but
>
> Link? Yes.
>
> I needed another file, so I finished the basic work.
> Reflecting on the special config needs tho (throttling,
> user entertainment [progress info], etc.) maybe not
> a candidate for incorporation into "cp", yielding
> yet another utility?  The shell wrapper around "dd"
> ought to have worked, but it did not.  All the dd's
> with a non-zero "seek" option quit without transferring
> any data at all.  The "rsync" solution decided that
> since the source file was local, it would read through
> the entire file.  Apparently it is not network mount
> aware.  Anyway, with a reasonably recent "libopts"
> installation, you can clone this, unroll the .tar
> file and build:
>
> git://github.com/brkorb/pcopy.git

Hi Bruce,

I took a quick look: one nit: you should either change
the three strdup uses, s/strdup/xstrdup/, or arrange to
handle memory allocation failure, so that the post-strdup
code doesn't deref NULL.

I did try to build, but got this w/F17's
autogen-libopts-5.12-2.fc17.x86_64:

    autogen -MTstamp-pcopy-opts -MFpcopy-opts.d -MP pcopy-opts.def
    Error in template /usr/share/autogen/optcode.tlib, line 523
            DEFINITIONS ERROR in /usr/share/autogen/optcode.tlib line 523 for pcopy-opts.c:
            invalid value for 'no-xlate'
    Failing Guile command:  = = = = =

    (error "invalid value for 'no-xlate'")

    =================================
    make: *** [stamp-pcopy-opts] Error 2

So far, it seems like you're the only one to find this useful.
But now that you've identified the problem and have a solution,
who knows... maybe a lot of people will come forward and say your
tool makes a big difference for them.

What do you think about distributing it separately for now,
and we reconsider if/when there's more demand?


From MAILER-DAEMON Tue May 01 14:13:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPHZU-00022l-JR
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 14:13:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43287)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPHZS-00021k-2g
	for coreutils@gnu.org; Tue, 01 May 2012 14:13:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPHZQ-00009H-8Z
	for coreutils@gnu.org; Tue, 01 May 2012 14:13:05 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:56333)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPHZQ-000091-15
	for coreutils@gnu.org; Tue, 01 May 2012 14:13:04 -0400
Received: by yenm8 with SMTP id m8so2533738yen.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 11:13:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:content-transfer-encoding;
	bh=Ev0eUszopCpbK5DRV4knyv4T6iNkPkHOKtsdy2JcZa0=;
	b=bsimKT2yUxADVPUu3+/Y66x6zkTxUA/6iKQOpddqVG3epGI0PQXJqJy46Yas6M4O3N
	TP1rgT+zdgsaRj0w9Fj5CTCXWETq2OWVmZ1j2CL7SdC9+fyJyoIZocqmFh3IowG0pIKp
	fov7klwZXS6yvwMUxoSLGLSKRYGLGWX6l4KuIQsuuQiPNMR0y3aUPwpeb+ANi/9LGDCy
	aftMyQ8CyNi+LG1mS6m1vBUJmxAreOkadc09w8usUhJPWZ+hnHHia3VeS3aB38OGCYMN
	SPydHG409QfOaH2Q7b5+qJ/qo3in1cN7qCPymIXecJEoxSSO7oAFFhn3MGlAcad4oAQl
	Xnqw==
Received: by 10.42.247.193 with SMTP id md1mr19539194icb.33.1335895982229;
	Tue, 01 May 2012 11:13:02 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.43.51.193 with HTTP; Tue, 1 May 2012 11:12:41 -0700 (PDT)
In-Reply-To: <871un3vnzo.fsf@rho.meyering.net>
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<CAKRnqN+130RH8gMzAkANK2sC81fBa-8ow8MDWTFaY85KMDTcLQ@mail.gmail.com>
	<4F9ADBB2.9080808@draigBrady.com> <4F9AFA32.3040301@draigBrady.com>
	<4F9B0F4D.8070902@gmail.com> <4F9B4F59.5070801@gnu.org>
	<4F9EA0B2.1050202@gmail.com> <871un3vnzo.fsf@rho.meyering.net>
From: Bruce Korb <bruce.korb@gmail.com>
Date: Tue, 1 May 2012 11:12:41 -0700
Message-ID: <CAKRnqNJJzj4CFGxzdA1EDFWoVLYDpGW84GiO_Lpz+EB22oRfNw@mail.gmail.com>
Subject: Re: Another rfe: "cp" this time
To: Jim Meyering <jim@meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.169
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:13:07 -0000

Hi Jim,

Thanks for looking.  I'll fiddle the strdup.  Also:

On Tue, May 1, 2012 at 9:56 AM, Jim Meyering <jim@meyering.net> wrote:
>> aware. =A0Anyway, with a reasonably recent "libopts"
>> installation, you can clone this, unroll the .tar
>> file and build:
>>
>> git://github.com/brkorb/pcopy.git

Meaning to avoid the re-generation of the *opts.[ch] files with the "tar" f=
iles.
Perhaps:
   tar -xf *.tar ; touch stamp-* ; touch *opts.[ch]

I added stuff (die, vdie and fserr functions) to the output
and our gnutls friends really wanted the elimination of all NLS
code, hence the new "anything" value for "no-xlate".

> So far, it seems like you're the only one to find this useful.
> But now that you've identified the problem and have a solution,
> who knows... maybe a lot of people will come forward and say your
> tool makes a big difference for them.

As long as they both look for and find this solution.  Part of my
reasoning for making it a "cp" option.

> What do you think about distributing it separately for now,
> and we reconsider if/when there's more demand?

Sure, but it is finding the demand.  And, of course, wanting to avoid
the maintenance of yet another package... :)

Cheers - Bruce


From MAILER-DAEMON Tue May 01 14:21:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPHhI-0002jq-SW
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 14:21:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53908)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPHhG-0002jR-20
	for coreutils@gnu.org; Tue, 01 May 2012 14:21:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPHhE-0003M3-43
	for coreutils@gnu.org; Tue, 01 May 2012 14:21:09 -0400
Received: from mx1.redhat.com ([209.132.183.28]:10937)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPHhD-0003Lt-RN
	for coreutils@gnu.org; Tue, 01 May 2012 14:21:08 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q41IKatA018053
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 1 May 2012 14:21:04 -0400
Received: from [10.36.116.24] (ovpn-116-24.ams2.redhat.com [10.36.116.24])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q41Gx2KL025554
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Tue, 1 May 2012 12:59:04 -0400
Message-ID: <4FA01656.9010902@draigBrady.com>
Date: Tue, 01 May 2012 17:59:02 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Bruce Korb <bruce.korb@gmail.com>
Subject: Re: Another rfe: "cp" this time
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com> <4F9F9C08.8040407@draigBrady.com>
	<CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
In-Reply-To: <CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q41IKatA018053
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org, "H. Peter Anvin" <hpa@zytor.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:21:11 -0000

On 05/01/2012 04:43 PM, Bruce Korb wrote:
> On Tue, May 1, 2012 at 1:17 AM, P=E1draig Brady <P@draigbrady.com> wrot=
e:
>> On 05/01/2012 05:15 AM, H. Peter Anvin wrote:
>>> On 04/27/2012 08:35 AM, P=E1draig Brady wrote:
>>>> 32KiB buffer which it serially reads to and writes from.
>>> Why this that, though?  At least for file-to-file copy, it could
>>> certainly do much better with mmap() + write().
>>>
>>> 32K is so 1990.
>>
>> Well 2009 which is when we changed from 4K (blksize) :)
>>
>> Just yesterday we bumped to 64K to minimize system
>> call overhead, which on modern machines give another
>> 10% speed increase when copy files from cache.
>>
>> Though it should be emphasised that the bottle neck is
>> usually in the devices/network and so optimizations at
>> this level do not help in the general case, and your
>=20
> My particular whole issue is the network bottle neck.  Doing
> the copy as sequential reads of any size results in an empty
> pipe while each piece gets acked.

Right.

> I don't know what would
> happen were the file mmaped.  Would the fs layer do sequential
> readahead or would it send out requests for more data before
> earlier requests are satisfied?  It'd likely take reading code to
> find out, but I'm guessing it will wind up serialized just like
> the read 32K at a time basic copy.

Yep, as I said in my reply.

> 64K would help if it caused
> however many concurrent requests for pieces of the 64K, but
> that isn't likely either.

Right. It would help a bit though.

> The big deal (for me) is to get enough
> concurrent requests going so the long wide pipe can be kept
> full of data.  However that needs to happen.

Parallelizing cp seems like an effective but awkward solution
to me, as that logic would need to be replicated
in all programs wanting to read efficiently.

It should be possible at least on a per file basis,
to indicate we want to read the file sequentially,
and thus the kernel can use appropriate read-ahead
to keep its buffers full, and network protocols
can behave intelligently too, like interleaving reads
for example.

Now many coreutils already provide such a hint to the kernel:
http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommit;h=3D47076e3c
But copy.c does not currently. I'm not sure why I didn't
do it for copy.c now, but I look into adding it.
In the meantime you might be able to tweak cifs read-ahead
settings, or ask on a samba list as to how to more efficiently
stream over high latency links.

cheers,
P=E1draig.


From MAILER-DAEMON Tue May 01 14:40:00 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPHzU-0008T4-Fu
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 14:40:00 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55619)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPHzP-0008BC-BD
	for coreutils@gnu.org; Tue, 01 May 2012 14:39:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPHzN-0001zy-BE
	for coreutils@gnu.org; Tue, 01 May 2012 14:39:54 -0400
Received: from mx.meyering.net ([88.168.87.75]:36401)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPHzN-0001zo-3m
	for coreutils@gnu.org; Tue, 01 May 2012 14:39:53 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id C4A17600DF;
	Tue,  1 May 2012 20:39:49 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bruce Korb <bruce.korb@gmail.com>
Subject: Re: Another rfe: "cp" this time
In-Reply-To: <CAKRnqNJJzj4CFGxzdA1EDFWoVLYDpGW84GiO_Lpz+EB22oRfNw@mail.gmail.com>
	(Bruce Korb's message of "Tue, 1 May 2012 11:12:41 -0700")
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<CAKRnqN+130RH8gMzAkANK2sC81fBa-8ow8MDWTFaY85KMDTcLQ@mail.gmail.com>
	<4F9ADBB2.9080808@draigBrady.com> <4F9AFA32.3040301@draigBrady.com>
	<4F9B0F4D.8070902@gmail.com> <4F9B4F59.5070801@gnu.org>
	<4F9EA0B2.1050202@gmail.com> <871un3vnzo.fsf@rho.meyering.net>
	<CAKRnqNJJzj4CFGxzdA1EDFWoVLYDpGW84GiO_Lpz+EB22oRfNw@mail.gmail.com>
Date: Tue, 01 May 2012 20:39:49 +0200
Message-ID: <87r4v3u4ne.fsf@rho.meyering.net>
Lines: 53
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:39:57 -0000

Bruce Korb wrote:
> Hi Jim,
>
> Thanks for looking.  I'll fiddle the strdup.  Also:
>
> On Tue, May 1, 2012 at 9:56 AM, Jim Meyering <jim@meyering.net> wrote:
>>> aware. =A0Anyway, with a reasonably recent "libopts"
>>> installation, you can clone this, unroll the .tar
>>> file and build:
>>>
>>> git://github.com/brkorb/pcopy.git
>
> Meaning to avoid the re-generation of the *opts.[ch] files with the "tar"=
 files.
> Perhaps:
>    tar -xf *.tar ; touch stamp-* ; touch *opts.[ch]
>
> I added stuff (die, vdie and fserr functions) to the output
> and our gnutls friends really wanted the elimination of all NLS
> code, hence the new "anything" value for "no-xlate".

In case you're preparing build-from-clone instructions,
the above did not work for me:

With these commands,
  git clone git://github.com/brkorb/pcopy.git && cd pcopy &&
  tar -xf *.tar && touch stamp-* && touch *opts.[ch] && make -j1

I get this output:
  cc  -std=3Dc99 -g -O4 -c -o pcopy.o   pcopy.c
  In file included from pcopy.c:2:0:
  pcopy-opts.h:63:3: error: #error option template version mismatches autoo=
pts/options.h header
  pcopy-opts.h:64:3: error: unknown type name 'Choke'
  pcopy-opts.h:64:11: error: expected '=3D', ',', ';', 'asm' or '__attribut=
e__' before '.' token
  pcopy-opts.h:82:3: warning: data definition has no type or storage class =
[enabled by default]
  pcopy-opts.h:82:3: warning: type defaults to 'int' in declaration of 'teO=
ptIndex' [enabled by default]
  pcopy.c: In function 'copy_start':
  pcopy.c:63:11: error: 'INDEX_OPT_QUIET' undeclared (first use in this fun=
ction)
  pcopy.c:63:11: note: each undeclared identifier is reported only once for=
 each function it appears in
  pcopy.c: In function 'copy_progress':
  pcopy.c:106:11: error: 'INDEX_OPT_QUIET' undeclared (first use in this fu=
nction)
  pcopy.c:114:9: error: 'INDEX_OPT_FLOW_RATE' undeclared (first use in this=
 function)
  pcopy.c: In function 'copy_wrap':
  pcopy.c:140:9: error: 'INDEX_OPT_QUIET' undeclared (first use in this fun=
ction)
  pcopy.c: In function 'do_copy':
  pcopy.c:162:29: error: 'INDEX_OPT_MAX_CHUNK' undeclared (first use in thi=
s function)
  pcopy.c: In function 'make_dest_name':
  pcopy.c:211:11: error: 'INDEX_OPT_DESTINATION' undeclared (first use in t=
his function)
  pcopy.c: In function 'pcopy':
  pcopy.c:362:1: error: 'INDEX_OPT_THREAD_CT' undeclared (first use in this=
 function)
  pcopy.c:374:1: error: 'INDEX_OPT_MAX_CHUNK' undeclared (first use in this=
 function)
  pcopy.c:380:9: error: 'INDEX_OPT_FLOW_RATE' undeclared (first use in this=
 function)
  make: *** [pcopy.o] Error 1
  [Exit 2]


From MAILER-DAEMON Tue May 01 15:31:30 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPInK-0003Cc-TL
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 15:31:30 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53545)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPInJ-0003CL-5E
	for coreutils@gnu.org; Tue, 01 May 2012 15:31:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPInG-0005YK-MH
	for coreutils@gnu.org; Tue, 01 May 2012 15:31:28 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:45964)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPInG-0005Xs-Eo
	for coreutils@gnu.org; Tue, 01 May 2012 15:31:26 -0400
Received: by yenm8 with SMTP id m8so2634887yen.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 12:31:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=6/MXUClbu4+1CQXE0Saed7eC2Oj/wVhzbOsYgJkf8aA=;
	b=MWzkXfBkPRr+5SJ30q+flWRum/58VW/10MKodtTCGgKYuokHMHrtGsd2Xre+o9kxoa
	3r+k5QohmgqWWs8EjmThnDzDeKrxokNyZjzAIVtOubfmzA7GJlI55AV91SdI5pGVo7JY
	xXgE32uKLpBy98EmW+u+J7TVdDI+Q0R/PI2vtWmmZPT/KbOtARJPL/YXGdm0u611zbTe
	lDEI2fTo03tnV7U5nIC9834KfrOrRisGbGM5OQ65gMQFybVhMMCQ0lBeTGrsh3VVtHMo
	BuBVRy5PqbqJLJze/W2hRX9IXrlC1RzawzfTkM1T2d/m7JaIEI8fb72ueuj+vw6GWQ1g
	eRhg==
Received: by 10.50.51.163 with SMTP id l3mr2898170igo.3.1335900684611; Tue, 01
	May 2012 12:31:24 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.43.51.193 with HTTP; Tue, 1 May 2012 12:31:04 -0700 (PDT)
In-Reply-To: <87r4v3u4ne.fsf@rho.meyering.net>
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<CAKRnqN+130RH8gMzAkANK2sC81fBa-8ow8MDWTFaY85KMDTcLQ@mail.gmail.com>
	<4F9ADBB2.9080808@draigBrady.com> <4F9AFA32.3040301@draigBrady.com>
	<4F9B0F4D.8070902@gmail.com> <4F9B4F59.5070801@gnu.org>
	<4F9EA0B2.1050202@gmail.com> <871un3vnzo.fsf@rho.meyering.net>
	<CAKRnqNJJzj4CFGxzdA1EDFWoVLYDpGW84GiO_Lpz+EB22oRfNw@mail.gmail.com>
	<87r4v3u4ne.fsf@rho.meyering.net>
From: Bruce Korb <bruce.korb@gmail.com>
Date: Tue, 1 May 2012 12:31:04 -0700
Message-ID: <CAKRnqNJmtsfdCxNcOA+DF4voM3bTiwDskGoAAH9mdx11Vad6JQ@mail.gmail.com>
Subject: Re: Another rfe: "cp" this time
To: Jim Meyering <jim@meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.169
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 19:31:30 -0000

OK.  Thanks.  Then it won't work until I do my next release.
"Works for me", but likely because I've installed the pre-release headers.
Sorry for the dead end.

On Tue, May 1, 2012 at 11:39 AM, Jim Meyering <jim@meyering.net> wrote:

> #error option template version mismatches autoopts/options.h header


From MAILER-DAEMON Tue May 01 16:02:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPJGr-0005mJ-P3
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 16:02:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44167)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPJGo-0005lU-GR
	for coreutils@gnu.org; Tue, 01 May 2012 16:01:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPJGm-0008FX-HC
	for coreutils@gnu.org; Tue, 01 May 2012 16:01:58 -0400
Received: from mail-gy0-f169.google.com ([209.85.160.169]:57374)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPJGm-0008FL-Af
	for coreutils@gnu.org; Tue, 01 May 2012 16:01:56 -0400
Received: by ghrr18 with SMTP id r18so2676074ghr.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 13:01:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:content-transfer-encoding;
	bh=r/VF2a6HgNbTlnDJRUBNfqV2H5L8RT/wLTCmuqjZJhI=;
	b=Reuav30u52zoV9NVZEJynOGByYlDrt/SNONbOxurMtmEFfIm7/P3jKnrWndP82appc
	LqyS/SF4xnRxXqdBkLGnO41suSHURhZyK0K1c5MtcqWgOrNSk6briVhIa6/4Qd1x0bwE
	8lchpYw7cgHE8QUmV3K7mam4t0/AjtFGUx2B1JnBeA5f3xc7tcRnxJ8aa5+fXpsLILUW
	eQL5cW0xsM3GVQJlI7J1WXaaoY2jBPSw46R0kIbEKpxKD8lMh8i7NvesMCIvzyvAs77K
	zlhbpi0eksY9BAVYBqLxNmWEZBUeooGUFCuqbCBB7JijL+PvvOSsWYs4YkzwkP4WC4wN
	ig6Q==
Received: by 10.50.187.233 with SMTP id fv9mr2946177igc.34.1335902514168; Tue,
	01 May 2012 13:01:54 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.43.51.193 with HTTP; Tue, 1 May 2012 13:01:32 -0700 (PDT)
In-Reply-To: <4FA01656.9010902@draigBrady.com>
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com> <4F9F9C08.8040407@draigBrady.com>
	<CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
	<4FA01656.9010902@draigBrady.com>
From: Bruce Korb <bruce.korb@gmail.com>
Date: Tue, 1 May 2012 13:01:32 -0700
Message-ID: <CAKRnqNLOYV8=x69fDGDXH_uHdz-f+XhY7YPDGQZLB4NvJyJ9nQ@mail.gmail.com>
Subject: Re: Another rfe: "cp" this time
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigbrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.160.169
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 20:02:00 -0000

Hi P=E1draig,

On Tue, May 1, 2012 at 9:59 AM, P=E1draig Brady <P@draigbrady.com> wrote:
> It should be possible at least on a per file basis,
> to indicate we want to read the file sequentially,
> and thus the kernel can use appropriate read-ahead
> to keep its buffers full, and network protocols
> can behave intelligently too, like interleaving reads
> for example.

"extended read ahead", methinks.  The read ahead needs to tune itself
to latency.

> Now many coreutils already provide such a hint to the kernel:
> http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommit;h=3D47076e3c
> But copy.c does not currently. I'm not sure why I didn't
> do it for copy.c now, but

:)  I'm glad I'm not the only one guilty of oversight....

> In the meantime you might be able to tweak cifs read-ahead
> settings, or ask on a samba list as to how to more efficiently
> stream over high latency links.

Read ahead is more likely tuned at a slightly higher layer, the glue
layer over CIFS or NFS (or EXT4?).  I would hope anyway.
There are dusty cobwebs layered over my recollections of the ufs
file system.  That is the code that ought to be looking at response
delays and deciding how much read ahead is needed for the
demand rate vs. the turnaround time.

If that fix goes in, I could see it in less than 5 years! :)

Regards, Bruce


From MAILER-DAEMON Tue May 01 16:33:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPJlm-00077K-7r
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 16:33:58 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60662)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu.coreutils@jelmail.com>) id 1SPJkI-0006qS-18
	for coreutils@gnu.org; Tue, 01 May 2012 16:32:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu.coreutils@jelmail.com>) id 1SPJkG-0002ZE-11
	for coreutils@gnu.org; Tue, 01 May 2012 16:32:25 -0400
Received: from avasout05.plus.net ([84.93.230.250]:40237)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu.coreutils@jelmail.com>) id 1SPJkF-0002Z3-O8
	for coreutils@gnu.org; Tue, 01 May 2012 16:32:23 -0400
Received: from [10.0.200.2] ([212.159.104.145]) by avasout05 with smtp
	id 4kYL1j00438EDcL01kYM6D; Tue, 01 May 2012 21:32:21 +0100
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.0 cv=Pct9d1dd c=1 sm=1 a=LmiDhuzNXzDmzyv3sIr6Rw==:17
	a=bgZNySebihQA:10 a=BVQA6gv2fUcA:10 a=fhrNw0JBbRwA:10
	a=VLG22z9PMdafoXTvUBUA:9 a=uQwPd5irsTaJqvPm6UkA:7 a=wPNLvfGTeEIA:10
	a=Rht8JnoZUoWVoIysSbwA:9 a=OSfi6xNnthv3MJYCNq8A:7 a=_W_S_7VecoQA:10
	a=LmiDhuzNXzDmzyv3sIr6Rw==:117
Message-ID: <4FA04854.6090300@jelmail.com>
Date: Tue, 01 May 2012 21:32:20 +0100
From: John Lane <gnu.coreutils@jelmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120426 Thunderbird/12.0
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: chroot with --userspec when chrooting from x86_64 to i686
Content-Type: multipart/alternative;
	boundary="------------080108000200050802040509"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 84.93.230.250
X-Mailman-Approved-At: Tue, 01 May 2012 16:33:56 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 20:32:27 -0000

This is a multi-part message in MIME format.
--------------080108000200050802040509
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello, this is my first post here, I hope this is the right place to ask 
this question. I have also asked this on Stack Exchange but I think this 
might be a more appropriate audience. I hope that's ok. I'm experencing 
a problem with chroot and I am running on Arch Linux x86_64.

I have a 64 bit chroot and a 32 bit chroot. They are identical except 
that one is 32 bit and one is 64 bit.

I can enter either of them using "chroot /path/to/chroot". No problems.

If I want to do that as a specific user the command is "chroot 
--userspec=user:group /path/to/chroot"

This also works fine for the 64 bit chroot. However it fails for the 32 
bit chroot. It fails with status 125 and the message "chroot: invalid user"

Also, doing "chroot --userspec=uid:gid /path/to/chroot" works fine in 
both 32 and 64 bit chroots (uid and gid are the numeric ids of the 
required user and group).

(All commands are issued as root.)

I am using a work around for this problem. Assuming $user has the 
user:group I want (e.g. john:users), I do this:

|u=$(echo $user | awk -F ":" '{print $1}')
g=$(echo $user | awk -F ":" '{print $2}')
uid=$(grep $u /opt/chroot32/etc/passwd | awk -F ":" '{print $3}')
gid=$(grep $g /opt/chroot32/etc/group  | awk -F ":" '{print $3}')
echo "Using $uid:$gid in place of $user"
chroot --userspec="$uid:$gid" /opt/chroot32
|

This works - it looks up the desired user:group inside the chroot's 
passwd and group files and then uses those for the chroot. And the above 
workaround is not necessary when accessing a 64 bit chroot.

I don't know why I am experiencing this inconsistent behaviour, whether 
it is a bug or if it's due to me doing something wrong.

Any advice appreciated.

Thanks.


--------------080108000200050802040509
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="post-text" itemprop="description">
      <p>Hello, this is my first post here, I hope this is the right
        place to ask this question. I have also asked this on Stack
        Exchange but I think this might be a more appropriate audience.
        I hope that's ok. I'm experencing a problem with chroot and I am
        running on Arch Linux x86_64.</p>
      <p>I have a 64 bit chroot and a 32 bit chroot. They are identical
        except that one is 32 bit and one is 64 bit.</p>
      <p>I can enter either of them using "chroot /path/to/chroot". No
        problems.<br>
      </p>
      If I want to do that as a specific user the command is "chroot
      --userspec=user:group /path/to/chroot"
      <p>This also works fine for the 64 bit chroot. However it fails
        for the 32 bit chroot. It fails with status 125 and the message
        "chroot: invalid user"</p>
      <p>Also, doing "chroot --userspec=uid:gid /path/to/chroot" works
        fine in both 32 and 64 bit chroots (uid and gid are the numeric
        ids of the required user and group).</p>
      (All commands are issued as root.)&nbsp;
      <p>I am using a work around for this problem. Assuming $user has
        the user:group I want (e.g. john:users), I do this:</p>
      <pre><code>u=$(echo $user | awk -F ":" '{print $1}')
g=$(echo $user | awk -F ":" '{print $2}')
uid=$(grep $u /opt/chroot32/etc/passwd | awk -F ":" '{print $3}')
gid=$(grep $g /opt/chroot32/etc/group  | awk -F ":" '{print $3}')
echo "Using $uid:$gid in place of $user"
chroot --userspec="$uid:$gid" /opt/chroot32
</code></pre>
      <p>This works - it looks up the desired user:group inside the
        chroot's passwd and group files and then uses those for the
        chroot. And the above workaround is not necessary when accessing
        a 64 bit chroot.<br>
      </p>
      <p>I don't know why I am experiencing this inconsistent behaviour,
        whether it is a bug or if it's due to me doing something wrong.<br>
      </p>
      <p>Any advice appreciated.<br>
      </p>
      <p>Thanks.</p>
    </div>
  </body>
</html>

--------------080108000200050802040509--


From MAILER-DAEMON Tue May 01 17:16:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPKQi-0001jE-5c
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 17:16:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48208)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPKQf-0001iz-Hx
	for coreutils@gnu.org; Tue, 01 May 2012 17:16:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPKQd-0002eS-8I
	for coreutils@gnu.org; Tue, 01 May 2012 17:16:13 -0400
Received: from mx1.redhat.com ([209.132.183.28]:57070)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPKQc-0002eI-VP
	for coreutils@gnu.org; Tue, 01 May 2012 17:16:11 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q41LG8k9028602
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 1 May 2012 17:16:08 -0400
Received: from [10.36.116.24] (ovpn-116-24.ams2.redhat.com [10.36.116.24])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q41LG66W020538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Tue, 1 May 2012 17:16:07 -0400
Message-ID: <4FA05296.30003@draigBrady.com>
Date: Tue, 01 May 2012 22:16:06 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Bruce Korb <bruce.korb@gmail.com>
Subject: Re: Another rfe: "cp" this time
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com> <4F9F9C08.8040407@draigBrady.com>
	<CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
	<4FA01656.9010902@draigBrady.com>
In-Reply-To: <4FA01656.9010902@draigBrady.com>
X-Enigmail-Version: 1.3.2
Content-Type: multipart/mixed; boundary="------------080901010006030809020501"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org, "H. Peter Anvin" <hpa@zytor.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 21:16:15 -0000

This is a multi-part message in MIME format.
--------------080901010006030809020501
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q41LG8k9028602

On 05/01/2012 05:59 PM, P=E1draig Brady wrote:
> Now many coreutils already provide such a hint to the kernel:
> http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommit;h=3D47076e3c
> But copy.c does not currently. I'm not sure why I didn't
> do it for copy.c now, but I look into adding it.

The attached seems to give another 5% speedup!

$ dd bs=3D1MB count=3D200 if=3D/dev/zero of=3Dfile.in

$ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
$ time ./cp-before file.in /dev/shm/; rm /dev/shm/file.in
real    0m0.843s
user    0m0.005s
sys     0m0.417s
$ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
$ time ./cp-before file.in /dev/shm/; rm /dev/shm/file.in
real    0m0.856s
user    0m0.002s
sys     0m0.422s

$ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
$ time ./cp-after file.in /dev/shm/; rm /dev/shm/file.in
real    0m0.809s
user    0m0.006s
sys     0m0.373s
$ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
$ time ./cp-after file.in /dev/shm/; rm /dev/shm/file.in
real    0m0.804s
user    0m0.007s
sys     0m0.405s

cheers,
P=E1draig.

--------------080901010006030809020501
Content-Type: text/plain;
 name="cp-fadvise.diff"
Content-Disposition: attachment;
 filename="cp-fadvise.diff"
Content-Transfer-Encoding: 7bit

>From 24e6311c53f40e874854e1574ee1c8f2de161ab2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Tue, 1 May 2012 21:50:49 +0100
Subject: [PATCH] cp,mv,install: provide POSIX_FADV_SEQUENTIAL hint to input

This was inadvertently omitted from v8.5-104-g47076e3,
and gives the same 5% speedup when copying from an SSD.

* src/copy.c (copy_internal): Apply the FADVISE_SEQUENTIAL hint.
---
 src/copy.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/copy.c b/src/copy.c
index 414fbe0..00d1c34 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -39,6 +39,7 @@
 #include "cp-hash.h"
 #include "extent-scan.h"
 #include "error.h"
+#include "fadvise.h"
 #include "fcntl--.h"
 #include "fiemap.h"
 #include "file-set.h"
@@ -980,6 +981,8 @@ copy_reg (char const *src_name, char const *dst_name,
       size_t buf_alignment_slop = sizeof (word) + buf_alignment - 1;
       size_t buf_size = io_blksize (sb);
 
+      fdadvise (source_desc, 0, 0, FADVISE_SEQUENTIAL);
+
       /* Deal with sparse files.  */
       bool make_holes = false;
       bool sparse_src = false;
-- 
1.7.6.4


--------------080901010006030809020501--


From MAILER-DAEMON Tue May 01 17:23:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPKXj-0002wa-QJ
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 17:23:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43901)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPKXh-0002vd-4z
	for coreutils@gnu.org; Tue, 01 May 2012 17:23:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPKXf-0004cj-3A
	for coreutils@gnu.org; Tue, 01 May 2012 17:23:28 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:49112)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruce.korb@gmail.com>) id 1SPKXe-0004cM-TK
	for coreutils@gnu.org; Tue, 01 May 2012 17:23:27 -0400
Received: by yenm8 with SMTP id m8so2777842yen.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 14:23:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:content-transfer-encoding;
	bh=/nukTsxHw8EL/AgBkgywlMpmgtUhWYlKVlnKf1R7NP8=;
	b=bEkrfM2lHkIgS3PNUeMM2lOl647cbASl9rhrpM5ooGGtPANBNqHrje9+gQZu0dqrIG
	DiQjaCs4GVt0vreOoErxcNQF450Q9AfBcRAfI5b9+YO9Y26UIBBygyGsBIkNzwquMXWK
	6vzwIsA15jqobLklfXH9ekfTdbz/VvrXxInDBa67m82qyqZHS5lxijCrG7W3ZSXM7jWG
	iQ+lAwCB/PNWoxcSnsHARGxJdwbc/rNQyJyaLcagFayAxGAlVCHYkZJl5yAvl0HRli6c
	MJWGdH8smK4CLXNcWd4vpbWABoiCbVMfEYBGLS1dn8z6No3cRqJL9s3X7/jpOZINuQ9/
	b6zA==
Received: by 10.50.41.196 with SMTP id h4mr3101711igl.33.1335907405177; Tue,
	01 May 2012 14:23:25 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.43.51.193 with HTTP; Tue, 1 May 2012 14:23:04 -0700 (PDT)
In-Reply-To: <4FA05296.30003@draigBrady.com>
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com> <4F9F9C08.8040407@draigBrady.com>
	<CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
	<4FA01656.9010902@draigBrady.com> <4FA05296.30003@draigBrady.com>
From: Bruce Korb <bruce.korb@gmail.com>
Date: Tue, 1 May 2012 14:23:04 -0700
Message-ID: <CAKRnqNK7n8s7YxJAXT03B4fMwiUj3DZeOoDkCwGscUWq8-LVRw@mail.gmail.com>
Subject: Re: Another rfe: "cp" this time
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigbrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.169
Cc: coreutils@gnu.org, "H. Peter Anvin" <hpa@zytor.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 21:23:30 -0000

On Tue, May 1, 2012 at 2:16 PM, P=E1draig Brady <P@draigbrady.com> wrote:
> The attached seems to give another 5% speedup!

That would save a half hour on my 10 hour copy!
(Obviously not the final answer for my trans-oceanic mount,
but every bit helps.  Actually, I've convinced our IT to mirror
the data to parallel file systems.  That is faster access than
even my parallel copy solution. ;)

Cheers - Bruce


From MAILER-DAEMON Tue May 01 20:35:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPNXH-00036d-LN
	for mharc-coreutils@gnu.org; Tue, 01 May 2012 20:35:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37821)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SPNXE-00036X-Uj
	for coreutils@gnu.org; Tue, 01 May 2012 20:35:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SPNXC-0002Ga-Dx
	for coreutils@gnu.org; Tue, 01 May 2012 20:35:11 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:40201)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SPNXC-0002Fm-6C
	for coreutils@gnu.org; Tue, 01 May 2012 20:35:10 -0400
Received: by obbwd18 with SMTP id wd18so191753obb.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 17:35:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=+t5kMY9RezpNF7dFhXcujtVZFkE0m8fgbhZoA3f2tc4=;
	b=v1+LQS7WmQL2fl5Y6BeABWnPmiivkywFRmrVY2D1hzkeaLjtVRpzeMuWAuZz1PYI52
	cb1zD6Wuehlk1TZqUqu25K9A/xmCbapf4brdbtIjMRHoh/YAPQKvBsQ1RVOXFtcDR2qG
	siM8bq08hpu1/MzhmUoME7IsStu3HKGGcALJh3pZKrR4PW4ZWgirsit91SlLcF2WfW8v
	nQUCIfltDzfvyHmOHy7CwcXCROjr5gkq/XJzEziWkzkUJbkFi8snq9cxCtxnDrDwOcrY
	Y/DiSKH1sSjEpPFKEFlqCmjPaq6000ZcsICe1h9TLbfW9BqAubVPYSEDIABNjWMT83BO
	8W8A==
MIME-Version: 1.0
Received: by 10.182.188.41 with SMTP id fx9mr34238651obc.3.1335918906721; Tue,
	01 May 2012 17:35:06 -0700 (PDT)
Received: by 10.182.55.230 with HTTP; Tue, 1 May 2012 17:35:06 -0700 (PDT)
Date: Tue, 1 May 2012 19:35:06 -0500
Message-ID: <CABrM6wkRDKSA+tYDcKvWsA38W37yD9jq5qhWUU87fTr=fzYcVQ@mail.gmail.com>
Subject: Why sort is differently on different machine?
From: Peng Yu <pengyu.ut@gmail.com>
To: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 00:35:14 -0000

Hi,

'sort' behaves differently on linux and Mac OS X (see below). Does
anybody know why there is a difference and how to make them the same?

~$ uname
Linux
~$ (echo AA;echo Aa)|sort
Aa
AA
~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
~$ sort --version
sort (GNU coreutils) 8.5
Copyright (C) 2010 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 Haertel and Paul Eggert.



~$ uname
Darwin
~$ (echo AA;echo Aa)|sort
AA
Aa
~$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
~$ sort --version
sort (GNU coreutils) 8.16
Copyright (C) 2012 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 Haertel and Paul Eggert.


-- 
Regards,
Peng


From MAILER-DAEMON Wed May 02 02:44:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPTIf-0004YD-NL
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 02:44:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55952)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SPTIc-0004Y6-Ey
	for coreutils@gnu.org; Wed, 02 May 2012 02:44:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SPTIa-0002j0-VR
	for coreutils@gnu.org; Wed, 02 May 2012 02:44:30 -0400
Received: from mail-gy0-f169.google.com ([209.85.160.169]:54165)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SPTIa-0002id-Oi
	for coreutils@gnu.org; Wed, 02 May 2012 02:44:28 -0400
Received: by ghrr18 with SMTP id r18so379999ghr.0
	for <coreutils@gnu.org>; Tue, 01 May 2012 23:44:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:from:date:message-id:subject:to:content-type;
	bh=uhKfVrMIgZTlQ+A5gUvjRa1J2az3eYnfVINFJQg6onw=;
	b=PqIVbUjiyDceQRBRYCma0r0ar2KJjalRvU9DvwTzFc+1z34pIiwjmxUgxuJJF57O1G
	oOzdnsj4HkWnzbg7XZmDlW8KOrZy6RlCSllEaBV4RdKMXUi0s5MkCmyacVAm3k+K2oIT
	xP79yob3VLMDRF0Iw31rLumjaqiWx0D9P8rFV+f4xgG0mGd9+b9jROdVJGNCGyP3RyE4
	Ks4sOJUGEnNtv/qEXbjMw4afSvpDFZoFx3hLVQws8eZGf0j91X29W5hn3QX7wUKb60WU
	1znnlItshEnRiNgbo9BfGGCloxU643yowM/rD/xdvkQuLgicOFMDpsAXpDA8LU3qrP6+
	0s+Q==
Received: by 10.236.182.131 with SMTP id o3mr29400453yhm.113.1335941066156;
	Tue, 01 May 2012 23:44:26 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.6.13 with HTTP; Tue, 1 May 2012 23:44:10 -0700 (PDT)
From: "aristidesfl@gmail.com" <aristidesfl@gmail.com>
Date: Wed, 2 May 2012 07:44:10 +0100
Message-ID: <CAKQfvSkRAomoX7a1E6KMA5Lo5cyYmyWKX68Mn+9GG-deygMg1w@mail.gmail.com>
Subject: Enhacement Request: ls --sort=class (group entries according to the
	indicators appended by -F/--classify)
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: 209.85.160.169
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 06:44:31 -0000

Would be useful, for readability purposes, to be able sort entries
according the indicators appended by -F/--classify.
A WORD called class could be added to "--sort" for this purpose.

In addition to that, it would be useful to have an option which forced
the extra entries printed by -a/-A, to be displayed after the rest of
the normal entries, and be sorted separately from them.


>From the man entry:
```
-F, --classify
             append indicator (one of */=>@|) to entries
```


Cheers,
aristidesfl


From MAILER-DAEMON Wed May 02 03:30:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPU1H-00056D-Ug
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 03:30:39 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52055)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPU1B-00055x-0C
	for coreutils@gnu.org; Wed, 02 May 2012 03:30:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPU18-0003ft-Lq
	for coreutils@gnu.org; Wed, 02 May 2012 03:30:32 -0400
Received: from mx.meyering.net ([88.168.87.75]:38390)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPU18-0003fo-A2
	for coreutils@gnu.org; Wed, 02 May 2012 03:30:30 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 92D39600AE;
	Wed,  2 May 2012 09:30:28 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: Another rfe: "cp" this time
In-Reply-To: <4FA05296.30003@draigBrady.com> (=?iso-8859-1?Q?=22P=E1draig?=
	Brady"'s message of "Tue, 01 May 2012 22:16:06 +0100")
References: <4F9AAE09.1010904@gmail.com> <4F9ABCD8.1070009@draigBrady.com>
	<4F9F635E.6070908@zytor.com> <4F9F9C08.8040407@draigBrady.com>
	<CAKRnqN+GwG0AMPyh5+d3ea8i1sOr1q_aQCrwhDLE267C476Rpw@mail.gmail.com>
	<4FA01656.9010902@draigBrady.com> <4FA05296.30003@draigBrady.com>
Date: Wed, 02 May 2012 09:30:28 +0200
Message-ID: <87r4v3rqej.fsf@rho.meyering.net>
Lines: 103
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Bruce Korb <bruce.korb@gmail.com>, coreutils@gnu.org,
	"H. Peter Anvin" <hpa@zytor.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 07:30:39 -0000

P=E1draig Brady wrote:
> On 05/01/2012 05:59 PM, P=E1draig Brady wrote:
>> Now many coreutils already provide such a hint to the kernel:
>> http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommit;h=3D47076e3c
>> But copy.c does not currently. I'm not sure why I didn't
>> do it for copy.c now, but I look into adding it.
>
> The attached seems to give another 5% speedup!
>
> $ dd bs=3D1MB count=3D200 if=3D/dev/zero of=3Dfile.in
>
> $ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
> $ time ./cp-before file.in /dev/shm/; rm /dev/shm/file.in
> real    0m0.843s
> user    0m0.005s
> sys     0m0.417s
> $ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
> $ time ./cp-before file.in /dev/shm/; rm /dev/shm/file.in
> real    0m0.856s
> user    0m0.002s
> sys     0m0.422s
>
> $ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
> $ time ./cp-after file.in /dev/shm/; rm /dev/shm/file.in
> real    0m0.809s
> user    0m0.006s
> sys     0m0.373s
> $ dd of=3Dfile.in oflag=3Dnocache conv=3Dnotrunc,fdatasync count=3D0
> $ time ./cp-after file.in /dev/shm/; rm /dev/shm/file.in
> real    0m0.804s
> user    0m0.007s
> sys     0m0.405s

Nice.  YMMV.
I see no change with a 200MB input (Fedora 17 desktop, ext4, SSD)

$ dd bs=3D1MB count=3D200 if=3D/dev/zero of=3Dk
200+0 records in
200+0 records out
200000000 bytes (200 MB) copied, 0.663342 s, 302 MB/s

# Old cp
$ for i in $(seq 5); do dd of=3Dk oflag=3Dnocache conv=3Dnotrunc,fdatasync =
count=3D0 2>/dev/null; env time --format=3D%e /p/bin/cp k /dev/shm; Rm -rf =
/dev/shm/k; done
0.55
0.55
0.55
0.56
0.55

# cp with FADVISE_SEQUENTIAL
$ for i in $(seq 5); do dd of=3Dk oflag=3Dnocache conv=3Dnotrunc,fdatasync =
count=3D0 2>/dev/null; env time --format=3D%e /cu/src/cp k /dev/shm; Rm -rf=
 /dev/shm/k; done
0.55
0.55
0.55
0.55
0.55

=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
But with a 2000MiB input, I do see a 2% speedup:

$ dd bs=3D1MB count=3D2000 if=3D/dev/zero of=3Dk
2000+0 records in
2000+0 records out
2000000000 bytes (2.0 GB) copied, 10.0025 s, 200 MB/s

$ for i in $(seq 5); do dd of=3Dk oflag=3Dnocache conv=3Dnotrunc,fdatasync =
count=3D0 2>/dev/null; env time --format=3D%e /usr/bin/cp k /dev/shm; Rm -r=
f /dev/shm/k; done
5.56
5.56
5.56
5.56
5.56

$ for i in $(seq 5); do dd of=3Dk oflag=3Dnocache conv=3Dnotrunc,fdatasync =
count=3D0 2>/dev/null; env time --format=3D%e /cu/src/cp k /dev/shm; Rm -rf=
 /dev/shm/k; done
5.46
5.42
5.45
5.44
5.45

=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
Using an older, much-used SSD on a nearly-full partition, I see a 7% speedu=
p.
(It didn't have 2GiB free, so this uses an input that's half the size of the
one above, so at ~half the speed, each duration is in the same range.
Also, note the initial write speed is 50MB/s vs 200/300MB/s above)

$ dd bs=3D1MB count=3D1000 if=3D/dev/zero of=3Dk
1000+0 records in
1000+0 records out
1000000000 bytes (1.0 GB) copied, 20.7219 s, 48.3 MB/s
$ for i in $(seq 5); do dd of=3Dk oflag=3Dnocache conv=3Dnotrunc,fdatasync =
count=3D0 2>/dev/null; env time --format=3D%e /p/bin/cp k /dev/shm; Rm -rf =
/dev/shm/k; done
5.39
5.39
5.38
5.39
5.39
$ for i in $(seq 5); do dd of=3Dk oflag=3Dnocache conv=3Dnotrunc,fdatasync =
count=3D0 2>/dev/null; env time --format=3D%e /cu/src/cp k /dev/shm; Rm -rf=
 /dev/shm/k; done
5.01
4.99
5.00
4.99
4.97

=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


From MAILER-DAEMON Wed May 02 04:35:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPV2Q-0007MP-L6
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 04:35:54 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38218)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPV2J-0007Kn-OM
	for coreutils@gnu.org; Wed, 02 May 2012 04:35:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPV2C-00034W-7P
	for coreutils@gnu.org; Wed, 02 May 2012 04:35:47 -0400
Received: from mx.meyering.net ([88.168.87.75]:38579)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPV2B-00034A-At
	for coreutils@gnu.org; Wed, 02 May 2012 04:35:40 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id CE666600E3;
	Wed,  2 May 2012 10:35:36 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH 3/3] maint: prohibit an operator at end of line
In-Reply-To: <4F9EA1E0.2010805@redhat.com> (Eric Blake's message of "Mon, 30
	Apr 2012 08:29:52 -0600")
References: <878vhdz7ss.fsf@rho.meyering.net> <4F9EA0D6.1040800@redhat.com>
	<4F9EA1E0.2010805@redhat.com>
Date: Wed, 02 May 2012 10:35:36 +0200
Message-ID: <87fwbjrndz.fsf@rho.meyering.net>
Lines: 443
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:35:53 -0000

Eric Blake wrote:
> On 04/30/2012 08:25 AM, Eric Blake wrote:
>> On 04/30/2012 07:08 AM, Jim Meyering wrote:
>>> Here's a new syntax-check rule (patch 3/3).
>>> 1 and 2 fix violations so that the new check passes.
>>>
>>> For now, this is only in coreutils (grep had only two violations),
>>> but given the long list of violations in gnulib's lib/ directory,
>>> it may not be generally appealing enough to be added to gnulib's maint.mk:
>>>
>>>     $ git grep -lE '(. [-/+]|&&|\|\|)$' lib
>>
>> Is it worth adding some more operators, such as *, ^, &, and |?
>>
>> (. [-/+*^]|&&?|\|\|?)$
>
> Also <<, >>, ==, !=, and for that matter, all of the op= operators:
>
> (. [-/+*^=!<>]=?|&&?|\|\|?|<<=?|>>=?)$

Good point.
Here's a more complete patch that also makes the
regular expression overridable.

I'm still omitting "*" and "=" from the default.

>From b8a6996e258a2c30de40fb20cab0d17a38c3eff2 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 1 Jan 2012 01:46:34 +0100
Subject: [PATCH 1/3] maint: with split lines, don't leave an operator at end
 of line

* src/copy.c (copy_reg): Split an expression before a binary operator,
not after it.
* src/cut.c (set_fields): Likewise.
* src/id.c (main): Likewise.
* src/install.c (setdefaultfilecon): Likewise.
* src/join.c (ignore_case): Likewise.
* src/pr.c (cols_ready_to_print, init_parameters, print_page): Likewise.
* src/stty.c (set_window_size): Likewise.
* src/wc.c (SUPPORT_OLD_MBRTOWC): Likewise.
* src/who.c (scan_entries): Likewise.
* src/test.c (binary_operator): Join a split line.
* src/extent-scan.c (extent_scan_read): Move an ">" from end of line
to beginning of the following.
Likewise for two other expressions.
---
 src/copy.c        |    4 ++--
 src/cut.c         |    4 ++--
 src/extent-scan.c |   12 ++++++------
 src/id.c          |    4 ++--
 src/install.c     |    4 ++--
 src/join.c        |    2 +-
 src/pr.c          |   22 +++++++++++-----------
 src/stty.c        |    4 ++--
 src/test.c        |    4 ++--
 src/wc.c          |    2 +-
 src/who.c         |    6 +++---
 11 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/copy.c b/src/copy.c
index 414fbe0..26bbcf2 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1055,8 +1055,8 @@ copy_reg (char const *src_name, char const *dst_name,
                           make_holes, src_name, dst_name,
                           UINTMAX_MAX, &n_read,
                           &wrote_hole_at_eof)
-           || (wrote_hole_at_eof &&
-               ftruncate (dest_desc, n_read) < 0))
+           || (wrote_hole_at_eof
+               && ftruncate (dest_desc, n_read) < 0))
         {
           error (0, errno, _("failed to extend %s"), quote (dst_name));
           return_val = false;
diff --git a/src/cut.c b/src/cut.c
index fed9616..87380ac 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -372,8 +372,8 @@ set_fields (const char *fieldstr)
           initial = (lhs_specified ? value : 1);
           value = 0;
         }
-      else if (*fieldstr == ',' ||
-               isblank (to_uchar (*fieldstr)) || *fieldstr == '\0')
+      else if (*fieldstr == ','
+               || isblank (to_uchar (*fieldstr)) || *fieldstr == '\0')
         {
           in_digits = false;
           /* Ending the string, or this field/byte sublist. */
diff --git a/src/extent-scan.c b/src/extent-scan.c
index e269f54..0c25c57 100644
--- a/src/extent-scan.c
+++ b/src/extent-scan.c
@@ -133,11 +133,11 @@ extent_scan_read (struct extent_scan *scan)
       unsigned int i = 0;
       for (i = 0; i < fiemap->fm_mapped_extents; i++)
         {
-          assert (fm_extents[i].fe_logical <=
-                  OFF_T_MAX - fm_extents[i].fe_length);
+          assert (fm_extents[i].fe_logical
+                  <= OFF_T_MAX - fm_extents[i].fe_length);

-          if (si && last_ei->ext_flags ==
-              (fm_extents[i].fe_flags & ~FIEMAP_EXTENT_LAST)
+          if (si && last_ei->ext_flags
+              == (fm_extents[i].fe_flags & ~FIEMAP_EXTENT_LAST)
               && (last_ei->ext_logical + last_ei->ext_length
                   == fm_extents[i].fe_logical))
             {
@@ -147,8 +147,8 @@ extent_scan_read (struct extent_scan *scan)
               last_ei->ext_flags = fm_extents[i].fe_flags;
             }
           else if ((si == 0 && scan->scan_start > fm_extents[i].fe_logical)
-                   || (si && last_ei->ext_logical + last_ei->ext_length >
-                       fm_extents[i].fe_logical))
+                   || (si && (last_ei->ext_logical + last_ei->ext_length
+                              > fm_extents[i].fe_logical)))
             {
               /* BTRFS before 2.6.38 could return overlapping extents
                  for sparse files.  We adjust the returned extents
diff --git a/src/id.c b/src/id.c
index 158715e..41ae024 100644
--- a/src/id.c
+++ b/src/id.c
@@ -191,8 +191,8 @@ main (int argc, char **argv)
      invalid value that will be not displayed in print_full_info().  */
   if (selinux_enabled
       && n_ids == 0
-      && (just_context ||
-          (default_format && ! getenv ("POSIXLY_CORRECT"))))
+      && (just_context
+          || (default_format && ! getenv ("POSIXLY_CORRECT"))))
     {
       /* Report failure only if --context (-Z) was explicitly requested.  */
       if (getcon (&context) && just_context)
diff --git a/src/install.c b/src/install.c
index 5468d26..854436a 100644
--- a/src/install.c
+++ b/src/install.c
@@ -359,8 +359,8 @@ setdefaultfilecon (char const *file)

   /* If there's an error determining the context, or it has none,
      return to allow default context */
-  if ((matchpathcon (file, st.st_mode, &scontext) != 0) ||
-      STREQ (scontext, "<<none>>"))
+  if ((matchpathcon (file, st.st_mode, &scontext) != 0)
+      || STREQ (scontext, "<<none>>"))
     {
       if (scontext != NULL)
         freecon (scontext);
diff --git a/src/join.c b/src/join.c
index b92c1f8..e39ed87 100644
--- a/src/join.c
+++ b/src/join.c
@@ -173,7 +173,7 @@ static struct line uni_blank;
 /* If nonzero, ignore case when comparing join fields.  */
 static bool ignore_case;

-/* If nonzero, treat the first line of each file as column headers -
+/* If nonzero, treat the first line of each file as column headers --
    join them without checking for ordering */
 static bool join_header_lines;

diff --git a/src/pr.c b/src/pr.c
index f1e310f..2ea586d 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -781,9 +781,9 @@ cols_ready_to_print (void)

   n = 0;
   for (q = column_vector, i = 0; i < columns; ++q, ++i)
-    if (q->status == OPEN ||
-        q->status == FF_FOUND ||	/* With -b: To print a header only */
-        (storing_columns && q->lines_stored > 0 && q->lines_to_print > 0))
+    if (q->status == OPEN
+        || q->status == FF_FOUND	/* With -b: To print a header only */
+        || (storing_columns && q->lines_stored > 0 && q->lines_to_print > 0))
       ++n;
   return n;
 }
@@ -1275,13 +1275,13 @@ init_parameters (int number_of_files)

       /* To allow input tab-expansion (-e sensitive) use:
          if (number_separator == input_tab_char)
-           number_width = chars_per_number +
-             TAB_WIDTH (chars_per_input_tab, chars_per_number);   */
+           number_width = chars_per_number
+             + TAB_WIDTH (chars_per_input_tab, chars_per_number);   */

       /* Estimate chars_per_text without any margin and keep it constant. */
       if (number_separator == '\t')
-        number_width = chars_per_number +
-          TAB_WIDTH (chars_per_default_tab, chars_per_number);
+        number_width = (chars_per_number
+                        + TAB_WIDTH (chars_per_default_tab, chars_per_number));
       else
         number_width = chars_per_number + 1;

@@ -1297,8 +1297,8 @@ init_parameters (int number_of_files)
         power_10 = 10 * power_10;
     }

-  chars_per_column = (chars_per_line - chars_used_by_number -
-                     (columns - 1) * col_sep_length) / columns;
+  chars_per_column = (chars_per_line - chars_used_by_number
+                      - (columns - 1) * col_sep_length) / columns;

   if (chars_per_column < 1)
     error (EXIT_FAILURE, 0, _("page width too narrow"));
@@ -1836,8 +1836,8 @@ print_page (void)
                 {
                   if (empty_line)
                     align_empty_cols = true;
-                  else if (p->status == CLOSED ||
-                           (p->status == ON_HOLD && FF_only))
+                  else if (p->status == CLOSED
+                           || (p->status == ON_HOLD && FF_only))
                     align_column (p);
                 }
             }
diff --git a/src/stty.c b/src/stty.c
index 8e36593..eb07f85 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -1344,8 +1344,8 @@ set_window_size (int rows, int cols, char const *device_name)
      it's almost certainly a "struct winsize" instead.

      At any rate, the bug manifests itself when ws_row == 0; the symptom is
-     that ws_row is set to ws_col, and ws_col is set to (ws_xpixel<<16) +
-     ws_ypixel.  Since GNU stty sets rows and columns separately, this bug
+     that ws_row is set to ws_col, and ws_col is set to (ws_xpixel<<16)
+     + ws_ypixel.  Since GNU stty sets rows and columns separately, this bug
      caused "stty rows 0 cols 0" to set rows to cols and cols to 0, while
      "stty cols 0 rows 0" would do the right thing.  On a little-endian
      machine like the sun386i, the problem is the same, but for ws_col == 0.
diff --git a/src/test.c b/src/test.c
index 2d562d9..31a6420 100644
--- a/src/test.c
+++ b/src/test.c
@@ -367,8 +367,8 @@ binary_operator (bool l_is_l)
       test_syntax_error (_("unknown binary operator"), argv[op]);
     }

-  if (argv[op][0] == '=' && (!argv[op][1] ||
-       ((argv[op][1] == '=') && !argv[op][2])))
+  if (argv[op][0] == '='
+      && (!argv[op][1] || ((argv[op][1] == '=') && !argv[op][2])))
     {
       bool value = STREQ (argv[pos], argv[pos + 2]);
       pos += 3;
diff --git a/src/wc.c b/src/wc.c
index 1b8a7a4..5017377 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -292,7 +292,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus)
       /* Back-up the state before each multibyte character conversion and
          move the last incomplete character of the buffer to the front
          of the buffer.  This is needed because we don't know whether
-         the 'mbrtowc' function updates the state when it returns -2, -
+         the 'mbrtowc' function updates the state when it returns -2, --
          this is the ISO C 99 and glibc-2.2 behaviour - or not - amended
          ANSI C, glibc-2.1 and Solaris 5.7 behaviour.  We don't have an
          autoconf test for this, yet.  */
diff --git a/src/who.c b/src/who.c
index 84c68d7..c875b1d 100644
--- a/src/who.c
+++ b/src/who.c
@@ -590,9 +590,9 @@ scan_entries (size_t n, const STRUCT_UTMP *utmp_buf)

   while (n--)
     {
-      if (!my_line_only ||
-          strncmp (ttyname_b, utmp_buf->ut_line,
-                   sizeof (utmp_buf->ut_line)) == 0)
+      if (!my_line_only
+          || strncmp (ttyname_b, utmp_buf->ut_line,
+                      sizeof (utmp_buf->ut_line)) == 0)
         {
           if (need_users && IS_USER_PROCESS (utmp_buf))
             print_user (utmp_buf, boottime);
--
1.7.10.420.g9768c


>From 57e0a882ef70712f79e7255aa5c1f8ba27b4c33e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 30 Apr 2012 10:55:18 +0200
Subject: [PATCH 2/3] maint: adjust comments to avoid FP match on
 binary-operator-at-EOL

* src/ls.c (print_long_format): Reformat comment to avoid "=="
at end of line.
Also, "sortkey" is not a word: s/sortkey/sort key/.
* src/ioblksize.h: Likewise, for "|" from a shell snippet.
* src/runcon.c: Likewise, for "|" in grammar-like usage.
---
 src/ioblksize.h |    4 ++--
 src/ls.c        |   20 ++++++++++----------
 src/runcon.c    |    6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/ioblksize.h b/src/ioblksize.h
index ffd6ff3..aaea9ff 100644
--- a/src/ioblksize.h
+++ b/src/ioblksize.h
@@ -28,8 +28,8 @@
      bs=$((1024*2**$i))
      printf "%7s=" $bs
      timeout --foreground -sINT 2 \
-       dd bs=$bs if=/dev/zero of=/dev/null 2>&1 |
-        sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
+       dd bs=$bs if=/dev/zero of=/dev/null 2>&1 \
+         | sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
    done

    With the results shown for these systems:
diff --git a/src/ls.c b/src/ls.c
index 800f813..397e4ea 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3443,13 +3443,13 @@ static int rev_xstrcoll_df_version (V a, V b)
 { DIRFIRST_CHECK (a, b); return cmp_version (b, a); }


-/* We have 2^3 different variants for each sortkey function
+/* We have 2^3 different variants for each sort-key function
    (for 3 independent sort modes).
    The function pointers stored in this array must be dereferenced as:

     sort_variants[sort_key][use_strcmp][reverse][dirs_first]

-   Note that the order in which sortkeys are listed in the function pointer
+   Note that the order in which sort keys are listed in the function pointer
    array below is defined by the order of the elements in the time_type and
    sort_type enums!  */

@@ -3493,14 +3493,14 @@ static qsortFunc const sort_functions[][2][2][2] =
     LIST_SORTFUNCTION_VARIANTS (atime)
   };

-/* The number of sortkeys is calculated as
-     the number of elements in the sort_type enum (i.e. sort_numtypes) +
+/* The number of sort keys is calculated as the sum of
+     the number of elements in the sort_type enum (i.e. sort_numtypes)
      the number of elements in the time_type enum (i.e. time_numtypes) - 1
    This is because when sort_type==sort_time, we have up to
-   time_numtypes possible sortkeys.
+   time_numtypes possible sort keys.

    This line verifies at compile-time that the array of sort functions has been
-   initialized for all possible sortkeys. */
+   initialized for all possible sort keys. */
 verify (ARRAY_CARDINALITY (sort_functions)
         == sort_numtypes + time_numtypes - 1 );

@@ -3918,10 +3918,10 @@ print_long_format (const struct fileinfo *f)
           gettime (&current_time);
         }

-      /* Consider a time to be recent if it is within the past six
-         months.  A Gregorian year has 365.2425 * 24 * 60 * 60 ==
-         31556952 seconds on the average.  Write this value as an
-         integer constant to avoid floating point hassles.  */
+      /* Consider a time to be recent if it is within the past six months.
+         A Gregorian year has 365.2425 * 24 * 60 * 60 == 31556952 seconds
+         on the average.  Write this value as an integer constant to
+         avoid floating point hassles.  */
       six_months_ago.tv_sec = current_time.tv_sec - 31556952 / 2;
       six_months_ago.tv_nsec = current_time.tv_nsec;

diff --git a/src/runcon.c b/src/runcon.c
index 29bf0e5..875441f 100644
--- a/src/runcon.c
+++ b/src/runcon.c
@@ -15,9 +15,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

 /*
- * runcon [ context |
- *         ( [ -c ] [ -r role ] [-t type] [ -u user ] [ -l levelrange ] )
- *         command [arg1 [arg2 ...] ]
+ * runcon [ context
+ *          | ( [ -c ] [ -r role ] [-t type] [ -u user ] [ -l levelrange ] )
+ *          command [arg1 [arg2 ...] ]
  *
  * attempt to run the specified command with the specified context.
  *
--
1.7.10.420.g9768c


>From e744f4b7b7de9b76fdd314aa406e9fb150b9168d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 30 Apr 2012 10:37:14 +0200
Subject: [PATCH 3/3] maint: prohibit an operator at end of line

Many coding standards, including GNU's, advocate that when
splitting a line near a binary operator, one should put the
operator at the beginning of the continued line, rather than
at the end of the preceding one.  This is for readability:
such operators are relatively important to readability, and
they are more apparent at the beginning of a line than
at the varying-column end of line,
* cfg.mk (sc_prohibit_operator_at_end_of_line): New rule.
Exempt test.c and head.c.
---
 cfg.mk |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index c3ddb42..923785e 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -200,6 +200,18 @@ sc_no_exec_perl_coreutils:
 	      exit 1; } || :;						\
 	fi

+# With split lines, don't leave an operator at end of line.
+# Instead, put it on the following line, where it is more apparent.
+# Don't bother checking for "*" at end of line, since it provokes
+# far too many false positives, matching constructs like "TYPE *".
+# Similarly, omit "=" (initializers).
+binop_re_ ?= [-/+^!<>]|[-/+*^!<>=]=|&&?|\|\|?|<<=?|>>=?
+sc_prohibit_operator_at_end_of_line:
+	@prohibit='. ($(binop_re_))$$'					\
+	in_vc_files='\.[chly]$$'					\
+	halt='found operator at end of line'				\
+	  $(_sc_search_regexp)
+
 # Don't use "readlink" or "readlinkat" directly
 sc_prohibit_readlink:
 	@prohibit='\<readlink(at)? \('					\
@@ -456,3 +468,7 @@ exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \

 exclude_file_name_regexp--sc_prohibit_test_backticks = \
   ^tests/(init\.sh|check\.mk|misc/stdbuf)$$
+
+# Exempt test.c, since it's nominally shared, and relatively static.
+exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
+  ^src/(ptx|test|head)\.c$$
--
1.7.10.420.g9768c


From MAILER-DAEMON Wed May 02 04:51:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPVHL-0002NU-Ds
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 04:51:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36281)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPVHE-0002N2-1V
	for coreutils@gnu.org; Wed, 02 May 2012 04:51:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPVH5-0000XB-Tz
	for coreutils@gnu.org; Wed, 02 May 2012 04:51:11 -0400
Received: from mx1.redhat.com ([209.132.183.28]:29848)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPVH5-0000Wr-MG
	for coreutils@gnu.org; Wed, 02 May 2012 04:51:03 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q428p2lC002168
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 2 May 2012 04:51:02 -0400
Received: from [10.36.116.73] (ovpn-116-73.ams2.redhat.com [10.36.116.73])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q428oxlq014641
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 2 May 2012 04:51:01 -0400
Message-ID: <4FA0F573.4050509@draigBrady.com>
Date: Wed, 02 May 2012 09:50:59 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH 3/3] maint: prohibit an operator at end of line
References: <878vhdz7ss.fsf@rho.meyering.net> <4F9EA0D6.1040800@redhat.com>
	<4F9EA1E0.2010805@redhat.com> <87fwbjrndz.fsf@rho.meyering.net>
In-Reply-To: <87fwbjrndz.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q428p2lC002168
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:51:17 -0000

On 05/02/2012 09:35 AM, Jim Meyering wrote:
> Eric Blake wrote:
>> On 04/30/2012 08:25 AM, Eric Blake wrote:
>>> On 04/30/2012 07:08 AM, Jim Meyering wrote:
>>>> Here's a new syntax-check rule (patch 3/3).
>>>> 1 and 2 fix violations so that the new check passes.
>>>>
>>>> For now, this is only in coreutils (grep had only two violations),
>>>> but given the long list of violations in gnulib's lib/ directory,
>>>> it may not be generally appealing enough to be added to gnulib's mai=
nt.mk:
>>>>
>>>>     $ git grep -lE '(. [-/+]|&&|\|\|)$' lib
>>>
>>> Is it worth adding some more operators, such as *, ^, &, and |?
>>>
>>> (. [-/+*^]|&&?|\|\|?)$
>>
>> Also <<, >>, =3D=3D, !=3D, and for that matter, all of the op=3D opera=
tors:
>>
>> (. [-/+*^=3D!<>]=3D?|&&?|\|\|?|<<=3D?|>>=3D?)$
>=20
> Good point.
> Here's a more complete patch that also makes the
> regular expression overridable.

I like this as it makes the code more consistent.

> diff --git a/src/ioblksize.h b/src/ioblksize.h
> index ffd6ff3..aaea9ff 100644
> --- a/src/ioblksize.h
> +++ b/src/ioblksize.h
> @@ -28,8 +28,8 @@
>       bs=3D$((1024*2**$i))
>       printf "%7s=3D" $bs
>       timeout --foreground -sINT 2 \
> -       dd bs=3D$bs if=3D/dev/zero of=3D/dev/null 2>&1 |
> -        sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
> +       dd bs=3D$bs if=3D/dev/zero of=3D/dev/null 2>&1 \
> +         | sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
>     done

Generally I dislike line continuation chars,
especially when they're not needed as is the
case with the shell construct above.
But I agree with this change as it's just in a comment,
and simplifies the syntax check.

lgtm,
P=E1draig.


From MAILER-DAEMON Wed May 02 05:37:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPW0L-0003hr-EX
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 05:37:49 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50011)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ldv@altlinux.org>) id 1SPW0D-0003hQ-Fw
	for coreutils@gnu.org; Wed, 02 May 2012 05:37:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ldv@altlinux.org>) id 1SPW08-0008ET-Ra
	for coreutils@gnu.org; Wed, 02 May 2012 05:37:41 -0400
Received: from vint.altlinux.org ([194.107.17.35]:34744)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ldv@altlinux.org>) id 1SPW08-0008EL-Gi
	for coreutils@gnu.org; Wed, 02 May 2012 05:37:36 -0400
Received: from wo.int.altlinux.org (wo.int.altlinux.org [192.168.1.4])
	by vint.altlinux.org (Postfix) with ESMTP id 0C885226C0A6;
	Wed,  2 May 2012 09:37:34 +0000 (UTC)
Received: by wo.int.altlinux.org (Postfix, from userid 508)
	id F38433F4863A; Wed,  2 May 2012 13:37:33 +0400 (MSK)
Date: Wed, 2 May 2012 13:37:33 +0400
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: John Lane <gnu.coreutils@jelmail.com>
Subject: Re: chroot with --userspec when chrooting from x86_64 to i686
Message-ID: <20120502093733.GA32427@altlinux.org>
References: <4FA04854.6090300@jelmail.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="MGYHOYXEY6WxJCY8"
Content-Disposition: inline
In-Reply-To: <4FA04854.6090300@jelmail.com>
X-fingerprint: FE4C 93AB E19A 2E4C CB5D  3E4E 7CAB E6AC 9E35 361E
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 194.107.17.35
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 09:37:47 -0000


--MGYHOYXEY6WxJCY8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

On Tue, May 01, 2012 at 09:32:20PM +0100, John Lane wrote:
> Hello, this is my first post here, I hope this is the right place to ask=
=20
> this question. I have also asked this on Stack Exchange but I think this=
=20
> might be a more appropriate audience. I hope that's ok. I'm experencing=
=20
> a problem with chroot and I am running on Arch Linux x86_64.
>=20
> I have a 64 bit chroot and a 32 bit chroot. They are identical except=20
> that one is 32 bit and one is 64 bit.
>=20
> I can enter either of them using "chroot /path/to/chroot". No problems.
>=20
> If I want to do that as a specific user the command is "chroot=20
> --userspec=3Duser:group /path/to/chroot"
>=20
> This also works fine for the 64 bit chroot. However it fails for the 32=
=20
> bit chroot. It fails with status 125 and the message "chroot: invalid use=
r"

Looks like your 64-bit glibc failed to load 32-bit NSS plugins.
Please try this tentative patch:

diff --git a/src/chroot.c b/src/chroot.c
index dbb5c6d..195c43e 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -198,6 +198,22 @@ main (int argc, char **argv)
       usage (EXIT_CANCELED);
     }
=20
+  /* We have to call parse_user_spec twice:
+     - first time outside chroot to load potentially necessary passwd/group
+       parsing plugins (e.g. NSS);
+     - second time inside chroot to do actual parsing. */
+  if (userspec)
+    {
+      uid_t uid =3D -1;
+      gid_t gid =3D -1;
+      char *user =3D NULL;
+      char *group =3D NULL;
+
+      parse_user_spec (userspec, &uid, &gid, &user, &group);
+      free (user);
+      free (group);
+    }
+
   if (chroot (argv[optind]) !=3D 0)
     error (EXIT_CANCELED, errno, _("cannot change root directory to %s"),
            argv[optind]);

--=20
ldv

--MGYHOYXEY6WxJCY8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk+hAF0ACgkQfKvmrJ41Nh4UjACfQcx0bqHC30sV8raxToVujejc
tmAAoK9BCGkOJ9qHoVG9af8swddyNEvv
=A1EZ
-----END PGP SIGNATURE-----

--MGYHOYXEY6WxJCY8--


From MAILER-DAEMON Wed May 02 05:59:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPWL8-0001NB-L0
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 05:59:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57840)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPWL2-0001N5-8P
	for coreutils@gnu.org; Wed, 02 May 2012 05:59:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPWKy-00081c-FC
	for coreutils@gnu.org; Wed, 02 May 2012 05:59:11 -0400
Received: from mx1.redhat.com ([209.132.183.28]:20007)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPWKy-0007yd-75
	for coreutils@gnu.org; Wed, 02 May 2012 05:59:08 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q429x1BY025014
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 2 May 2012 05:59:01 -0400
Received: from [10.36.116.78] (ovpn-116-78.ams2.redhat.com [10.36.116.78])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q429wwqf017924
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 2 May 2012 05:58:59 -0400
Message-ID: <4FA10561.1040803@draigBrady.com>
Date: Wed, 02 May 2012 10:58:57 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: "Dmitry V. Levin" <ldv@altlinux.org>
Subject: Re: chroot with --userspec when chrooting from x86_64 to i686
References: <4FA04854.6090300@jelmail.com>
	<20120502093733.GA32427@altlinux.org>
In-Reply-To: <20120502093733.GA32427@altlinux.org>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q429x1BY025014
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org, John Lane <gnu.coreutils@jelmail.com>,
	norihiro@nagater.net
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 09:59:18 -0000

On 05/02/2012 10:37 AM, Dmitry V. Levin wrote:
> Hi,
>=20
> On Tue, May 01, 2012 at 09:32:20PM +0100, John Lane wrote:
>> Hello, this is my first post here, I hope this is the right place to a=
sk=20
>> this question. I have also asked this on Stack Exchange but I think th=
is=20
>> might be a more appropriate audience. I hope that's ok. I'm experencin=
g=20
>> a problem with chroot and I am running on Arch Linux x86_64.
>>
>> I have a 64 bit chroot and a 32 bit chroot. They are identical except=20
>> that one is 32 bit and one is 64 bit.
>>
>> I can enter either of them using "chroot /path/to/chroot". No problems.
>>
>> If I want to do that as a specific user the command is "chroot=20
>> --userspec=3Duser:group /path/to/chroot"
>>
>> This also works fine for the 64 bit chroot. However it fails for the 3=
2=20
>> bit chroot. It fails with status 125 and the message "chroot: invalid =
user"
>=20
> Looks like your 64-bit glibc failed to load 32-bit NSS plugins.
> Please try this tentative patch:
>=20
> diff --git a/src/chroot.c b/src/chroot.c
> index dbb5c6d..195c43e 100644
> --- a/src/chroot.c
> +++ b/src/chroot.c
> @@ -198,6 +198,22 @@ main (int argc, char **argv)
>        usage (EXIT_CANCELED);
>      }
> =20
> +  /* We have to call parse_user_spec twice:
> +     - first time outside chroot to load potentially necessary passwd/=
group
> +       parsing plugins (e.g. NSS);
> +     - second time inside chroot to do actual parsing. */
> +  if (userspec)
> +    {
> +      uid_t uid =3D -1;
> +      gid_t gid =3D -1;
> +      char *user =3D NULL;
> +      char *group =3D NULL;
> +
> +      parse_user_spec (userspec, &uid, &gid, &user, &group);
> +      free (user);
> +      free (group);
> +    }
> +
>    if (chroot (argv[optind]) !=3D 0)
>      error (EXIT_CANCELED, errno, _("cannot change root directory to %s=
"),
>             argv[optind]);

Thanks for looking at this Dmitry.

Note this very related issue/patch here:

http://lists.gnu.org/archive/html/coreutils/2011-07/msg00057.html

It might be best Dmitry to call parse_user_spec twice as you do,
but fall back to the initial uid, gid if the latter fails?

cheers,
P=E1draig.


From MAILER-DAEMON Wed May 02 07:08:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPXQZ-0005lB-Ac
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 07:08:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:32824)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ldv@altlinux.org>) id 1SPXQR-0005l5-Rr
	for coreutils@gnu.org; Wed, 02 May 2012 07:08:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ldv@altlinux.org>) id 1SPXQM-0008Sx-KR
	for coreutils@gnu.org; Wed, 02 May 2012 07:08:51 -0400
Received: from vint.altlinux.org ([194.107.17.35]:40820)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ldv@altlinux.org>) id 1SPXQM-0008SQ-8r
	for coreutils@gnu.org; Wed, 02 May 2012 07:08:46 -0400
Received: from wo.int.altlinux.org (wo.int.altlinux.org [192.168.1.4])
	by vint.altlinux.org (Postfix) with ESMTP id 743AA226C099;
	Wed,  2 May 2012 11:08:44 +0000 (UTC)
Received: by wo.int.altlinux.org (Postfix, from userid 508)
	id 68D093F4863A; Wed,  2 May 2012 15:08:44 +0400 (MSK)
Date: Wed, 2 May 2012 15:08:44 +0400
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: chroot with --userspec when chrooting from x86_64 to i686
Message-ID: <20120502110844.GB1091@altlinux.org>
References: <4FA04854.6090300@jelmail.com>
	<20120502093733.GA32427@altlinux.org>
	<4FA10561.1040803@draigBrady.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9"
Content-Disposition: inline
In-Reply-To: <4FA10561.1040803@draigBrady.com>
X-fingerprint: FE4C 93AB E19A 2E4C CB5D  3E4E 7CAB E6AC 9E35 361E
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 194.107.17.35
Cc: coreutils@gnu.org, John Lane <gnu.coreutils@jelmail.com>,
	norihiro@nagater.net
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 11:08:58 -0000


--gj572EiMnwbLXET9
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 02, 2012 at 10:58:57AM +0100, P=E1draig Brady wrote:
> On 05/02/2012 10:37 AM, Dmitry V. Levin wrote:
> > On Tue, May 01, 2012 at 09:32:20PM +0100, John Lane wrote:
> >> Hello, this is my first post here, I hope this is the right place to a=
sk=20
> >> this question. I have also asked this on Stack Exchange but I think th=
is=20
> >> might be a more appropriate audience. I hope that's ok. I'm experencin=
g=20
> >> a problem with chroot and I am running on Arch Linux x86_64.
> >>
> >> I have a 64 bit chroot and a 32 bit chroot. They are identical except=
=20
> >> that one is 32 bit and one is 64 bit.
> >>
> >> I can enter either of them using "chroot /path/to/chroot". No problems.
> >>
> >> If I want to do that as a specific user the command is "chroot=20
> >> --userspec=3Duser:group /path/to/chroot"
> >>
> >> This also works fine for the 64 bit chroot. However it fails for the 3=
2=20
> >> bit chroot. It fails with status 125 and the message "chroot: invalid =
user"
> >=20
> > Looks like your 64-bit glibc failed to load 32-bit NSS plugins.
> > Please try this tentative patch:
[...]
>=20
> Thanks for looking at this Dmitry.
>=20
> Note this very related issue/patch here:
>=20
> http://lists.gnu.org/archive/html/coreutils/2011-07/msg00057.html
>=20
> It might be best Dmitry to call parse_user_spec twice as you do,
> but fall back to the initial uid, gid if the latter fails?

The more I look at this groups/userspec feature, the less I like it,
because it gives false sense of security.  One might wrongly assume that
a command like "chroot --userspec=3Dnobody:nobody --groups=3Dnobody NEWROOT"
will not execute arbitrary code as root outside NEWROOT, but,
unfortunately, this is not the case.  Not only NEWROOT/etc/passwd may
define "nobody" as a user with uid=3D=3D0, but a malicious
NEWROOT/lib/libnss_files.so.2 may result to instant arbitrary code
execution outside NEWROOT.  The only secure use of groups/userspec now
seems to be disabled lookup, e.g. --userspec=3D+99:+99 --groups=3D+99.

=46rom this point of view, I'd suggest to make the proposed "before"
semantics a default groups/userspec behaviour as more secure, add
an option to enable currently implemented "after" semantics, and
document why "after" semantics is not secure with untrusted chroots.


--=20
ldv

--gj572EiMnwbLXET9
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk+hFbwACgkQfKvmrJ41Nh7nOwCgrstBBx+/ge4QGISxD1GPmJ+t
pPUAmwSWTtwKRsWKJJZuqJqcrhDDe1Ze
=InUq
-----END PGP SIGNATURE-----

--gj572EiMnwbLXET9--


From MAILER-DAEMON Wed May 02 07:14:57 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPXWL-0008EC-0H
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 07:14:57 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54030)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPXWI-0008Df-Dz
	for coreutils@gnu.org; Wed, 02 May 2012 07:14:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPXWG-0002yo-9Z
	for coreutils@gnu.org; Wed, 02 May 2012 07:14:53 -0400
Received: from mx.meyering.net ([88.168.87.75]:38986)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SPXWG-0002ya-2N
	for coreutils@gnu.org; Wed, 02 May 2012 07:14:52 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id D92356009F;
	Wed,  2 May 2012 13:14:48 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: [PATCH 3/3] maint: prohibit an operator at end of line
In-Reply-To: <4FA0F573.4050509@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Wed, 02 May 2012 09:50:59 +0100")
References: <878vhdz7ss.fsf@rho.meyering.net> <4F9EA0D6.1040800@redhat.com>
	<4F9EA1E0.2010805@redhat.com> <87fwbjrndz.fsf@rho.meyering.net>
	<4FA0F573.4050509@draigBrady.com>
Date: Wed, 02 May 2012 13:14:48 +0200
Message-ID: <87vckerg0n.fsf@rho.meyering.net>
Lines: 49
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 11:14:55 -0000

P=E1draig Brady wrote:
> On 05/02/2012 09:35 AM, Jim Meyering wrote:
>> Eric Blake wrote:
>>> On 04/30/2012 08:25 AM, Eric Blake wrote:
>>>> On 04/30/2012 07:08 AM, Jim Meyering wrote:
>>>>> Here's a new syntax-check rule (patch 3/3).
>>>>> 1 and 2 fix violations so that the new check passes.
>>>>>
>>>>> For now, this is only in coreutils (grep had only two violations),
>>>>> but given the long list of violations in gnulib's lib/ directory,
>>>>> it may not be generally appealing enough to be added to gnulib's main=
t.mk:
>>>>>
>>>>>     $ git grep -lE '(. [-/+]|&&|\|\|)$' lib
>>>>
>>>> Is it worth adding some more operators, such as *, ^, &, and |?
>>>>
>>>> (. [-/+*^]|&&?|\|\|?)$
>>>
>>> Also <<, >>, =3D=3D, !=3D, and for that matter, all of the op=3D operat=
ors:
>>>
>>> (. [-/+*^=3D!<>]=3D?|&&?|\|\|?|<<=3D?|>>=3D?)$
>>
>> Good point.
>> Here's a more complete patch that also makes the
>> regular expression overridable.
>
> I like this as it makes the code more consistent.
>
>> diff --git a/src/ioblksize.h b/src/ioblksize.h
>> index ffd6ff3..aaea9ff 100644
>> --- a/src/ioblksize.h
>> +++ b/src/ioblksize.h
>> @@ -28,8 +28,8 @@
>>       bs=3D$((1024*2**$i))
>>       printf "%7s=3D" $bs
>>       timeout --foreground -sINT 2 \
>> -       dd bs=3D$bs if=3D/dev/zero of=3D/dev/null 2>&1 |
>> -        sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
>> +       dd bs=3D$bs if=3D/dev/zero of=3D/dev/null 2>&1 \
>> +         | sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
>>     done
>
> Generally I dislike line continuation chars,
> especially when they're not needed as is the
> case with the shell construct above.
> But I agree with this change as it's just in a comment,
> and simplifies the syntax check.

Thanks for the review.


From MAILER-DAEMON Wed May 02 07:26:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPXhq-0001QL-7p
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 07:26:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46486)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPXhj-0001Pq-0L
	for coreutils@gnu.org; Wed, 02 May 2012 07:26:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPXhd-0006u2-R0
	for coreutils@gnu.org; Wed, 02 May 2012 07:26:42 -0400
Received: from mx1.redhat.com ([209.132.183.28]:1026)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SPXhd-0006tn-JO
	for coreutils@gnu.org; Wed, 02 May 2012 07:26:37 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q42BQXYe011490
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 2 May 2012 07:26:34 -0400
Received: from [10.36.116.78] (ovpn-116-78.ams2.redhat.com [10.36.116.78])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q42BQU2u005743
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 2 May 2012 07:26:31 -0400
Message-ID: <4FA119E5.3020801@draigBrady.com>
Date: Wed, 02 May 2012 12:26:29 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: "Dmitry V. Levin" <ldv@altlinux.org>
Subject: Re: chroot with --userspec when chrooting from x86_64 to i686
References: <4FA04854.6090300@jelmail.com>
	<20120502093733.GA32427@altlinux.org>
	<4FA10561.1040803@draigBrady.com>
	<20120502110844.GB1091@altlinux.org>
In-Reply-To: <20120502110844.GB1091@altlinux.org>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q42BQXYe011490
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org, John Lane <gnu.coreutils@jelmail.com>,
	norihiro@nagater.net
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 11:26:49 -0000

On 05/02/2012 12:08 PM, Dmitry V. Levin wrote:
> On Wed, May 02, 2012 at 10:58:57AM +0100, P=E1draig Brady wrote:
>> On 05/02/2012 10:37 AM, Dmitry V. Levin wrote:
>>> On Tue, May 01, 2012 at 09:32:20PM +0100, John Lane wrote:
>>>> Hello, this is my first post here, I hope this is the right place to=
 ask=20
>>>> this question. I have also asked this on Stack Exchange but I think =
this=20
>>>> might be a more appropriate audience. I hope that's ok. I'm experenc=
ing=20
>>>> a problem with chroot and I am running on Arch Linux x86_64.
>>>>
>>>> I have a 64 bit chroot and a 32 bit chroot. They are identical excep=
t=20
>>>> that one is 32 bit and one is 64 bit.
>>>>
>>>> I can enter either of them using "chroot /path/to/chroot". No proble=
ms.
>>>>
>>>> If I want to do that as a specific user the command is "chroot=20
>>>> --userspec=3Duser:group /path/to/chroot"
>>>>
>>>> This also works fine for the 64 bit chroot. However it fails for the=
 32=20
>>>> bit chroot. It fails with status 125 and the message "chroot: invali=
d user"
>>>
>>> Looks like your 64-bit glibc failed to load 32-bit NSS plugins.
>>> Please try this tentative patch:
> [...]
>>
>> Thanks for looking at this Dmitry.
>>
>> Note this very related issue/patch here:
>>
>> http://lists.gnu.org/archive/html/coreutils/2011-07/msg00057.html
>>
>> It might be best Dmitry to call parse_user_spec twice as you do,
>> but fall back to the initial uid, gid if the latter fails?
>=20
> The more I look at this groups/userspec feature, the less I like it,
> because it gives false sense of security.  One might wrongly assume tha=
t
> a command like "chroot --userspec=3Dnobody:nobody --groups=3Dnobody NEW=
ROOT"
> will not execute arbitrary code as root outside NEWROOT, but,
> unfortunately, this is not the case.  Not only NEWROOT/etc/passwd may
> define "nobody" as a user with uid=3D=3D0, but a malicious
> NEWROOT/lib/libnss_files.so.2 may result to instant arbitrary code
> execution outside NEWROOT.  The only secure use of groups/userspec now
> seems to be disabled lookup, e.g. --userspec=3D+99:+99 --groups=3D+99.
>=20
> From this point of view, I'd suggest to make the proposed "before"
> semantics a default groups/userspec behaviour as more secure, add
> an option to enable currently implemented "after" semantics, and
> document why "after" semantics is not secure with untrusted chroots.

I don't think there is anything secure implied, as
there is nothing secure about a chroot really.
I see your point, but I'm still inclined to give precedence
to lookups within the chroot.

cheers,
P=E1draig.


From MAILER-DAEMON Wed May 02 09:19:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPZSl-00036w-6n
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 09:19:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59253)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SPZSf-00035u-E2
	for coreutils@gnu.org; Wed, 02 May 2012 09:19:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SPZST-0003qF-Uq
	for coreutils@gnu.org; Wed, 02 May 2012 09:19:16 -0400
Received: from mx1.redhat.com ([209.132.183.28]:63039)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SPZST-0003nd-MS
	for coreutils@gnu.org; Wed, 02 May 2012 09:19:05 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q42DJ3C5014320
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 2 May 2012 09:19:03 -0400
Received: from [10.3.113.110] (ovpn-113-110.phx2.redhat.com [10.3.113.110])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q42DJ2L7014794; Wed, 2 May 2012 09:19:02 -0400
Message-ID: <4FA13446.30107@redhat.com>
Date: Wed, 02 May 2012 07:19:02 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120424 Thunderbird/12.0
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: Why sort is differently on different machine?
References: <CABrM6wkRDKSA+tYDcKvWsA38W37yD9jq5qhWUU87fTr=fzYcVQ@mail.gmail.com>
In-Reply-To: <CABrM6wkRDKSA+tYDcKvWsA38W37yD9jq5qhWUU87fTr=fzYcVQ@mail.gmail.com>
X-Enigmail-Version: 1.4.1
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigA6EC7F3B21C96B20BDDF473D"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:19:22 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigA6EC7F3B21C96B20BDDF473D
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 05/01/2012 06:35 PM, Peng Yu wrote:
> Hi,
>=20
> 'sort' behaves differently on linux and Mac OS X (see below). Does
> anybody know why there is a difference and how to make them the same?

Most likely due to a difference in the locale definitions on the two
machines, in which case 'LC_ALL=3DC sort' will make them behave the same,=

or you can define a custom locale (with localedef) that has the same
rules for both machines instead of relying on the pre-built en_US.UTF-8
locale.  See the FAQ:
https://www.gnu.org/software/coreutils/faq/#Sort-does-not-sort-in-normal-=
order_0021

>=20
> ~$ uname
> Linux
> ~$ (echo AA;echo Aa)|sort
> Aa
> AA
> ~$ locale
> LANG=3Den_US.UTF-8

> LC_COLLATE=3D"en_US.UTF-8"


>=20
> ~$ uname
> Darwin
> ~$ (echo AA;echo Aa)|sort
> AA
> Aa
> ~$ locale
> LANG=3D"en_US.UTF-8"
> LC_COLLATE=3D"en_US.UTF-8"

You are indeed using the same locale name on both machines, but since
the two machines do not have the same locale definitions (one is from
glibc, the other from BSD heritage), they are not identical definitions,
and apparently they differ on whether 'a' comes before or after 'A' in
English.

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPoTRGAAoJEKeha0olJ0NqETkH/20I2TKQpRe9bpXjrbO4jZML
BqjIO14DE4d1bdjWNvgpYLZTIJeWRZ2YTlZDgl3GlyWjnu8sZYtxzNg8Dz9Oen0C
XxaFzQIeIs+DEogEm4g9DSK+tRfBU1Uc4EIbkAlxSq67lJDNCOSqVv1PlmqStWah
Os9NwyWMmeZVCxC1YY/ekvx5pIQk1l8FxB8BYKUAKRmn5HS1Y1pWTNQdw1gOJ1gJ
SlXssF8RlI9muw35T44mk5oBZOTSUQtQM44PMo2cuoDc3YsHLVjpFBPJPnZvj3ni
fEF3dm8ZIEmPpZlDNcHzaZCzmTwIXB4cGokF8hBoFFrqWKo1Rjt7FF7ZSVwT0Kk=
=+Pnr
-----END PGP SIGNATURE-----

--------------enigA6EC7F3B21C96B20BDDF473D--


From MAILER-DAEMON Wed May 02 15:45:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SPfUP-0004iL-Fv
	for mharc-coreutils@gnu.org; Wed, 02 May 2012 15:45:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45537)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu.coreutils@jelmail.com>) id 1SPfUN-0004hX-0j
	for coreutils@gnu.org; Wed, 02 May 2012 15:45:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu.coreutils@jelmail.com>) id 1SPfUJ-0005HX-Uf
	for coreutils@gnu.org; Wed, 02 May 2012 15:45:26 -0400
Received: from avasout05.plus.net ([84.93.230.250]:54655)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu.coreutils@jelmail.com>) id 1SPfUJ-0005H4-LX
	for coreutils@gnu.org; Wed, 02 May 2012 15:45:23 -0400
Received: from [10.0.200.2] ([212.159.104.145]) by avasout05 with smtp
	id 57lL1j00138EDcL017lMZZ; Wed, 02 May 2012 20:45:21 +0100
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.0 cv=Pct9d1dd c=1 sm=1 a=LmiDhuzNXzDmzyv3sIr6Rw==:17
	a=bgZNySebihQA:10 a=ZTRierQ3SB0A:10 a=fhrNw0JBbRwA:10 a=8nJEP1OIZ-IA:10
	a=4eliFMevnjkGZ1k2A9sA:9 a=ZTH5Sn9sIFLFvaWwYTkA:7 a=wPNLvfGTeEIA:10
	a=LmiDhuzNXzDmzyv3sIr6Rw==:117
Message-ID: <4FA18ECF.7040607@jelmail.com>
Date: Wed, 02 May 2012 20:45:19 +0100
From: John Lane <gnu.coreutils@jelmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120426 Thunderbird/12.0
MIME-Version: 1.0
To: "Dmitry V. Levin" <ldv@altlinux.org>
Subject: Re: chroot with --userspec when chrooting from x86_64 to i686
References: <4FA04854.6090300@jelmail.com>
	<20120502093733.GA32427@altlinux.org>
In-Reply-To: <20120502093733.GA32427@altlinux.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 84.93.230.250
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 19:45:28 -0000

On 02/05/12 10:37, Dmitry V. Levin wrote:
> Hi,
>
> On Tue, May 01, 2012 at 09:32:20PM +0100, John Lane wrote:
>> Hello, this is my first post here, I hope this is the right place to ask
>> this question. I have also asked this on Stack Exchange but I think this
>> might be a more appropriate audience. I hope that's ok. I'm experencing
>> a problem with chroot and I am running on Arch Linux x86_64.
>>
>> I have a 64 bit chroot and a 32 bit chroot. They are identical except
>> that one is 32 bit and one is 64 bit.
>>
>> I can enter either of them using "chroot /path/to/chroot". No problems.
>>
>> If I want to do that as a specific user the command is "chroot
>> --userspec=user:group /path/to/chroot"
>>
>> This also works fine for the 64 bit chroot. However it fails for the 32
>> bit chroot. It fails with status 125 and the message "chroot: invalid user"
> Looks like your 64-bit glibc failed to load 32-bit NSS plugins.
> Please try this tentative patch:
>
> diff --git a/src/chroot.c b/src/chroot.c
> index dbb5c6d..195c43e 100644
> --- a/src/chroot.c
> +++ b/src/chroot.c
> @@ -198,6 +198,22 @@ main (int argc, char **argv)
>         usage (EXIT_CANCELED);
>       }
>
> +  /* We have to call parse_user_spec twice:
> +     - first time outside chroot to load potentially necessary passwd/group
> +       parsing plugins (e.g. NSS);
> +     - second time inside chroot to do actual parsing. */
> +  if (userspec)
> +    {
> +      uid_t uid = -1;
> +      gid_t gid = -1;
> +      char *user = NULL;
> +      char *group = NULL;
> +
> +      parse_user_spec (userspec,&uid,&gid,&user,&group);
> +      free (user);
> +      free (group);
> +    }
> +
>     if (chroot (argv[optind]) != 0)
>       error (EXIT_CANCELED, errno, _("cannot change root directory to %s"),
>              argv[optind]);
>
I have applied this patch and can confirm that it works.

Will this find its way into coreutils, if so, any idea when? meanwhile, 
I'll keep using my workaround. Many thanks for looking into this.


From MAILER-DAEMON Fri May 04 06:15:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQFXf-0008Dz-AW
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 06:15:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44604)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SQFXb-0008Dq-Op
	for coreutils@gnu.org; Fri, 04 May 2012 06:15:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SQFXZ-0004SL-L6
	for coreutils@gnu.org; Fri, 04 May 2012 06:15:11 -0400
Received: from mx.meyering.net ([88.168.87.75]:46678)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SQFXZ-0004S7-CZ
	for coreutils@gnu.org; Fri, 04 May 2012 06:15:09 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id B50176004B;
	Fri,  4 May 2012 12:15:07 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH 1/2] maint: rely on gnulib's new sys_resource module
Date: Fri, 04 May 2012 12:15:07 +0200
Message-ID: <87397gntg4.fsf@rho.meyering.net>
Lines: 101
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: 88.168.87.75
Cc: Bruno Haible <bruno@clisp.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 10:15:13 -0000

Updating to latest gnulib, I saw a new syntax-check failure:

    src/sort.c:55:#if HAVE_SYS_RESOURCE_H
    maint.mk: do not test the above HAVE_<header>_H symbol(s);
      with the corresponding gnulib module, they are always true
    make[3]: *** [sc_prohibit_always_true_header_tests] Error 1

That was due to the addition of that new module to gnulib.
It merely means that with this addition, we should no longer
be testing the HAVE_SYS_RESOURCE_H cpp conditional.
Here's the fix, then the update.

Bruno, I'm happy to confirm that config.cache did not change
(modulo the addition of ac_cv_func__fseeki64), in spite of
your many cross-compiling m4/*.m4 changes in gnulib.

>From c999133e539cd01860338bf6d0f33d825ae94490 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 4 May 2012 11:18:28 +0200
Subject: [PATCH 1/2] maint: rely on gnulib's new sys_resource module

* bootstrap.conf (gnulib_modules): Add sys_resource.
* src/sort.c: Remove #if HAVE_SYS_RESOURCE_H guard around inclusion
of <sys/resource.h> and move the inclusion "up" into the alphabetized
list of its peers.  This also avoids a failure of the
sc_prohibit_always_true_header_tests syntax-check rule.
* m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Remove sys/resource.h.
---
 bootstrap.conf  | 1 +
 m4/jm-macros.m4 | 1 -
 src/sort.c      | 4 +---
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 41b9cc2..eab6606 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -226,6 +226,7 @@ gnulib_modules="
   strtoumax
   symlink
   sys_ioctl
+  sys_resource
   sys_stat
   sys_wait
   termios
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 94cdf82..016172f 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -189,7 +189,6 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS],
     priv.h
     stropts.h
     sys/param.h
-    sys/resource.h
     sys/systeminfo.h
     syslog.h
   ])
diff --git a/src/sort.c b/src/sort.c
index 60ff415..493e7f1 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -24,6 +24,7 @@

 #include <getopt.h>
 #include <pthread.h>
+#include <sys/resource.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <signal.h>
@@ -52,9 +53,6 @@
 #include "xnanosleep.h"
 #include "xstrtol.h"

-#if HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
 #ifndef RLIMIT_DATA
 struct rlimit { size_t rlim_cur; };
 # define getrlimit(Resource, Rlp) (-1)
--
1.7.10.1.456.g16798d0


>From bdc99991d3fea883de7b2d0262e4f3e467930ce6 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 4 May 2012 11:02:59 +0200
Subject: [PATCH 2/2] build: update gnulib submodule to latest

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

diff --git a/gnulib b/gnulib
index d4cecf1..639607d 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit d4cecf1ee37f6b611ef092c9c7fa3761d02ce2c3
+Subproject commit 639607db00b96f33b0e18afa27188456c6ccad0a
--
1.7.10.1.456.g16798d0


From MAILER-DAEMON Fri May 04 09:56:47 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQJ03-00012M-RE
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 09:56:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36545)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQIzx-00011Z-OT
	for coreutils@gnu.org; Fri, 04 May 2012 09:56:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQIzt-000864-CU
	for coreutils@gnu.org; Fri, 04 May 2012 09:56:41 -0400
Received: from mx1.redhat.com ([209.132.183.28]:34146)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQIzt-00085p-4C
	for coreutils@gnu.org; Fri, 04 May 2012 09:56:37 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q44DuXsc013170
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 4 May 2012 09:56:33 -0400
Received: from [10.36.116.63] (ovpn-116-63.ams2.redhat.com [10.36.116.63])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q44DuUrZ021559
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Fri, 4 May 2012 09:56:32 -0400
Message-ID: <4FA3E00E.1040405@draigBrady.com>
Date: Fri, 04 May 2012 14:56:30 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: "goodman.m.w@gmail.com" <goodman.m.w@gmail.com>
Subject: Re: join more than two files
References: <CAGXBFApfF_XsbwSmtLcifVYkAd7i7bt06fjjT3d9cPGVL27e8A@mail.gmail.com>
In-Reply-To: <CAGXBFApfF_XsbwSmtLcifVYkAd7i7bt06fjjT3d9cPGVL27e8A@mail.gmail.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q44DuXsc013170
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:56:46 -0000

On 01/13/2012 08:49 AM, goodman.m.w@gmail.com wrote:
> Hello,
>=20
> I fairly recently discovered the joys of join, but now I wonder why it
> is limited to two files?
>=20
> In other words, I would like to do the following:
>=20
> join file1 file2 ... fileN
>=20
> While I CAN achieve this through other methods, they are not ideal.
> For instance, paste works with multiple files, but then I must cut out
> the repeated key columns. The following also works, but doesn't
> generalize to filename expansions (e.g. `join file*`):
>=20
> join file1 file2 | join - file3 | ... | join - fileN
>=20
> As for my use case, I am working with data files containing the
> results of multiple systems running over the same test items. I would
> like to compare the results of all systems for each item by putting
> them side-by-side.
>=20
> I don't know the history of the command, so I am not aware of any
> technical or ideological reasons why it shouldn't support more than
> two files. Any explanation appreciated!

Sorry I thought I replied to this.

Well it would be handy to support more than 2 files,
but you couldn't support an arbitrary number,
as you'd run out of file descriptors or RAM etc.

Also it would complicate the implementation
of join to handle multiple files, especially
an arbitrary number of multiple files.

So for primarily these reason you'd need to
split the task something like:

find files |
while read file1; do
    test "$file2" || read file2
    join "$file1" "$file2" > out.tmp
    file2=3Dout.tmp
done

Note depending on the size of the data,
out.tmp might be better on a ram disk
(which /tmp is in modern GNU/Linux distros for example).

Note also that your non tmp file piped version above
is not scalable for many files due to process limits etc.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Fri May 04 10:19:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQJMN-0000Q8-Pu
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 10:19:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48568)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQJMK-0000Po-Ov
	for coreutils@gnu.org; Fri, 04 May 2012 10:19:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQJMI-0001cC-Ms
	for coreutils@gnu.org; Fri, 04 May 2012 10:19:48 -0400
Received: from mx1.redhat.com ([209.132.183.28]:30948)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQJMI-0001bF-Ez
	for coreutils@gnu.org; Fri, 04 May 2012 10:19:46 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q44EJhx1006794
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 4 May 2012 10:19:44 -0400
Received: from [10.36.116.63] (ovpn-116-63.ams2.redhat.com [10.36.116.63])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q44EJflX028351
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Fri, 4 May 2012 10:19:43 -0400
Message-ID: <4FA3E57D.7040707@draigBrady.com>
Date: Fri, 04 May 2012 15:19:41 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: "goodman.m.w@gmail.com" <goodman.m.w@gmail.com>
Subject: Re: join more than two files
References: <CAGXBFApfF_XsbwSmtLcifVYkAd7i7bt06fjjT3d9cPGVL27e8A@mail.gmail.com>
	<4FA3E00E.1040405@draigBrady.com>
In-Reply-To: <4FA3E00E.1040405@draigBrady.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q44EJhx1006794
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:19:50 -0000

On 05/04/2012 02:56 PM, P=C3=A1draig Brady wrote:
> On 01/13/2012 08:49 AM, goodman.m.w@gmail.com wrote:
>> Hello,
>>
>> I fairly recently discovered the joys of join, but now I wonder why it
>> is limited to two files?
>>
>> In other words, I would like to do the following:
>>
>> join file1 file2 ... fileN
>>
>> While I CAN achieve this through other methods, they are not ideal.
>> For instance, paste works with multiple files, but then I must cut out
>> the repeated key columns. The following also works, but doesn't
>> generalize to filename expansions (e.g. `join file*`):
>>
>> join file1 file2 | join - file3 | ... | join - fileN
>>
>> As for my use case, I am working with data files containing the
>> results of multiple systems running over the same test items. I would
>> like to compare the results of all systems for each item by putting
>> them side-by-side.
>>
>> I don't know the history of the command, so I am not aware of any
>> technical or ideological reasons why it shouldn't support more than
>> two files. Any explanation appreciated!
>=20
> Sorry I thought I replied to this.
>=20
> Well it would be handy to support more than 2 files,
> but you couldn't support an arbitrary number,
> as you'd run out of file descriptors or RAM etc.
>=20
> Also it would complicate the implementation
> of join to handle multiple files, especially
> an arbitrary number of multiple files.
>=20
> So for primarily these reason you'd need to
> split the task something like:
>=20
> find files |
> while read file1; do
>     test "$file2" || read file2
>     join "$file1" "$file2" > out.tmp
>     file2=3Dout.tmp
> done
>=20
> Note depending on the size of the data,
> out.tmp might be better on a ram disk
> (which /tmp is in modern GNU/Linux distros for example).
>=20
> Note also that your non tmp file piped version above
> is not scalable for many files due to process limits etc.

Sigh I had previously responded:
http://lists.gnu.org/archive/html/coreutils/2012-02/msg00064.html
but the subsequent request was in a new thread.

sorry for the noise,
P=C3=A1draig.


From MAILER-DAEMON Fri May 04 11:13:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQKBp-0002Wh-8g
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 11:13:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54108)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQKBi-0002Vr-Jr
	for coreutils@gnu.org; Fri, 04 May 2012 11:12:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQKBd-0006Ny-Sc
	for coreutils@gnu.org; Fri, 04 May 2012 11:12:54 -0400
Received: from mx1.redhat.com ([209.132.183.28]:26165)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SQKBd-0006Ns-L0
	for coreutils@gnu.org; Fri, 04 May 2012 11:12:49 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q44FClBA026951
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 4 May 2012 11:12:47 -0400
Received: from [10.36.116.63] (ovpn-116-63.ams2.redhat.com [10.36.116.63])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q44FCjJN026569
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Fri, 4 May 2012 11:12:46 -0400
Message-ID: <4FA3F1EC.6050906@draigBrady.com>
Date: Fri, 04 May 2012 16:12:44 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: aristidesfl <aristidesfl@gmail.com>
Subject: Re: Group results according the indicators appended by -F/--classify
	(ls --sort=class)
References: <alpine.OSX.2.00.1204270351280.99041@unknown.home>
In-Reply-To: <alpine.OSX.2.00.1204270351280.99041@unknown.home>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q44FClBA026951
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:12:59 -0000

On 04/27/2012 03:51 AM, aristidesfl wrote:
>> From the man entry:
> ```
> -F, --classify
>               append indicator (one of */=3D>@|) to entries
> ```
>=20
> Would be useful for readability purposes to be able group entries accor=
ding the indicators appended by -F/--classify.
> A WORD called class could be added to "--sort" for this purpose.
>=20
> In addition to that, it would be useful to have an option which forced =
the extra entries printed by -a/-A, to be displayed after the rest of the=
 normal entries, independently of sorting options.

For my own reference there are 2 other duplicate threads to ignore on thi=
s.

Hmm, this is one of those marginal items.
I'm not convinced by the readability improvements,
especially when colors are used.

I'd be marginally against adding this.

cheers,
P=E1draig.


From MAILER-DAEMON Fri May 04 11:27:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQKQF-0005fR-Hy
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 11:27:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39262)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SQKQA-0005fA-6X
	for coreutils@gnu.org; Fri, 04 May 2012 11:27:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SQKQ5-00042u-Hw
	for coreutils@gnu.org; Fri, 04 May 2012 11:27:49 -0400
Received: from mx.meyering.net ([88.168.87.75]:47535)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SQKQ5-00042f-Ai
	for coreutils@gnu.org; Fri, 04 May 2012 11:27:45 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 3BBB06004B;
	Fri,  4 May 2012 17:27:43 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: Group results according the indicators appended by -F/--classify
	(ls --sort=class)
In-Reply-To: <4FA3F1EC.6050906@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Fri, 04 May 2012 16:12:44 +0100")
References: <alpine.OSX.2.00.1204270351280.99041@unknown.home>
	<4FA3F1EC.6050906@draigBrady.com>
Date: Fri, 04 May 2012 17:27:43 +0200
Message-ID: <87sjfgklu8.fsf@rho.meyering.net>
Lines: 23
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: aristidesfl <aristidesfl@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:27:54 -0000

P=E1draig Brady wrote:
> On 04/27/2012 03:51 AM, aristidesfl wrote:
>>> From the man entry:
>> ```
>> -F, --classify
>>               append indicator (one of */=3D>@|) to entries
>> ```
>>
>> Would be useful for readability purposes to be able group entries accord=
ing the indicators appended by -F/--classify.
>> A WORD called class could be added to "--sort" for this purpose.
>>
>> In addition to that, it would be useful to have an option which forced t=
he extra entries printed by -a/-A, to be displayed after the rest of the no=
rmal entries, independently of sorting options.
>
> For my own reference there are 2 other duplicate threads to ignore on thi=
s.
>
> Hmm, this is one of those marginal items.
> I'm not convinced by the readability improvements,
> especially when colors are used.
>
> I'd be marginally against adding this.

Thanks for replying.
I have the same feeling: hard to justify the addition.


From MAILER-DAEMON Fri May 04 14:38:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQNOh-0002fs-32
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 14:38:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44215)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SQNOe-0002fm-Aq
	for coreutils@gnu.org; Fri, 04 May 2012 14:38:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SQNOc-00068y-HK
	for coreutils@gnu.org; Fri, 04 May 2012 14:38:27 -0400
Received: from mail-wi0-f169.google.com ([209.85.212.169]:64061)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SQNOc-00068V-57
	for coreutils@gnu.org; Fri, 04 May 2012 14:38:26 -0400
Received: by wibhm17 with SMTP id hm17so1400261wib.0
	for <coreutils@gnu.org>; Fri, 04 May 2012 11:38:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer
	:mime-version:content-type;
	bh=Fjet0pMCWd5UgGQ/nACqe1E5XaShsVlqeHXymjqVnGM=;
	b=vjEDKyt2o/+bxvv9tC/RzquimsEZ0X1SfdWS149tC+4FiLczzT+mIjsSMGwaxaS31u
	se/8A4LV7sOX6DA+9wcrmKr3AIsU48ISUpaLr/IuPHPWdWgjyJWXiKbZKPbuHiqEhHO7
	D7Jg4x811KgAlJQwfwssU5jScuplBMbGXS4mCEJXVA6sPhUt0gNwNPy0+uO3ZSQStQux
	/MOTHUIxVpCiF3HJoBEp/hllBqHDowVeJHpJQqrypsIXdUq41n/A4n/GX6qaHXM/szVY
	bQpO6mX9lPKdjgsx4GdE1qKQPjXnJ8cQ31Zb+vab4brnJ5Aj5JscdmRtK+CGw+QmeDRf
	3DpQ==
Received: by 10.180.95.4 with SMTP id dg4mr1659902wib.2.1336156703264;
	Fri, 04 May 2012 11:38:23 -0700 (PDT)
Received: from [192.168.1.2] (a89-153-142-45.cpe.netcabo.pt. [89.153.142.45])
	by mx.google.com with ESMTPS id b3sm2945644wib.4.2012.05.04.11.38.20
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 04 May 2012 11:38:21 -0700 (PDT)
Date: Fri, 4 May 2012 19:38:19 +0100
From: aristidesfl <aristidesfl@gmail.com>
To: Jim Meyering <jim@meyering.net>
Message-ID: <45A065368043495C92EE6FC52BFC138A@gmail.com>
In-Reply-To: <87sjfgklu8.fsf@rho.meyering.net>
References: <alpine.OSX.2.00.1204270351280.99041@unknown.home>
	<4FA3F1EC.6050906@draigBrady.com> <87sjfgklu8.fsf@rho.meyering.net>
Subject: Re: Group results according the indicators appended by
	-F/--classify (ls =?utf-8?Q?--sort=3Dclass)?=
X-Mailer: sparrow 1.5.1beta1 (build 1043.13)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="4fa4221b_66334873_270b"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.212.169
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:38:29 -0000

--4fa4221b_66334873_270b
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I sent 3 emails because it was my 1st time on the list and I thought they=
 were not coming through, I'm sorry.

I miss this feature a lot. Tried to work around the limitation by creatin=
g an alias witch would call =60ls=60 multiple times, but it has the drawb=
ack of not being able to accept any more options.

Since there is an option to classify the results, it makes sense one to o=
rder them by that classification.


On =46riday, May 4, 2012 at 16:27 , Jim Meyering wrote:

> P=C3=A1draig Brady wrote:
> > On 04/27/2012 03:51 AM, aristidesfl wrote:
> > > > =46rom the man entry:
> > > =20
> > > =60=60=60
> > > -=46, --classify
> > > append indicator (one of */=3D>=40=7C) to entries
> > > =60=60=60
> > > =20
> > > Would be useful for readability purposes to be able group entries a=
ccording the indicators appended by -=46/--classify.
> > > A WORD called class could be added to =22--sort=22 for this purpose=
.
> > > =20
> > > In addition to that, it would be useful to have an option which for=
ced the extra entries printed by -a/-A, to be displayed after the rest of=
 the normal entries, independently of sorting options.
> > =20
> > =46or my own reference there are 2 other duplicate threads to ignore =
on this.
> > =20
> > Hmm, this is one of those marginal items.
> > I'm not convinced by the readability improvements,
> > especially when colors are used.
> > =20
> > I'd be marginally against adding this.
> =20
> Thanks for replying.
> I have the same feeling: hard to justify the addition.
> =20
> =20



--4fa4221b_66334873_270b
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline


                <div style=3D=22font-family: Helvetica; font-size: 13px; =
=22>I sent 3 emails because it was my 1st time on the list and I thought =
they were not coming through, I'm sorry.<div><br></div><div>I miss this f=
eature a lot. Tried to work around the limitation by creating an alias wi=
tch would call =60ls=60 multiple times, but it has the drawback of not be=
ing able to accept any more options.</div><div><br></div><div>Since there=
 is an option to classify the results, it makes sense one to order them b=
y that classification.<br><div><br></div></div></div>
                <div></div>
                =20
                <p style=3D=22color: =23A0A0A8;=22>On =46riday, May 4, 20=
12 at 16:27 , Jim Meyering wrote:</p>
                <blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
                    <span><div><div><div>P=C3=A1draig Brady wrote:</div><=
blockquote type=3D=22cite=22><div><div>On 04/27/2012 03:51 AM, aristidesf=
l wrote:</div><blockquote type=3D=22cite=22><div><blockquote type=3D=22ci=
te=22><div>=46rom the man entry:</div></blockquote><div>=60=60=60</div><d=
iv>-=46, --classify</div><div>              append indicator (one of */=3D=
&gt;=40=7C) to entries</div><div>=60=60=60</div><div><br></div><div>Would=
 be useful for readability purposes to be able group entries according th=
e indicators appended by -=46/--classify.</div><div>A WORD called class c=
ould be added to =22--sort=22 for this purpose.</div><div><br></div><div>=
In addition to that, it would be useful to have an option which forced th=
e extra entries printed by -a/-A, to be displayed after the rest of the n=
ormal entries, independently of sorting options.</div></div></blockquote>=
<div><br></div><div>=46or my own reference there are 2 other duplicate th=
reads to ignore on this.</div><div><br></div><div>Hmm, this is one of tho=
se marginal items.</div><div>I'm not convinced by the readability improve=
ments,</div><div>especially when colors are used.</div><div><br></div><di=
v>I'd be marginally against adding this.</div></div></blockquote><div><br=
></div><div>Thanks for replying.</div><div>I have the same feeling: hard =
to justify the addition.</div></div></div></span>
                =20
                =20
                =20
                =20
                </blockquote>
                =20
                <div>
                    <br>
                </div>
            
--4fa4221b_66334873_270b--



From MAILER-DAEMON Fri May 04 14:42:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SQNSH-0003R4-Cf
	for mharc-coreutils@gnu.org; Fri, 04 May 2012 14:42:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46916)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SQNSE-0003Ph-R7
	for coreutils@gnu.org; Fri, 04 May 2012 14:42:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SQNSD-000803-46
	for coreutils@gnu.org; Fri, 04 May 2012 14:42:10 -0400
Received: from mail-wi0-f171.google.com ([209.85.212.171]:64918)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aristidesfl@gmail.com>) id 1SQNSC-0007zu-Qv
	for coreutils@gnu.org; Fri, 04 May 2012 14:42:09 -0400
Received: by wibhj13 with SMTP id hj13so1246083wib.12
	for <coreutils@gnu.org>; Fri, 04 May 2012 11:42:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=date:from:to:cc:subject:in-reply-to:message-id:references
	:user-agent:mime-version:content-type;
	bh=sJC853Vc/Ie7PWYbCxW7erNpChCOBs/N9wCYcTTFAKo=;
	b=fHb/pVi1f59ljiJatJM+FvZMGTGGTJcdnlGlGpSStclJlnp3zbbCBPmwPu/BcBpk0T
	XkT5215GBSLMTQsMjuVe/fYKPaqpi+8CZJPU7sougvotUQEN6pjd9Iv3+EAzcKZxhYvY
	XI8vewgUyL1xFLdLkj206Frq5p3i3IenzcAvKDkdnx9qEGJS/f7Oxe2xqqTn7yfOC6gT
	gt+yZVbVlg4C/sqiTW5x7YCUd3kpQeUHLZyimf2uX1Zy3d7bHqZt5jgP8uI4ApAu0Mrz
	6DSNChxZyumdxh62hnIeBayXV6HgpqOPBlzrhBOm8zfZW2/RYM/XeSecujiInEpSJ7Q2
	735w==
Received: by 10.180.81.135 with SMTP id a7mr15423745wiy.16.1336156926748;
	Fri, 04 May 2012 11:42:06 -0700 (PDT)
Received: from unknown.home (a89-153-142-45.cpe.netcabo.pt. [89.153.142.45])
	by mx.google.com with ESMTPS id ca3sm2961733wib.6.2012.05.04.11.42.04
	(version=SSLv3 cipher=OTHER); Fri, 04 May 2012 11:42:05 -0700 (PDT)
Date: Fri, 4 May 2012 19:41:56 +0100 (WEST)
From: k <aristidesfl@gmail.com>
To: Jim Meyering <jim@meyering.net>
Subject: Re: Group results according the indicators appended by -F/--classify
	(ls --sort=class)
In-Reply-To: <87sjfgklu8.fsf@rho.meyering.net>
Message-ID: <alpine.OSX.2.00.1205041941020.12035@unknown.home>
References: <alpine.OSX.2.00.1204270351280.99041@unknown.home>
	<4FA3F1EC.6050906@draigBrady.com> <87sjfgklu8.fsf@rho.meyering.net>
User-Agent: Alpine 2.00 (OSX 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-617979300-1336156925=:12035"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.212.171
Cc: aristidesfl <aristidesfl@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:42:12 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-617979300-1336156925=:12035
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

Sorry for the html in the last message. Here it is in plain text:

I sent 3 emails because it was my 1st time on the list and I thought they 
were not coming through, I'm sorry.

I miss this feature a lot. Tried to work around the limitation by creating 
an alias witch would call `ls` multiple times, but it has the drawback of 
not being able to accept any more options.

Since there is an option to classify the results, it makes sense one to 
order them by that classification.



On Fri, 4 May 2012, Jim Meyering wrote:

> Pádraig Brady wrote:
>> On 04/27/2012 03:51 AM, aristidesfl wrote:
>>>> From the man entry:
>>> ```
>>> -F, --classify
>>>               append indicator (one of */=>@|) to entries
>>> ```
>>>
>>> Would be useful for readability purposes to be able group entries according the indicators appended by -F/--classify.
>>> A WORD called class could be added to "--sort" for this purpose.
>>>
>>> In addition to that, it would be useful to have an option which forced the extra entries printed by -a/-A, to be displayed after the rest of the normal entries, independently of sorting options.
>>
>> For my own reference there are 2 other duplicate threads to ignore on this.
>>
>> Hmm, this is one of those marginal items.
>> I'm not convinced by the readability improvements,
>> especially when colors are used.
>>
>> I'd be marginally against adding this.
>
> Thanks for replying.
> I have the same feeling: hard to justify the addition.
>
--0-617979300-1336156925=:12035--


From MAILER-DAEMON Mon May 07 03:52:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRIjl-0008IH-D6
	for mharc-coreutils@gnu.org; Mon, 07 May 2012 03:52:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44428)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRIjd-0008Gj-PN
	for coreutils@gnu.org; Mon, 07 May 2012 03:52:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRIjX-0004Eu-H8
	for coreutils@gnu.org; Mon, 07 May 2012 03:51:57 -0400
Received: from mx.meyering.net ([88.168.87.75]:57012)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRIjX-0004ES-9Y
	for coreutils@gnu.org; Mon, 07 May 2012 03:51:51 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id A84F360061
	for <coreutils@gnu.org>; Mon,  7 May 2012 09:51:49 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] doc: NEWS: note when the id/groups bug was introduced
Date: Mon, 07 May 2012 09:51:49 +0200
Message-ID: <87bom0fmy2.fsf@rho.meyering.net>
Lines: 28
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 07:52:03 -0000

FYI,

>From 3468d26884800d7bc6fcc1ba52cd481175c655d8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 6 May 2012 23:02:51 +0200
Subject: [PATCH] doc: NEWS: note when the id/groups bug was introduced

* NEWS (Bug fixes): Note the first affected release.
The id bug was introduced by commit v8.0-112-g719a95a.
---
 NEWS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 1c00d96..8e42c63 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ GNU coreutils NEWS                                    -*- outline -*-
   that ID would be neither real nor effective.  For example, when run
   set-GID, or in a session for which the default group has just been
   changed, the new group ID would be listed, even though it is not
-  yet effective.
+  yet effective. [bug introduced in coreutils-8.1]

 ** New features

--
1.7.10.1.457.g8275905


From MAILER-DAEMON Mon May 07 14:45:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRSvt-0004Aa-Ud
	for mharc-coreutils@gnu.org; Mon, 07 May 2012 14:45:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43272)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SRSvr-00047y-5J
	for coreutils@gnu.org; Mon, 07 May 2012 14:45:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SRSvp-0006Ma-Ae
	for coreutils@gnu.org; Mon, 07 May 2012 14:45:14 -0400
Received: from mx1.redhat.com ([209.132.183.28]:18057)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>)
	id 1SRSvd-00069Z-Kd; Mon, 07 May 2012 14:45:01 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q47IivIQ004172
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 7 May 2012 14:44:57 -0400
Received: from [10.3.113.90] (ovpn-113-90.phx2.redhat.com [10.3.113.90])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q47IiuMD032664; Mon, 7 May 2012 14:44:57 -0400
Message-ID: <4FA81828.1060201@redhat.com>
Date: Mon, 07 May 2012 12:44:56 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Bruno Haible <bruno@clisp.org>
Subject: Re: Gnulib's freopen replacement and MinGW
References: <83397e6fm8.fsf@gnu.org> <4FA7C390.7020101@redhat.com>
	<7449148.DYOLSxCRIm@linuix>
In-Reply-To: <7449148.DYOLSxCRIm@linuix>
X-Enigmail-Version: 1.4.1
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigB5C999D541FE614F939C439E"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: bug-gnu-utils@gnu.org, Eli Zaretskii <eliz@gnu.org>, bug-gnulib@gnu.org,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:45:16 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigB5C999D541FE614F939C439E
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

[adding coreutils]

On 05/07/2012 12:11 PM, Bruno Haible wrote:
> Eric Blake wrote:
>> POSIX says that such a call is implementation-defined, so technically,=

>> mingw DOES implement the POSIX semantics (by defining that it is
>> unsupported).
>=20
> Yes. So, code in freopen.c that would try to support a NULL argument
> in all cases
>   - would be a gnulib extension,
>   - would not be usable to change the read vs. write vs. append mode,
>     because on many systems we would need to fiddle with FILE internals=
,
>     which is hard and not reliable,
>   - would be only useful to change the text vs. binary mode. But for th=
is
>     purpose gnulib already offers a simpler API: binary-io.h.
>=20
>> However, you are correct that it is annoying, and
>> something that gnulib could work around for easier coding.
>=20
> I don't agree. It's not easier coding to write
>   xfreopen (NULL, "rb", fp);
> instead of
>   SET_BINARY (fileno (fp));

Waaaay back when, coreutils used to use SET_BINARY.  We changed that to
use freopen(NULL) because of the POSIX wording that allowed NULL to
change mode, because cygwin honored the mode change, and because Paul
preferred using a POSIX interface over a complete extension interface.

Commit 8770c00ef, Jul 2005
https://lists.gnu.org/archive/html/bug-coreutils/2005-07/msg00059.html

Also, at one point, I proposed a patch to xfreopen, to which Bruno
counterproposed a new API fchangemode() that would alter a FILE* to be
binary without the baggage of freopen(NULL), although I never really
pursued it:

https://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00111.html

Now it looks like we've come full circle, and that the POSIX wording of
freopen(NULL) is so broken as to not be worth using via gnulib, and
we're back to preferring extension interfaces in the form of SET_BINARY.
 It looks like several projects will have to change, coreutils included,
if we indeed decide that use of freopen(NULL) is no longer desirable.

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPqBgoAAoJEKeha0olJ0NqgPIH/2Yg46Bdv1gL0j4LfYJm3qCN
RlixBeELRYVWiroNZ7xmwQFDUIWgYeD2PFv8bqdDjA/bGrWquBbctH84/H7fwrNI
7GUcQNk83CfShkZytwv6QVVhDwhtQm0+1UY9mxFn+l4bjZTNd0+i4DRFNnGMuErD
uKTurY9hLtvY7xAyFw/u0CApySA/aVu7UwfupKZXwVg7eBzF2/Yv5G53GSaaHa+U
hrmGWIX014r49d0Na2/8bJBmW2MNDBL/2zYVMsgqu2gsWc0VdqkIeV6qM5Ny34UQ
JPyelUuUHpI1hO6f1p47B2oxWKh4UBdXPNOygTWrb8wzRuf5kV1/HuCb/Ro6rIw=
=gHwc
-----END PGP SIGNATURE-----

--------------enigB5C999D541FE614F939C439E--


From MAILER-DAEMON Mon May 07 15:59:26 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRU5e-0007Js-1L
	for mharc-coreutils@gnu.org; Mon, 07 May 2012 15:59:26 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51749)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SRU5b-0007I7-TT
	for coreutils@gnu.org; Mon, 07 May 2012 15:59:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SRU5a-0004EL-3X
	for coreutils@gnu.org; Mon, 07 May 2012 15:59:23 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.160]:24891)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>)
	id 1SRU5O-00047O-4D; Mon, 07 May 2012 15:59:10 -0400
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbvY44zMkpA==
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-070-142.pools.arcor-ip.net [88.68.70.142])
	by smtp.strato.de (joses mo54) (RZmta 29.5 DYNA|AUTH)
	with ESMTPA id N03829o47Hk0aO ; Mon, 7 May 2012 21:59:07 +0200 (CEST)
From: Bruno Haible <bruno@clisp.org>
To: Eric Blake <eblake@redhat.com>
Bcc: bruno@haible.de
Subject: Re: Gnulib's freopen replacement and MinGW
Date: Mon, 07 May 2012 21:59:45 +0200
Message-ID: <4494259.TyBaHuq2TJ@linuix>
User-Agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )
In-Reply-To: <4FA81828.1060201@redhat.com>
References: <83397e6fm8.fsf@gnu.org> <7449148.DYOLSxCRIm@linuix>
	<4FA81828.1060201@redhat.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 81.169.146.160
Cc: bug-gnu-utils@gnu.org, Eli Zaretskii <eliz@gnu.org>, bug-gnulib@gnu.org,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 19:59:25 -0000

Hi Eric,

Thank you for digging out the previous threads on this topic.

Eric Blake wrote:
> Waaaay back when, coreutils used to use SET_BINARY.  We changed that to
> use freopen(NULL) because of the POSIX wording that allowed NULL to
> change mode, because cygwin honored the mode change, and because Paul
> preferred using a POSIX interface over a complete extension interface.
> 
> Commit 8770c00ef, Jul 2005
> https://lists.gnu.org/archive/html/bug-coreutils/2005-07/msg00059.html
> 
> Also, at one point, I proposed a patch to xfreopen, to which Bruno
> counterproposed a new API fchangemode() that would alter a FILE* to be
> binary without the baggage of freopen(NULL), although I never really
> pursued it:
> 
> https://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00111.html
> 
> Now it looks like we've come full circle, and that the POSIX wording of
> freopen(NULL) is so broken as to not be worth using via gnulib

Yes. Aside the issue with O_TEXT / O_BINARY being out of scope of POSIX,
there is also the issue with the file position. As I understand it,
freopen (NULL, ...) shall - if it succeeds - set the file position back
to 0. Citing POSIX [1]:

  "even though the 'b' is ignored, a successful call to
   freopen (NULL, "wb", stdout) does have an effect. In particular, for
   regular files it truncates the file and sets the file-position
   indicator for the stream to the start of the file."

Similarly, for stdin, a successful call to  freopen (NULL, "rb", stdin)
must rewind the read-position of stdin to 0. Thus when used in a program
'prog', in the command
     { dd of=/dev/null count=1; prog; } < regular_file
'prog' will start reading from the beginning of regular_file, as if the
dd command was not present. I think this is unintended. Most coreutils
will *just* want to switch to binary mode without rewinding.

So, I continue to be in favour of APIs which don't need to fiddle with
FILE internals and with the file position. Like the proposed [2] fsetbinary()
for O_BINARY, or an fchangemode() that supports at least O_RDONLY, O_WRONLY,
O_RDWR, O_APPEND, O_TEXT, O_BINARY.

Bruno

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/freopen.html
[2] https://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00111.html



From MAILER-DAEMON Mon May 07 16:03:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRU9i-0007j6-Ua
	for mharc-coreutils@gnu.org; Mon, 07 May 2012 16:03:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55463)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRU9f-0007if-I0
	for coreutils@gnu.org; Mon, 07 May 2012 16:03:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRU9d-0005d7-Nd
	for coreutils@gnu.org; Mon, 07 May 2012 16:03:35 -0400
Received: from mx.meyering.net ([88.168.87.75]:58999)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRU9d-0005Z6-GD
	for coreutils@gnu.org; Mon, 07 May 2012 16:03:33 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 98BF860053
	for <coreutils@gnu.org>; Mon,  7 May 2012 22:03:30 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym
Date: Mon, 07 May 2012 22:03:30 +0200
Message-ID: <87lil3dai5.fsf@rho.meyering.net>
Lines: 37
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 20:03:38 -0000

Thanks to the nixos/hydra autobuilder, I noticed that the new
LD_PRELOAD-based test was failing in one of their build environments:

  http://hydra.nixos.org/build/2531974

    + echo xyz
    + LD_PRELOAD=./k.so
    + cp src d
    cp: symbol lookup error: ./k.so: undefined symbol: dlsym

Here's the probable fix:

>From fedebc59a040a7e34dce5c987b7f6fcf2cefa904 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 7 May 2012 22:01:20 +0200
Subject: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym

* tests/cp/nfs-removal-race: Link with -ldl.
---
 tests/cp/nfs-removal-race | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/cp/nfs-removal-race b/tests/cp/nfs-removal-race
index 6a435b0..cb8aba3 100755
--- a/tests/cp/nfs-removal-race
+++ b/tests/cp/nfs-removal-race
@@ -57,7 +57,7 @@ __xstat (int ver, const char *path, struct stat *st)
 EOF

 # Then compile/link it:
-$CC -shared -fPIC -O2 k.c -o k.so \
+$CC -shared -fPIC -O2 k.c -o k.so -ldl \
   || framework_failure_ 'failed to compile with -shared -fPIC'

 touch d2 || framework_failure_
--
1.7.10.1.457.g8275905


From MAILER-DAEMON Mon May 07 21:22:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRZ8B-00016k-79
	for mharc-coreutils@gnu.org; Mon, 07 May 2012 21:22:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53070)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SRZ87-00016E-Cn
	for coreutils@gnu.org; Mon, 07 May 2012 21:22:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SRZ85-0000A5-EE
	for coreutils@gnu.org; Mon, 07 May 2012 21:22:18 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:33957)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SRZ85-00009m-86
	for coreutils@gnu.org; Mon, 07 May 2012 21:22:17 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAGR0qE9tTAd8/2dsb2JhbAANN7Y5AQEBBDIBRhALDQgDCRQCDwkDAgECAUUGDQEFAgEBiBW7C4p/hgkEnBaNFA
Received: from unknown (HELO [192.168.1.79]) ([109.76.7.124])
	by mail2.vodafone.ie with ESMTP; 08 May 2012 02:22:14 +0100
Message-ID: <4FA87545.5070508@draigBrady.com>
Date: Tue, 08 May 2012 02:22:13 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Kevin Lyda <kevin@ie.suberic.net>
Subject: Re: [PATCH] maint: fix common spelling errors in comments
References: <1334706404-31518-1-git-send-email-P@draigBrady.com>
	<87ty0h379l.fsf@rho.meyering.net>
In-Reply-To: <87ty0h379l.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 01:22:20 -0000

On 04/18/2012 07:04 AM, Jim Meyering wrote:
> Pádraig Brady wrote:
>> From: Kevin Lyda <kevin@ie.suberic.net>
>>
>> These were identified using: https://github.com/lyda/misspell-check
>>
>> * src/cat.c: Correct a single spelling error.
>> * src/comm.c: Likewise.
>> * src/expr.c Likewise.
>> * src/pr.c Likewise.
>> * src/tac.c Likewise.
>> * src/test.c Likewise.
>> ---
>>  src/cat.c  |    4 ++--
>>  src/comm.c |    2 +-
>>  src/expr.c |    2 +-
>>  src/pr.c   |    2 +-
>>  src/tac.c  |    2 +-
>>  src/test.c |    2 +-
>>  6 files changed, 7 insertions(+), 7 deletions(-)
> 
> Nice.  But don't stop with just the .c files.
> Run it on all version-controlled files:
> 
>     git ls-files|misspellings -f -

Adjusted and pushed.
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=aa078afc

cheers,
Pádraig.


From MAILER-DAEMON Tue May 08 02:44:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRe9n-0006oG-Ek
	for mharc-coreutils@gnu.org; Tue, 08 May 2012 02:44:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45591)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SRe9k-0006o9-Ve
	for coreutils@gnu.org; Tue, 08 May 2012 02:44:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SRe9i-0008Vk-Ri
	for coreutils@gnu.org; Tue, 08 May 2012 02:44:20 -0400
Received: from moutng.kundenserver.de ([212.227.17.9]:64005)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SRe9i-0008Rl-Hh
	for coreutils@gnu.org; Tue, 08 May 2012 02:44:18 -0400
Received: from [192.168.2.108] (p4FF7351B.dip.t-dialin.net [79.247.53.27])
	by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis)
	id 0LeSQX-1Rn9SE0fs5-00q3oK; Tue, 08 May 2012 08:44:15 +0200
Message-ID: <4FA8C0BE.9040403@bernhard-voelker.de>
Date: Tue, 08 May 2012 08:44:14 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120421 Thunderbird/12.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym
References: <87lil3dai5.fsf@rho.meyering.net>
In-Reply-To: <87lil3dai5.fsf@rho.meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:/KWc1Hn5xwDfJeuPNbnA5Hc6Il5u8S+mk0OMXML0Gvj
	AqI/VaAaSfkzUDW9w9CZZ8Ukm0ApaTjOWHDeIBwqPVS+4F/+5p
	YM9wkyRH1ckG3tsRwEBgna/0YSlkhbLCkkq+rfwsz7EvW5sPLX
	qVM1LTbn3puZY/mtAf3I+qTvrSxkDRxhsJgHWIuh984pZ/OcCX
	GXU+iauRlWBEmqdj3MrrPB+Su7h543Gk+NyOHXfoKl9+6/JmfF
	3WClhJtwVNkDhcm1jiMeEua4IeGkWGU1U+SnW5GA1X9P+XeqR4
	DktTqvIIF4ofuGRTpGSm76MApTo+Y42qYcCgQD286oNZu6+cBY
	5XJ+zIr9okv6zMKxY4x8E9ZZ/ADkTYrirld9ZrDaF
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.17.9
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 06:44:22 -0000

On 05/07/2012 10:03 PM, Jim Meyering wrote:
> Thanks to the nixos/hydra autobuilder, I noticed that the new
> LD_PRELOAD-based test was failing in one of their build environments:
> 
>   http://hydra.nixos.org/build/2531974
> 
>     + echo xyz
>     + LD_PRELOAD=./k.so
>     + cp src d
>     cp: symbol lookup error: ./k.so: undefined symbol: dlsym
> 
> Here's the probable fix:
> 
> From fedebc59a040a7e34dce5c987b7f6fcf2cefa904 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Mon, 7 May 2012 22:01:20 +0200
> Subject: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym
> 
> * tests/cp/nfs-removal-race: Link with -ldl.
> ---
>  tests/cp/nfs-removal-race | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/cp/nfs-removal-race b/tests/cp/nfs-removal-race
> index 6a435b0..cb8aba3 100755
> --- a/tests/cp/nfs-removal-race
> +++ b/tests/cp/nfs-removal-race
> @@ -57,7 +57,7 @@ __xstat (int ver, const char *path, struct stat *st)
>  EOF
> 
>  # Then compile/link it:
> -$CC -shared -fPIC -O2 k.c -o k.so \
> +$CC -shared -fPIC -O2 k.c -o k.so -ldl \
>    || framework_failure_ 'failed to compile with -shared -fPIC'
> 
>  touch d2 || framework_failure_
> --
> 1.7.10.1.457.g8275905

I'm puzzled: if your assumption is true, then why doesn't the
other LD_PRELOAD based test - "ls/getxattr-speedup" - fail?

Have a nice day,
Berny


From MAILER-DAEMON Tue May 08 02:57:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SReMW-0000aX-Re
	for mharc-coreutils@gnu.org; Tue, 08 May 2012 02:57:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60032)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SReMU-0000a8-Io
	for coreutils@gnu.org; Tue, 08 May 2012 02:57:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SReMS-0004xS-PM
	for coreutils@gnu.org; Tue, 08 May 2012 02:57:30 -0400
Received: from mx.meyering.net ([88.168.87.75]:60670)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SReMS-0004xN-HU
	for coreutils@gnu.org; Tue, 08 May 2012 02:57:28 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 0056A600D9;
	Tue,  8 May 2012 08:57:26 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: Re: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym
In-Reply-To: <4FA8C0BE.9040403@bernhard-voelker.de> (Bernhard Voelker's
	message of "Tue, 08 May 2012 08:44:14 +0200")
References: <87lil3dai5.fsf@rho.meyering.net>
	<4FA8C0BE.9040403@bernhard-voelker.de>
Date: Tue, 08 May 2012 08:57:26 +0200
Message-ID: <87ehqvb1nt.fsf@rho.meyering.net>
Lines: 46
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 06:57:32 -0000

Bernhard Voelker wrote:

> On 05/07/2012 10:03 PM, Jim Meyering wrote:
>> Thanks to the nixos/hydra autobuilder, I noticed that the new
>> LD_PRELOAD-based test was failing in one of their build environments:
>>
>>   http://hydra.nixos.org/build/2531974
>>
>>     + echo xyz
>>     + LD_PRELOAD=./k.so
>>     + cp src d
>>     cp: symbol lookup error: ./k.so: undefined symbol: dlsym
>>
>> Here's the probable fix:
>>
>> From fedebc59a040a7e34dce5c987b7f6fcf2cefa904 Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <meyering@redhat.com>
>> Date: Mon, 7 May 2012 22:01:20 +0200
>> Subject: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym
>>
>> * tests/cp/nfs-removal-race: Link with -ldl.
>> ---
>>  tests/cp/nfs-removal-race | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/cp/nfs-removal-race b/tests/cp/nfs-removal-race
>> index 6a435b0..cb8aba3 100755
>> --- a/tests/cp/nfs-removal-race
>> +++ b/tests/cp/nfs-removal-race
>> @@ -57,7 +57,7 @@ __xstat (int ver, const char *path, struct stat *st)
>>  EOF
>>
>>  # Then compile/link it:
>> -$CC -shared -fPIC -O2 k.c -o k.so \
>> +$CC -shared -fPIC -O2 k.c -o k.so -ldl \
>>    || framework_failure_ 'failed to compile with -shared -fPIC'
>>
>>  touch d2 || framework_failure_
>> --
>> 1.7.10.1.457.g8275905
>
> I'm puzzled: if your assumption is true, then why doesn't the
> other LD_PRELOAD based test - "ls/getxattr-speedup" - fail?

That other one doesn't call dlsym, while this new script does,
in order to call the underlying stat function.


From MAILER-DAEMON Tue May 08 06:03:52 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRhGq-0006OJ-Au
	for mharc-coreutils@gnu.org; Tue, 08 May 2012 06:03:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51628)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRhGj-0006O8-QS
	for coreutils@gnu.org; Tue, 08 May 2012 06:03:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRhGd-0000tU-Ei
	for coreutils@gnu.org; Tue, 08 May 2012 06:03:45 -0400
Received: from mx.meyering.net ([88.168.87.75]:33008)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRhGd-0000r5-71
	for coreutils@gnu.org; Tue, 08 May 2012 06:03:39 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 5A3D460282;
	Tue,  8 May 2012 12:03:37 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: ready for a new coreutils bug-fix release
Date: Tue, 08 May 2012 12:03:37 +0200
Message-ID: <87ehqv7zwm.fsf@rho.meyering.net>
Lines: 41
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: 88.168.87.75
Cc: Paul Eggert <eggert@cs.ucla.edu>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 10:03:51 -0000

I'm ready for a bug-fix release.

I'd like to include Paul's patch to better guard uses of stat.st_size.

I know Paul mentioned some in-progress speed-up patches for sort,
but anything that changes sort.c enough to evoke a significant speed-up
is unlikely to qualify as simple and clearly "safe".

Does anyone have pending problems/patches we should consider?

Here are the NEWS items since 8.16:

    ** Bug fixes

      id and groups, when invoked with no user name argument, would print
      the default group ID listed in the password database, and sometimes
      that ID would be neither real nor effective.  For example, when run
      set-GID, or in a session for which the default group has just been
      changed, the new group ID would be listed, even though it is not
      yet effective. [bug introduced in coreutils-8.1]

      cp S D is no longer subject to a race: if an existing D were removed
      between the initial stat and subsequent open-without-O_CREATE, cp would
      fail with a confusing diagnostic saying that the destination, D, was not
      found.  Now, in this unusual case, it retries the open (but with O_CREATE),
      and hence usually succeeds.  With NFS attribute caching, the condition
      was particularly easy to trigger, since there, the removal of D could
      precede the initial stat.  [This bug was present in "the beginning".]

    ** New features

      fmt now accepts the --goal=WIDTH (-g) option.

    ** Changes in behavior

      cp,mv,install,cat,split: now read and write a minimum of 64KiB at a time.
      This was previously 32KiB and increasing to 64KiB was seen to increase
      throughput by about 10% when reading cached files on 64 bit GNU/Linux.

      cp --attributes-only no longer truncates any existing destination file,
      allowing for more general copying of attributes from one file to another.


From MAILER-DAEMON Tue May 08 08:47:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRjpF-0007xa-Lg
	for mharc-coreutils@gnu.org; Tue, 08 May 2012 08:47:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52594)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SRjpA-0007wf-9v
	for coreutils@gnu.org; Tue, 08 May 2012 08:47:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SRjp5-0007fp-8U
	for coreutils@gnu.org; Tue, 08 May 2012 08:47:27 -0400
Received: from mx1.redhat.com ([209.132.183.28]:6580)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SRjp5-0007ev-0Y
	for coreutils@gnu.org; Tue, 08 May 2012 08:47:23 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q48ClIjw007265
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 8 May 2012 08:47:18 -0400
Received: from pb-n5110.redhat.com (ovpn-116-54.ams2.redhat.com [10.36.116.54])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q48ClHJ1013957; Tue, 8 May 2012 08:47:17 -0400
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] doc: clarify dd conv=sparse usage with devices
Date: Tue,  8 May 2012 13:47:15 +0100
Message-Id: <1336481235-3967-1-git-send-email-P@draigBrady.com>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 12:47:32 -0000

* doc/coreutils.texi (dd invocation): Clarify that NUL blocks
are not copied for devices either, and give examples of where
it might be useful.
---
 doc/coreutils.texi |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 61b3c89..767267b 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -8167,9 +8167,12 @@ On a file system that supports sparse files, this will create
 sparse output when extending the output file.
 Be careful when using this option in conjunction with
 @samp{conv=notrunc} or @samp{oflag=append}.
-With @samp{conv=notrunc}, existing data in the output
+With @samp{conv=notrunc}, existing data in the output file
 corresponding to @sc{nul} blocks from the input, will be untouched.
 With @samp{oflag=append} the seeks performed will be ineffective.
+Similarly, when the output is a device rather than a file,
+@sc{nul} input blocks are not copied, and therefore this option
+is most useful with virtual or pre zeroed devices.
 
 @item swab
 @opindex swab @r{(byte-swapping)}
-- 
1.7.6.4



From MAILER-DAEMON Tue May 08 09:56:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRktx-0003LL-Jh
	for mharc-coreutils@gnu.org; Tue, 08 May 2012 09:56:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35473)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRktq-0003Is-29
	for coreutils@gnu.org; Tue, 08 May 2012 09:56:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRktl-00073M-73
	for coreutils@gnu.org; Tue, 08 May 2012 09:56:21 -0400
Received: from mx.meyering.net ([88.168.87.75]:33681)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SRktl-00072q-0T
	for coreutils@gnu.org; Tue, 08 May 2012 09:56:17 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 93DEE6004B;
	Tue,  8 May 2012 15:56:14 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Paul Eggert <eggert@cs.ucla.edu>
Subject: humph.  system.h change pushed prematurely
In-Reply-To: <E1SRftU-0002rz-5g@vcs.savannah.gnu.org> (Jim Meyering's message
	of "Tue, 08 May 2012 08:35:40 +0000")
References: <E1SRftU-0002rz-5g@vcs.savannah.gnu.org>
Date: Tue, 08 May 2012 15:56:14 +0200
Message-ID: <874nrq7p4x.fsf@rho.meyering.net>
Lines: 37
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 13:56:28 -0000

Somehow I managed to push this change.  Not only does it lack a
ChangeLog entry, but it should have been included as part of Paul's
upcoming stat.st_size-guard-improving changes.  It shouldn't have been
committed separately.  I did commit it locally, just to have a record
of it, but did not intend to push it.

Sorry.

...
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=452dc6b5ef39d3a9c26208d960085fe992f4c3b7
...
> - Log -----------------------------------------------------------------
> commit 452dc6b5ef39d3a9c26208d960085fe992f4c3b7
> Author: Jim Meyering <meyering@redhat.com>
> Date:   Mon May 7 11:20:45 2012 +0200
>
>     maint: new function: usable_st_size
>
> -----------------------------------------------------------------------
> Summary of changes:
>  src/system.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/src/system.h b/src/system.h
> index 93d48c5..e3d3156 100644
> --- a/src/system.h
> +++ b/src/system.h
> @@ -601,6 +601,13 @@ bad_cast (char const *s)
>    return (char *) s;
>  }
>
> +/* Return a boolean indicating whether SB->st_size is defined.  */
> +static inline bool
> +usable_st_size (struct stat const *sb)
> +{
> +  return S_ISREG (sb->st_mode) || S_TYPEISSHM (sb) || S_TYPEISTMO (sb);
> +}


From MAILER-DAEMON Tue May 08 10:21:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRlIU-0002DB-2r
	for mharc-coreutils@gnu.org; Tue, 08 May 2012 10:21:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46897)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SRlIO-0002Cz-F0
	for coreutils@gnu.org; Tue, 08 May 2012 10:21:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SRlII-0002av-CE
	for coreutils@gnu.org; Tue, 08 May 2012 10:21:44 -0400
Received: from mx1.redhat.com ([209.132.183.28]:1755)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>)
	id 1SRlI4-0002ZF-JK; Tue, 08 May 2012 10:21:24 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q48ELDRv029624
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 8 May 2012 10:21:13 -0400
Received: from [10.3.113.57] (ovpn-113-57.phx2.redhat.com [10.3.113.57])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q48ELCK3028415; Tue, 8 May 2012 10:21:12 -0400
Message-ID: <4FA92BD1.6060206@redhat.com>
Date: Tue, 08 May 2012 08:21:05 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Akim Demaille <akim.demaille@gmail.com>
Subject: Re: bug#11419: Get rid of ylwrap, and simplify yacc/lex rules
References: <BE61A329-6233-4C11-8607-A7D308E4EA1E@gmail.com>
	<4FA65491.2050002@gmail.com>
	<95EC59CC-E5D6-45C7-BB1C-269376F19CAD@gmail.com>
In-Reply-To: <95EC59CC-E5D6-45C7-BB1C-269376F19CAD@gmail.com>
X-Enigmail-Version: 1.4.1
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig8F11362940A25454D34CA074"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: bug-gnulib <bug-gnulib@gnu.org>, 11419@debbugs.gnu.org,
	Stefano Lattarini <stefano.lattarini@gmail.com>,
	bison-patches@gnu.org, Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 08 May 2012 14:21:48 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig8F11362940A25454D34CA074
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

[adding coreutils, bug-gnulib]

On 05/08/2012 04:48 AM, Akim Demaille wrote:

> This is why bison gets (in my VPATH-build where builddir is two
> levels down inside srcdir):
>=20
> #line 277 "parse-gram.y"
> #line 2271 "../../../src/parse-gram.c"
>=20
> with a properly computed relative path, it should be
> "parse-gram.c".  This is what the patch was fixing.
>=20
> This is painful and regularly results in Emacs not being able
> to find the file where the error occurred.
>=20
> This should be fixed before 2.5.1 imho.  I'll see if gnulib
> offers something to compute relative paths.

Coreutils has code to compute relative paths; used by both 'realpath'
and 'ln'; maybe it's time to graduate that to a full-blown gnulib module
now that we want to use it elsewhere.

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPqSvRAAoJEKeha0olJ0NqO2QH/idnSXEPwWwk3eI4XZGR/pzM
SX0Z/j1KSQECMOToOy2dFLPjqp9eE9bCCRewUzx/tU6iUfmRgS36iu/6pTyQm2Bs
n4+VpI+unC0EfryGNAmKuIkkCZi/Pu43yOZIfCiBB+SragE6BOQdw8dDEs1+LGV6
m/a821+prGt6O8FgUaMNvBQgixRBaGc8Hi9TH9SRQmiLnbBRwcRJ5Nyf9RUqIrSH
r5SE9CI6EehZkGJHvCw44pG/8c+WCDCOXURkultOzZOUTAcxKM3fuilBJhDPzYBO
OjTBtm6/vQbslrleFUFVkYyZJgJG44SSWM2k+JcMRCXJblitqUCmEWFDmXuo2+Q=
=Bbx/
-----END PGP SIGNATURE-----

--------------enig8F11362940A25454D34CA074--


From MAILER-DAEMON Thu May 10 04:53:11 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSP7X-0005sq-6e
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 04:53:11 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51780)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSP7R-0005rk-AK
	for coreutils@gnu.org; Thu, 10 May 2012 04:53:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSP7K-0005qQ-NV
	for coreutils@gnu.org; Thu, 10 May 2012 04:53:04 -0400
Received: from mx.meyering.net ([88.168.87.75]:40942)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSP7K-0005qF-Gk
	for coreutils@gnu.org; Thu, 10 May 2012 04:52:58 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 7C6D8600C4
	for <coreutils@gnu.org>; Thu, 10 May 2012 10:52:56 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] scripts: encourage use of shorter "bugs.gnu.org" in bug URLs
Date: Thu, 10 May 2012 10:52:56 +0200
Message-ID: <87r4usto2f.fsf@rho.meyering.net>
Lines: 28
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:53:09 -0000

I prefer the slightly shorter bugs.gnu.org host name in bug URLs.
This change makes our commit-message hook encourage that policy:

>From 1505812eca56994f7d6d40579133f80602564726 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 10 May 2012 10:24:02 +0200
Subject: [PATCH] scripts: encourage use of shorter "bugs.gnu.org" in bug URLs

* scripts/git-hooks/commit-msg: Also ding debbugs.gnu.org URLs.
---
 scripts/git-hooks/commit-msg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg
index e1bb382..3c1c63d 100755
--- a/scripts/git-hooks/commit-msg
+++ b/scripts/git-hooks/commit-msg
@@ -122,7 +122,7 @@ sub check_msg($$)
   $buf =~ m!https?://bugzilla\.redhat\.com/show_bug\.cgi\?id=(\d+)!s
     and return "use shorter http://bugzilla.redhat.com/$1";

-  $buf =~ m!https?://debbugs\.gnu\.org/cgi/bugreport\.cgi\?bug=(\d+)!s
+  $buf =~ m!https?://debbugs\.gnu\.org/(?:cgi/bugreport\.cgi\?bug=)?(\d+)!s
     and return "use shorter http://bugs.gnu.org/$1";

   return '';
--
1.7.10.1.487.ga3935e6


From MAILER-DAEMON Thu May 10 09:54:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSToz-000191-DY
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 09:54:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54645)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSTos-00016j-7I
	for coreutils@gnu.org; Thu, 10 May 2012 09:54:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSToi-000306-KR
	for coreutils@gnu.org; Thu, 10 May 2012 09:54:13 -0400
Received: from mx.meyering.net ([88.168.87.75]:41741)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSToi-0002zO-DO
	for coreutils@gnu.org; Thu, 10 May 2012 09:54:04 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 98A0C6026C
	for <coreutils@gnu.org>; Thu, 10 May 2012 15:54:01 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] stat,tail: recognize new FS types: bdevfs, inodefs, qnx6
Date: Thu, 10 May 2012 15:54:01 +0200
Message-ID: <87zk9grvk6.fsf@rho.meyering.net>
Lines: 84
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:54:20 -0000

Going through the coreutils README-release procedure,
I ran "make -C src fs-magic-compare" on my handy Fedora rawhide VM,
and it printed these new symbol names:

# define S_MAGIC_BDEVFS 0x62646576
# define S_MAGIC_BINFMTFS 0x42494E4D
# define S_MAGIC_MTD_INODE_FS 0x11307854
# define S_MAGIC_QNX6 0x68191122

One is just a renaming, but the other three are indeed new.
Well, they're new names, at least.

The linux kernel folks recently gave names in their magic.h to
these previously-open-coded literal hexadecimal strings.

Seeing QNX4 and QNX6, I wondered if there were a well known magic number
for a QNX5 file system type, but a few quick searches suggest not.

>From abb809e346f7a1d240e519337db0089dcdebc154 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 10 May 2012 15:46:08 +0200
Subject: [PATCH] stat,tail: recognize new FS types: bdevfs, inodefs, qnx6

* src/stat.c (human_fstype) [__linux__]: Add 'case's for these local
file system types: bdevfs (0x62646576), inodefs (0x42494E4D),
qnx6 (0x68191122).
Now that the kernel has a name for S_MAGIC_BINFMTFS, use
theirs in place of our S_MAGIC_BINFMT_MISC.
* NEWS (New features): Mention it.
---
 NEWS       | 2 ++
 src/stat.c | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index e56f8fa..9bed8ba 100644
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,8 @@ GNU coreutils NEWS                                    -*- outline -*-

   fmt now accepts the --goal=WIDTH (-g) option.

+  stat -f recognize new file system types: bdevfs, inodefs, qnx6
+
 ** Changes in behavior

   cp,mv,install,cat,split: now read and write a minimum of 64KiB at a time.
diff --git a/src/stat.c b/src/stat.c
index d001cda..c6747a6 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -249,9 +249,11 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "autofs";
     case S_MAGIC_BEFS: /* 0x42465331 local */
       return "befs";
+    case S_MAGIC_BDEVFS: /* 0x62646576 local */
+      return "bdevfs";
     case S_MAGIC_BFS: /* 0x1BADFACE local */
       return "bfs";
-    case S_MAGIC_BINFMT_MISC: /* 0x42494E4D local */
+    case S_MAGIC_BINFMTFS: /* 0x42494E4D local */
       return "binfmt_misc";
     case S_MAGIC_BTRFS: /* 0x9123683E local */
       return "btrfs";
@@ -303,6 +305,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "hpfs";
     case S_MAGIC_HUGETLBFS: /* 0x958458F6 local */
       return "hugetlbfs";
+    case S_MAGIC_MTD_INODE_FS: /* 0x11307854 local */
+      return "inodefs";
     case S_MAGIC_INOTIFYFS: /* 0x2BAD1DEA local */
       return "inotifyfs";
     case S_MAGIC_ISOFS: /* 0x9660 local */
@@ -360,6 +364,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "pstorefs";
     case S_MAGIC_QNX4: /* 0x002F local */
       return "qnx4";
+    case S_MAGIC_QNX6: /* 0x68191122 local */
+      return "qnx6";
     case S_MAGIC_RAMFS: /* 0x858458F6 local */
       return "ramfs";
     case S_MAGIC_REISERFS: /* 0x52654973 local */
--
1.7.10.1.487.ga3935e6


From MAILER-DAEMON Thu May 10 09:59:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSTtz-0002f3-MD
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 09:59:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54718)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSTtp-0002el-0X
	for coreutils@gnu.org; Thu, 10 May 2012 09:59:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSTtf-00058f-4S
	for coreutils@gnu.org; Thu, 10 May 2012 09:59:20 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:62367)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSTte-00058E-Uc
	for coreutils@gnu.org; Thu, 10 May 2012 09:59:11 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAE3Jq09tTFn6/2dsb2JhbAANN7cnAQEBBDIBRhALDQQDAQIBCSUPAj4IBg0BBQIBARbDP4sSCYYgBJwUjROBVQ
Received: from unknown (HELO [192.168.1.79]) ([109.76.89.250])
	by mail2.vodafone.ie with ESMTP; 10 May 2012 14:59:09 +0100
Message-ID: <4FABC9AC.50708@draigBrady.com>
Date: Thu, 10 May 2012 14:59:08 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] stat,tail: recognize new FS types: bdevfs, inodefs, qnx6
References: <87zk9grvk6.fsf@rho.meyering.net>
In-Reply-To: <87zk9grvk6.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:59:30 -0000

On 05/10/2012 02:54 PM, Jim Meyering wrote:
> Going through the coreutils README-release procedure,
> I ran "make -C src fs-magic-compare" on my handy Fedora rawhide VM,
> and it printed these new symbol names:
> 
> # define S_MAGIC_BDEVFS 0x62646576
> # define S_MAGIC_BINFMTFS 0x42494E4D
> # define S_MAGIC_MTD_INODE_FS 0x11307854
> # define S_MAGIC_QNX6 0x68191122
> 
> One is just a renaming, but the other three are indeed new.
> Well, they're new names, at least.
> 
> The linux kernel folks recently gave names in their magic.h to
> these previously-open-coded literal hexadecimal strings.
> 
> Seeing QNX4 and QNX6, I wondered if there were a well known magic number
> for a QNX5 file system type, but a few quick searches suggest not.
> 
>>From abb809e346f7a1d240e519337db0089dcdebc154 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Thu, 10 May 2012 15:46:08 +0200
> Subject: [PATCH] stat,tail: recognize new FS types: bdevfs, inodefs, qnx6
> 
> * src/stat.c (human_fstype) [__linux__]: Add 'case's for these local
> file system types: bdevfs (0x62646576), inodefs (0x42494E4D),
> qnx6 (0x68191122).
> Now that the kernel has a name for S_MAGIC_BINFMTFS, use
> theirs in place of our S_MAGIC_BINFMT_MISC.
> * NEWS (New features): Mention it.
> ---
>  NEWS       | 2 ++
>  src/stat.c | 8 +++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/NEWS b/NEWS
> index e56f8fa..9bed8ba 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -32,6 +32,8 @@ GNU coreutils NEWS                                    -*- outline -*-
> 
>    fmt now accepts the --goal=WIDTH (-g) option.
> 
> +  stat -f recognize new file system types: bdevfs, inodefs, qnx6
                      ^s

Otherwise looks good.

cheers,
Pádraig.


From MAILER-DAEMON Thu May 10 10:13:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSU7g-0007pN-9I
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 10:13:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40258)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSU7d-0007og-IF
	for coreutils@gnu.org; Thu, 10 May 2012 10:13:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSU7X-00037z-GR
	for coreutils@gnu.org; Thu, 10 May 2012 10:13:37 -0400
Received: from mx.meyering.net ([88.168.87.75]:41800)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSU7X-000379-9e
	for coreutils@gnu.org; Thu, 10 May 2012 10:13:31 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 5E25560094;
	Thu, 10 May 2012 16:13:28 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: [PATCH] stat,tail: recognize new FS types: bdevfs, inodefs, qnx6
In-Reply-To: <4FABC9AC.50708@draigBrady.com> (=?iso-8859-1?Q?=22P=E1draig?=
	Brady"'s message of "Thu, 10 May 2012 14:59:08 +0100")
References: <87zk9grvk6.fsf@rho.meyering.net> <4FABC9AC.50708@draigBrady.com>
Date: Thu, 10 May 2012 16:13:28 +0200
Message-ID: <87r4usrunr.fsf@rho.meyering.net>
Lines: 8
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:13:38 -0000

P=E1draig Brady wrote:
> On 05/10/2012 02:54 PM, Jim Meyering wrote:
...
>> +  stat -f recognize new file system types: bdevfs, inodefs, qnx6
>                       ^s
> Otherwise looks good.

Thanks!


From MAILER-DAEMON Thu May 10 10:24:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSUIY-0001nw-34
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 10:24:54 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56579)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSUIW-0001nq-0g
	for coreutils@gnu.org; Thu, 10 May 2012 10:24:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSUIP-0007kR-LR
	for coreutils@gnu.org; Thu, 10 May 2012 10:24:51 -0400
Received: from mx.meyering.net ([88.168.87.75]:41837)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSUIP-0007jx-EW
	for coreutils@gnu.org; Thu, 10 May 2012 10:24:45 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 3607260094
	for <coreutils@gnu.org>; Thu, 10 May 2012 16:24:44 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: misc/tty-eof: increase timeout to avoid unwarranted
	failure
Date: Thu, 10 May 2012 16:24:44 +0200
Message-ID: <87lil0ru4z.fsf@rho.meyering.net>
Lines: 85
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:24:53 -0000


The misc/tty-eof test would fail infrequently (just enough to be
annoying) maybe 1 in 5 or 10, yet not enough to investigate...
until today, when the failure interfered with making a release.

Until recently that test was always skipped (and hence even easier to ignore)
for me because I had not installed the perl-Expect package that it requires.

It would fail like this:

FAIL: misc/tty-eof
==================
F: 1: YSBiCg==
F: 1: a b
F: 1: 780509149 4
F: 1: a b
F: 1: a b
F: 1: a b
F: 1: a b
F: 1: a b
F: 1: 7557d2f3a6ad1a3a8ebd23a94ab0c642  -
F: 1:      1    a b
F: 1: 0000000 020141 005142
F: 1: a b
F: 1:
F: 1:                                        a b
F: 1: 90ce62edf2fe4940e041a68b13e7b5f9d02bbf51  -
F: 1: afa36e61f94d23fa2869cc1ca3c7a0855ecb7f3d3305e446e7566d1f  -
F: 1: 01186fcf04b4b447f393e552964c08c7b419c1ad7a25c342a0b631b1967d3a27  -
F: 1: adf433b1ea7db8dec7ca64f88f4c8bc5403a1ac1d3540ae0229c79fc8d84e3db4dd9616605c
61215ee7c50da0a97d0e2  -
F: 1: ae206702ea661de518d6451ee5b76fe0120429239b73838301991a294bc2628c0b9bbe79d06
b1ab0610a66e9ce7d7e16cdcbdc244058befefc03c5d9cce54357  -
F: 1: a b
F: 1: a b
tty-eof: sort didn't exit after ^D from standard input
F: 1: 08271     1
F: 1: a b
F: 1: a b
F: 1: a b
F: 1: a
F: 1: a b
F: 1: a b
F: 1:       1       2       4

The part that matters is that sort failed to exit.
What it really means is that sort+^D failed to exit before
the 1-second timeout expired.  That gives it away, since
this is reproducible only when I'm running hundreds of tests via
"make -j20 check", and never in isolation.

The timeout was too short.

I'm running 50 or 100 parallel builds with the new, longer timeout.
40 passes and counting...

If they all pass, I'll push the following:

>From e41761321d7e7c8d9e40c7a9d19af80774351e43 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 10 May 2012 16:20:38 +0200
Subject: [PATCH] tests: misc/tty-eof: increase timeout to avoid unwarranted
 failure

* tests/misc/tty-eof: Increase timeout from 1s to 10s, to avoid
unwarranted failure under heavy load.
---
 tests/misc/tty-eof | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/misc/tty-eof b/tests/misc/tty-eof
index 9e86613..e9eed2e 100755
--- a/tests/misc/tty-eof
+++ b/tests/misc/tty-eof
@@ -75,7 +75,7 @@ $@
       $exp->expect (0, '-re', "^a b\\r?\$");
       my $found = $exp->expect (1, '-re', "^.+\$");
       $found and warn "F: $found: " . $exp->exp_match () . "\n";
-      $exp->expect(1, 'eof');
+      $exp->expect(10, 'eof');
       # Expect no output from cut, since we gave it no input.
       defined $found || $cmd =~ /^cut/
         or (warn "$ME: $cmd didn't produce expected output\n"),
--
1.7.10.1.487.ga3935e6


From MAILER-DAEMON Thu May 10 11:12:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSV2u-0008Ga-PU
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 11:12:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44153)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSV2m-0008Df-Et
	for coreutils@gnu.org; Thu, 10 May 2012 11:12:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSV2g-0005eF-Kq
	for coreutils@gnu.org; Thu, 10 May 2012 11:12:40 -0400
Received: from mx.meyering.net ([88.168.87.75]:41964)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSV2g-0005dk-D6
	for coreutils@gnu.org; Thu, 10 May 2012 11:12:34 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 7C6D360094
	for <coreutils@gnu.org>; Thu, 10 May 2012 17:12:32 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: Re: [PATCH] tests: misc/tty-eof: increase timeout to avoid
	unwarranted failure
In-Reply-To: <87lil0ru4z.fsf@rho.meyering.net> (Jim Meyering's message of
	"Thu, 10 May 2012 16:24:44 +0200")
References: <87lil0ru4z.fsf@rho.meyering.net>
Date: Thu, 10 May 2012 17:12:32 +0200
Message-ID: <87fwb8rrxb.fsf@rho.meyering.net>
Lines: 85
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:12:47 -0000

Jim Meyering wrote:

> The misc/tty-eof test would fail infrequently (just enough to be
> annoying) maybe 1 in 5 or 10, yet not enough to investigate...
> until today, when the failure interfered with making a release.
>
> Until recently that test was always skipped (and hence even easier to ignore)
> for me because I had not installed the perl-Expect package that it requires.
>
> It would fail like this:
>
> FAIL: misc/tty-eof
> ==================
...
> tty-eof: sort didn't exit after ^D from standard input
...
>
> The part that matters is that sort failed to exit.
> What it really means is that sort+^D failed to exit before
> the 1-second timeout expired.  That gives it away, since
> this is reproducible only when I'm running hundreds of tests via
> "make -j20 check", and never in isolation.
>
> The timeout was too short.
>
> I'm running 50 or 100 parallel builds with the new, longer timeout.
> 40 passes and counting...
>
> If they all pass, I'll push the following:

With one small addition: I moved the test name "up" so that it
is started earlier:

>From 3a696dee7232dedbb8c7031d2547af20bb29645f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 10 May 2012 16:20:38 +0200
Subject: [PATCH] tests: misc/tty-eof: increase timeout to avoid unwarranted
 failure

* tests/misc/tty-eof: Increase timeout from 1s to 10s, to avoid
unwarranted failure under heavy load.
* tests/Makefile.am (TESTS): Move misc/tty-eof "up" to nearer the
beginning of the list (from near the middle) so that it is started
earlier in parallel test runs.  Otherwise, it would frequently be
among the last two tests to complete.
---
 tests/Makefile.am  | 2 +-
 tests/misc/tty-eof | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index ca19051..a4370a6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -87,6 +87,7 @@ TESTS =						\
   rm/ext3-perf					\
   rm/cycle					\
   cp/link-heap					\
+  misc/tty-eof					\
   tail-2/inotify-hash-abuse			\
   tail-2/inotify-hash-abuse2			\
   tail-2/F-vs-missing				\
@@ -303,7 +304,6 @@ TESTS =						\
   misc/truncate-parameters			\
   misc/truncate-relative			\
   misc/tsort					\
-  misc/tty-eof					\
   misc/unexpand					\
   misc/uniq					\
   misc/uniq-perf				\
diff --git a/tests/misc/tty-eof b/tests/misc/tty-eof
index 9e86613..e9eed2e 100755
--- a/tests/misc/tty-eof
+++ b/tests/misc/tty-eof
@@ -75,7 +75,7 @@ $@
       $exp->expect (0, '-re', "^a b\\r?\$");
       my $found = $exp->expect (1, '-re', "^.+\$");
       $found and warn "F: $found: " . $exp->exp_match () . "\n";
-      $exp->expect(1, 'eof');
+      $exp->expect(10, 'eof');
       # Expect no output from cut, since we gave it no input.
       defined $found || $cmd =~ /^cut/
         or (warn "$ME: $cmd didn't produce expected output\n"),
--
1.7.10.1.487.ga3935e6


From MAILER-DAEMON Thu May 10 11:17:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSV73-0000Ll-Te
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 11:17:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55815)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSV6t-0000JI-Gy
	for coreutils@gnu.org; Thu, 10 May 2012 11:17:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSV6j-0007Yz-8X
	for coreutils@gnu.org; Thu, 10 May 2012 11:16:55 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:28695)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSV6j-0007Y7-2Z
	for coreutils@gnu.org; Thu, 10 May 2012 11:16:45 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAN/aq09tTFn6/2dsb2JhbAANN7cnAQEBBCdSEAsNBAMBAgEJFg8JAwIBAgE9CAYNAQUCAQHDU4sShikElw6FBo0T
Received: from unknown (HELO [192.168.1.79]) ([109.76.89.250])
	by mail2.vodafone.ie with ESMTP; 10 May 2012 16:16:43 +0100
Message-ID: <4FABDBDA.2080807@draigBrady.com>
Date: Thu, 10 May 2012 16:16:42 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] tests: misc/tty-eof: increase timeout to avoid unwarranted
	failure
References: <87lil0ru4z.fsf@rho.meyering.net> <87fwb8rrxb.fsf@rho.meyering.net>
In-Reply-To: <87fwb8rrxb.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:17:05 -0000

On 05/10/2012 04:12 PM, Jim Meyering wrote:
> Jim Meyering wrote:
> 
>> The misc/tty-eof test would fail infrequently (just enough to be
>> annoying) maybe 1 in 5 or 10, yet not enough to investigate...
>> until today, when the failure interfered with making a release.
>>
>> Until recently that test was always skipped (and hence even easier to ignore)
>> for me because I had not installed the perl-Expect package that it requires.
>>
>> It would fail like this:
>>
>> FAIL: misc/tty-eof
>> ==================
> ...
>> tty-eof: sort didn't exit after ^D from standard input
> ...
>>
>> The part that matters is that sort failed to exit.
>> What it really means is that sort+^D failed to exit before
>> the 1-second timeout expired.  That gives it away, since
>> this is reproducible only when I'm running hundreds of tests via
>> "make -j20 check", and never in isolation.
>>
>> The timeout was too short.
>>
>> I'm running 50 or 100 parallel builds with the new, longer timeout.
>> 40 passes and counting...
>>
>> If they all pass, I'll push the following:
> 
> With one small addition: I moved the test name "up" so that it
> is started earlier:
> 
>>From 3a696dee7232dedbb8c7031d2547af20bb29645f Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Thu, 10 May 2012 16:20:38 +0200
> Subject: [PATCH] tests: misc/tty-eof: increase timeout to avoid unwarranted
>  failure
> 
> * tests/misc/tty-eof: Increase timeout from 1s to 10s, to avoid
> unwarranted failure under heavy load.
> * tests/Makefile.am (TESTS): Move misc/tty-eof "up" to nearer the
> beginning of the list (from near the middle) so that it is started
> earlier in parallel test runs.  Otherwise, it would frequently be
> among the last two tests to complete.
> ---
>  tests/Makefile.am  | 2 +-
>  tests/misc/tty-eof | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index ca19051..a4370a6 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -87,6 +87,7 @@ TESTS =						\
>    rm/ext3-perf					\
>    rm/cycle					\
>    cp/link-heap					\
> +  misc/tty-eof					\
>    tail-2/inotify-hash-abuse			\
>    tail-2/inotify-hash-abuse2			\
>    tail-2/F-vs-missing				\
> @@ -303,7 +304,6 @@ TESTS =						\
>    misc/truncate-parameters			\
>    misc/truncate-relative			\
>    misc/tsort					\
> -  misc/tty-eof					\
>    misc/unexpand					\
>    misc/uniq					\
>    misc/uniq-perf				\
> diff --git a/tests/misc/tty-eof b/tests/misc/tty-eof
> index 9e86613..e9eed2e 100755
> --- a/tests/misc/tty-eof
> +++ b/tests/misc/tty-eof
> @@ -75,7 +75,7 @@ $@
>        $exp->expect (0, '-re', "^a b\\r?\$");
>        my $found = $exp->expect (1, '-re', "^.+\$");
>        $found and warn "F: $found: " . $exp->exp_match () . "\n";
> -      $exp->expect(1, 'eof');
> +      $exp->expect(10, 'eof');
>        # Expect no output from cut, since we gave it no input.
>        defined $found || $cmd =~ /^cut/
>          or (warn "$ME: $cmd didn't produce expected output\n"),
> --
> 1.7.10.1.487.ga3935e6
> 
> 

looks good


From MAILER-DAEMON Thu May 10 15:37:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSZAx-0004uz-Hj
	for mharc-coreutils@gnu.org; Thu, 10 May 2012 15:37:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56795)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSZAt-0004nH-Iz
	for coreutils@gnu.org; Thu, 10 May 2012 15:37:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SSZAr-0004Tt-JM
	for coreutils@gnu.org; Thu, 10 May 2012 15:37:19 -0400
Received: from mx.meyering.net ([88.168.87.75]:42689)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1SSZAm-0004Ru-VI; Thu, 10 May 2012 15:37:13 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id D5313601C8;
	Thu, 10 May 2012 21:37:10 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: info-gnu@gnu.org
Subject: coreutils-8.17 released [stable]
Mail-Followup-To: bug-coreutils@gnu.org
Date: Thu, 10 May 2012 21:37:03 +0200
Message-ID: <87ehqrrfog.fsf@rho.meyering.net>
Lines: 111
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha256; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coordinator@translationproject.org, coreutils@gnu.org,
	coreutils-announce@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 19:37:21 -0000

--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

This is to announce coreutils-8.17, a stable release.
There have been 53 commits by 9 people in the 6 weeks since 8.16.
The changes are small and all seem safe.

See the NEWS below for a brief summary.

Thanks to everyone who has contributed!
The following people contributed changes to this release:

  Andreas Schwab (1)
  Bernhard Voelker (2)
  Bruce Korb (1)
  Jim Meyering (38)
  Karl Berry (1)
  Kevin Lyda (1)
  Paul Eggert (4)
  P=E1draig Brady (4)
  Stefano Lattarini (1)

Jim [on behalf of the coreutils maintainers]
=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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Here is the GNU coreutils home page:
    http://gnu.org/s/coreutils/

For a summary of changes and contributors, see:
  http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dshortlog;h=3Dv8.17
or run this command from a git-cloned coreutils directory:
  git shortlog v8.16..v8.17

To summarize the 126 gnulib-related changes, run these commands
From=20a git-cloned coreutils directory:
  git checkout v8.17
  git submodule summary v8.16

Here are the compressed sources and a GPG detached signature[*]:
  http://ftp.gnu.org/gnu/coreutils/coreutils-8.17.tar.xz
  http://ftp.gnu.org/gnu/coreutils/coreutils-8.17.tar.xz.sig

Use a mirror for higher download bandwidth:
  http://ftpmirror.gnu.org/coreutils/coreutils-8.17.tar.xz
  http://ftpmirror.gnu.org/coreutils/coreutils-8.17.tar.xz.sig

[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact.  First, be sure to download both the .sig file
and the corresponding tarball.  Then, run a command like this:

  gpg --verify coreutils-8.17.tar.xz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

  gpg --keyserver keys.gnupg.net --recv-keys 7FD9FCCB000BEEEE

and rerun the 'gpg --verify' command.

This release was bootstrapped with the following tools:
  Autoconf 2.69.1-2d4eb
  Automake 1.12a
  Gnulib v0.0-7375-ga3a0496
  Bison 2.5.834-2eeb1

=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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
NEWS

* Noteworthy changes in release 8.17 (2012-05-10) [stable]

** Bug fixes

  id and groups, when invoked with no user name argument, would print
  the default group ID listed in the password database, and sometimes
  that ID would be neither real nor effective.  For example, when run
  set-GID, or in a session for which the default group has just been
  changed, the new group ID would be listed, even though it is not
  yet effective. [bug introduced in coreutils-8.1]

  cp S D is no longer subject to a race: if an existing D were removed
  between the initial stat and subsequent open-without-O_CREATE, cp would
  fail with a confusing diagnostic saying that the destination, D, was not
  found.  Now, in this unusual case, it retries the open (but with O_CREATE=
),
  and hence usually succeeds.  With NFS attribute caching, the condition
  was particularly easy to trigger, since there, the removal of D could
  precede the initial stat.  [This bug was present in "the beginning".]

  split --number=3DC /dev/null no longer appears to infloop on GNU/Hurd
  [bug introduced in coreutils-8.8]

  stat no longer reports a negative file size as a huge positive number.
  [bug present since 'stat' was introduced in fileutils-4.1.9]

** New features

  split and truncate now allow any seekable files in situations where
  the file size is needed, instead of insisting on regular files.

  fmt now accepts the --goal=3DWIDTH (-g) option.

  stat -f recognizes new file system types: bdevfs, inodefs, qnx6

** Changes in behavior

  cp,mv,install,cat,split: now read and write a minimum of 64KiB at a time.
  This was previously 32KiB and increasing to 64KiB was seen to increase
  throughput by about 10% when reading cached files on 64 bit GNU/Linux.

  cp --attributes-only no longer truncates any existing destination file,
  allowing for more general copying of attributes from one file to another.

=2D----
also posted as: http://savannah.gnu.org/forum/forum.php?forum_id=3D7230

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQIbBAEBCAAGBQJPrBjmAAoJEH/Z/MsAC+7ui0IP+JaCXEklDhAhLPjqPbRPA5qo
VVdcaLkiNsuBi0JKUbGh7EeXHAdgg1LwxaOMkKKmRIWXC3LT6D/N7iQg8CJ3DMUh
vuJhfsHMH0sbfT2zPzLGSx8l+pA//2auGNrU0gUoTjcyfyjKfpGBn4KXbx2ImFSz
I/nx1T2phAxUugNrh9ngGi0oxJaS9/+iN3XGHf4vJStWbzlN60LYFua+JZAa1gpe
vYv7BGD90/Z+PkVJR/FsQvHAZK2IFR0sRxI1reYKBOornnGs3jPODXGtaLM1+REo
TxsULXu1W4kRgQOnQ1UYbvpaDbwrmeoQYnaCfpUgGiJ4EmAXU4LXWBCGAKKdB963
Uxib6kdIN6Y4QyGdDH6eqvrvfTgBuYFNck8awucBjHlmb/VBZ5n30Zn7yfE1Te54
D8+4+ThsUGknftKkxklRhA7kgyzguCWSygtchEsP51FJJy6NUNPShXfA2/9QOzpu
6W6y/+i5+ZaPmMa+d2p5TP2diDTeREYdCE2VWAa/KF3z6tdAh0MesPXupTMz2Q3f
JdkGEH7CRCzhTk09fW/1raXpiYD0ti2S2oArRt8Fu72Ow1zjnicN9SCOmz8SxvAj
RFIuCO83+Gazv04Aeg+ecnHts7wgc2yNCSGfUeU9+9yoAyIe62kJFHcXVKj50bfE
KKbdKzMVlANb9rWaWuw=
=cfrg
-----END PGP SIGNATURE-----
--=-=-=--


From MAILER-DAEMON Fri May 11 11:07:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSrRU-0005cf-05
	for mharc-coreutils@gnu.org; Fri, 11 May 2012 11:07:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48218)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <markk@clara.co.uk>) id 1SSrN6-0004rC-JX
	for coreutils@gnu.org; Fri, 11 May 2012 11:03:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <markk@clara.co.uk>) id 1SSrN3-0007jZ-RC
	for coreutils@gnu.org; Fri, 11 May 2012 11:03:08 -0400
Received: from claranet-outbound-smtp06.uk.clara.net ([195.8.89.39]:43845)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <markk@clara.co.uk>) id 1SSrN3-0007ed-G8
	for coreutils@gnu.org; Fri, 11 May 2012 11:03:05 -0400
Received: from webmail02.mail.eu.clara.net ([213.253.3.102]:60384
	helo=webmail.clara.net)
	by relay06.mail.eu.clara.net (relay.clara.net [213.253.3.46]:1025)
	with esmtpa (authdaemon_plain:markk@clara.co.uk) id 1SSrMz-0002vD-Jj 
	(return-path <markk@clara.co.uk>); Fri, 11 May 2012 15:03:01 +0000
Received: from 2.27.247.8 (SquirrelMail authenticated user markk@clara.co.uk)
	by ssl-webmail-vh.clara.net with HTTP;
	Fri, 11 May 2012 16:03:01 +0100
Message-ID: <90cdbf76a2ca009ab20d719e55385197.squirrel@ssl-webmail-vh.clara.net>
Date: Fri, 11 May 2012 16:03:01 +0100
Subject: [RFC/PATCH] cp: Add option to pre-allocate space for files
From: "Mark" <markk@clara.co.uk>
To: coreutils@gnu.org
User-Agent: SquirrelMail/1.4.21
MIME-Version: 1.0
Content-Type: multipart/mixed;boundary="----=_20120511160301_29450"
X-Priority: 3 (Normal)
Importance: Normal
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 195.8.89.39
X-Mailman-Approved-At: Fri, 11 May 2012 11:07:38 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 11 May 2012 15:03:15 -0000

------=_20120511160301_29450
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Hi,

Here's a patch for cp which adds a new --preallocate option. When
specified, cp allocates disk space for the destination file before writing
data. It uses fallocate() with FALLOC_FL_KEEP_SIZE on Linux, falling back
to posix_fallocate() if that fails.

Benefits of preallocation:
 - Disk fragmentation can be greatly reduced. That means faster file
access and less filesystem overhead (fewer extents).
 - Recovering data after filesystem corruption should be more successful,
since files are more likely to be contiguous.
 - If you're e.g. copying a virtual machine disk image file, the
destination should be (almost) contiguous, meaning that running a disk
optimiser/defragmenter in the guest OS would work as it should (i.e.
improve performance).

This is a very preliminary patch for testing. Hopefully someone will find
it useful. And hopefully someone who (a) has a clue when it comes to C
programming, and (b) is familiar with the coreutils source (I'm neither)
can work from this to produce something which could be included in a
future release.

Note that posix_fallocate() sets the destination file size. If your system
doesn't support fallocate() with FALLOC_FL_KEEP_SIZE, you can't e.g. do
"ls -l destfilename" to monitor the progress of a large file copy; the
length shown will always be the final length.

Pre-allocating space can defeat the object of --sparse=always (or the
default sparse-checking heuristic). If copying files with large holes you
probably won't want to use --preallocate. If you do, regions in the
destination corresponding to holes in the source will be allocated but
unwritten. You'll lose the disk-space-saving benefit, but keep the
fast-reading-of-holes benefit. On the other hand, that feature could be
useful sometimes.

In the general case of copying non-sparse files, it should be beneficial
to use --preallocate. However on some systems, when the destination
filesystem does not support pre-allocation (e.g. FAT32), the
implementation of posix_fallocate() might try to fill the region to be
pre-allocated with zeros. That would double copy time for no benefit.

To-do list:
 - Add --preallocate option to mv as well
 - Should the option name be changed to --pre-allocate?
 - Maybe have an option to tell cp to pre-allocate space for all
destination files in one go, rather than pre-allocating space for each
individual file before copying?
 - Check the error code that fallocate() returns. If it says the
filesystem does not support fallocate(), don't call it again for every
other file being copied.
 - Better handling of sparse files, e.g. don't call fallocate() if source
file is sparse and --sparse=always is given.
 - If pre-allocation fails due to insufficient disk space, cp prints a
message and continues. So typically it will fill up the disk then abort
with an out-of-disk-space error. It would be nice to be able to tell cp
to abort when a pre-allocation fails, so it can exit without wasting
time.

The attached patch is based on coreutils 8.17.


-- Mark


------=_20120511160301_29450
Content-Type: text/plain; name="preallocate_patch.txt"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="preallocate_patch.txt"

diff -Naur coreutils-8.17/src/copy.c my_coreutils-8.17/src/copy.c
--- coreutils-8.17/src/copy.c	2012-05-08 09:34:30.000000000 +0100
+++ my_coreutils-8.17/src/copy.c	2012-05-11 13:52:57.925208868 +0100
@@ -23,6 +23,17 @@
 #include <sys/types.h>
 #include <selinux/selinux.h>
 
+/* TODO: Make this a configure/makefile option. */
+#define USE_LINUX_FALLOCATE 1
+
+/* For FALLOC_FL_KEEP_SIZE definition. Don't include linux/falloc.h because
+   that might not exist on some systems. */
+#ifdef USE_LINUX_FALLOCATE
+#ifndef FALLOC_FL_KEEP_SIZE
+#define FALLOC_FL_KEEP_SIZE 1
+#endif
+#endif
+
 #if HAVE_HURD_H
 # include <hurd.h>
 #endif
@@ -1050,6 +1061,37 @@
       buf_alloc = xmalloc (buf_size + buf_alignment_slop);
       buf = ptr_align (buf_alloc, buf_alignment);
 
+      /* Allocate space for the destination file if user specified the
+         --preallocate option.
+         TODO: Add an option to have cp abort if unable to allocate space,
+         instead of just printing a message. */
+
+      /* On Linux, we can use fallocate() with FALLOC_FL_KEEP_SIZE to pre-
+         allocate space without changing the apparent file size. */
+      if (x->preallocate)
+        {
+#ifdef USE_LINUX_FALLOCATE
+          if (fallocate(dest_desc, FALLOC_FL_KEEP_SIZE, 0,
+                        src_open_sb.st_size) == 0)
+            goto allocated;
+          else
+          /* TODO: Handle different errors better. E.g. if the kernel does not
+             support FALLOC_FL_KEEP_SIZE we could retry without that flag, or
+             if the filesystem does not support fallocate() we could remember
+             that and not call fallocate() for every file copied. */
+            error (0, errno, _("pre-allocating space for %s"),
+                   quote (dst_name));
+          /* If fallocate() with FALLOC_FL_KEEP_SIZE failed, fall back to
+             posix_fallocate(). */
+#else
+          if (posix_fallocate(dest_desc, 0, src_open_sb.st_size) != 0)
+            /* posix_fallocate() does not set errno */
+            fprintf (stderr, _("%s: Could not pre-allocate space for %s"),
+                     program_name, quote (dst_name));
+#endif
+        }
+
+allocated:
       if (sparse_src)
         {
           bool normal_copy_required;
diff -Naur coreutils-8.17/src/copy.h my_coreutils-8.17/src/copy.h
--- coreutils-8.17/src/copy.h	2012-03-24 18:22:13.000000000 +0000
+++ my_coreutils-8.17/src/copy.h	2012-05-11 13:08:42.788672598 +0100
@@ -242,6 +242,9 @@
      such a symlink) and returns false.  */
   bool open_dangling_dest_symlink;
 
+  /* Use fallocate()/posix_fallocate() to pre-allocate space for files */
+  bool preallocate;
+
   /* Control creation of COW files.  */
   enum Reflink_type reflink_mode;
 
diff -Naur coreutils-8.17/src/cp.c my_coreutils-8.17/src/cp.c
--- coreutils-8.17/src/cp.c	2012-05-01 21:55:08.000000000 +0100
+++ my_coreutils-8.17/src/cp.c	2012-05-11 13:53:21.089396098 +0100
@@ -80,7 +80,8 @@
   REFLINK_OPTION,
   SPARSE_OPTION,
   STRIP_TRAILING_SLASHES_OPTION,
-  UNLINK_DEST_BEFORE_OPENING
+  UNLINK_DEST_BEFORE_OPENING,
+  PREALLOCATE_OPTION
 };
 
 /* True if the kernel is SELinux enabled.  */
@@ -90,6 +91,9 @@
    as its destination instead of the usual "e_dir/e_file." */
 static bool parents_option = false;
 
+/* For --preallocate option */
+static bool preallocate_option = false;
+
 /* Remove any trailing slashes from each SOURCE argument.  */
 static bool remove_trailing_slashes;
 
@@ -130,6 +134,7 @@
   {"one-file-system", no_argument, NULL, 'x'},
   {"parents", no_argument, NULL, PARENTS_OPTION},
   {"path", no_argument, NULL, PARENTS_OPTION},   /* Deprecated.  */
+  {"preallocate", no_argument, NULL, PREALLOCATE_OPTION},
   {"preserve", optional_argument, NULL, PRESERVE_ATTRIBUTES_OPTION},
   {"recursive", no_argument, NULL, 'R'},
   {"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING},
@@ -195,6 +200,15 @@
   -P, --no-dereference         never follow symbolic links in SOURCE\n\
 "), stdout);
       fputs (_("\
+      --preallocate            pre-allocate space for destination files before\n\
+                                 copying data. This can significantly reduce\n\
+                                 fragmentation and allows an early exit if\n\
+                                 there would not be enough free space. It can\n\
+                                 also increase the likelihood of successful\n\
+                                 data recovery after filesystem corruption\n\
+                                 since data is more likely to be contiguous.\n\
+"), stdout);
+      fputs (_("\
   -p                           same as --preserve=mode,ownership,timestamps\n\
       --preserve[=ATTR_LIST]   preserve the specified attributes (default:\n\
                                  mode,ownership,timestamps), if possible\n\
@@ -779,6 +793,7 @@
   x->one_file_system = false;
   x->reflink_mode = REFLINK_NEVER;
 
+  x->preallocate = false;
   x->preserve_ownership = false;
   x->preserve_links = false;
   x->preserve_mode = false;
@@ -1040,6 +1055,10 @@
           parents_option = true;
           break;
 
+        case PREALLOCATE_OPTION:
+          x.preallocate = true;
+          break;
+
         case 'r':
         case 'R':
           x.recursive = true;
diff -Naur coreutils-8.17/src/mv.c my_coreutils-8.17/src/mv.c
--- coreutils-8.17/src/mv.c	2012-05-01 21:55:08.000000000 +0100
+++ my_coreutils-8.17/src/mv.c	2012-05-11 13:09:54.069217905 +0100
@@ -132,6 +132,7 @@
   x->stdin_tty = isatty (STDIN_FILENO);
 
   x->open_dangling_dest_symlink = false;
+  x->preallocate = false;       /* FIXME: Add support for --preallocate */
   x->update = false;
   x->verbose = false;
   x->dest_info = NULL;
------=_20120511160301_29450--




From MAILER-DAEMON Fri May 11 11:26:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSrjT-00047z-PO
	for mharc-coreutils@gnu.org; Fri, 11 May 2012 11:26:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42104)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aaron.davies@gmail.com>) id 1SSrjR-00047h-M8
	for coreutils@gnu.org; Fri, 11 May 2012 11:26:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aaron.davies@gmail.com>) id 1SSrjN-0004ZG-3E
	for coreutils@gnu.org; Fri, 11 May 2012 11:26:13 -0400
Received: from mail-qc0-f169.google.com ([209.85.216.169]:61107)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aaron.davies@gmail.com>) id 1SSrjM-0004Yt-Sp
	for coreutils@gnu.org; Fri, 11 May 2012 11:26:09 -0400
Received: by qcsd16 with SMTP id d16so2499018qcs.0
	for <coreutils@gnu.org>; Fri, 11 May 2012 08:26:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:content-type:content-transfer-encoding:subject:date:message-id
	:to:mime-version:x-mailer;
	bh=geo/95MjxFh0mNyjqEa1CDV8YvPwsQDFC+cMOUbKZRs=;
	b=f9p4Ex7DPqplakxrB3wm9lp/nz/qthd8ju2KYufj+A2t4OxWVRDyE1229ianD0F7e0
	P4C7WkdETgnXXxHvTcchbreoH2klAFJxCeQmkBhv/Tf4YNU5j95gMqsjIE7hRWElPvv4
	iBEXBCHhLyCD++eZvtPoGNmrMbGcURGHh3fKbzG3YwUTQPUcPc/DQ4Z3KMw567Tel++Q
	He51o1yCrje2beWiAZG7dxSdJevt1UavD0jHMahjTdTOJqMeboTxKKq+Z+7QW/MzLodX
	qhYO0s2DdlYbsvVDRV8Xqkn/l26PJY8mkkgrYwP9mUbVOKycBPs6W805J1GKOf3aKE7J
	8oEw==
Received: by 10.224.175.69 with SMTP id w5mr18793350qaz.49.1336749966504;
	Fri, 11 May 2012 08:26:06 -0700 (PDT)
Received: from [192.168.2.103] (pool-71-127-230-243.nwrknj.east.verizon.net.
	[71.127.230.243])
	by mx.google.com with ESMTPS id df2sm22854134qab.8.2012.05.11.08.26.04
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 11 May 2012 08:26:05 -0700 (PDT)
From: Aaron Davies <aaron.davies@gmail.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Subject: slow ls -l due to lgetxattr
Date: Fri, 11 May 2012 11:25:58 -0400
Message-Id: <20D64221-7256-4AAE-B91B-4CAE6011861F@gmail.com>
To: coreutils@gnu.org
Mime-Version: 1.0 (Apple Message framework v1084)
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.216.169
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 11 May 2012 15:26:15 -0000

`ls -l' (v. 8.12) is often brutally slow on our networked filesystems =
(nfs & afs) at work (~40s for a 1500 file directory). stracing reveals =
that almost all the time (~4.5ms per call) is spent in lgetxattr, which =
doesn't even appear to be supported on these fs's. (all the calls return =
-1 and report EOPNOTSUPP (as do all the calls to getxattr, but they only =
seem to take ~43=B5s each, slightly less than the lstat's which are =
doing the actual work (~39=B5s), so that isn't such a big deal.)

is this expected behavior?
--=20
Aaron Davies
aaron.davies@gmail.com


From MAILER-DAEMON Fri May 11 11:29:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSrmG-0004qE-4Y
	for mharc-coreutils@gnu.org; Fri, 11 May 2012 11:29:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43407)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SSrlu-0004en-Tr
	for coreutils@gnu.org; Fri, 11 May 2012 11:29:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SSrlO-0005Aw-4e
	for coreutils@gnu.org; Fri, 11 May 2012 11:28:46 -0400
Received: from mx1.redhat.com ([209.132.183.28]:61619)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SSrlN-0005AD-RR
	for coreutils@gnu.org; Fri, 11 May 2012 11:28:14 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4BFSBKc021371
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 11 May 2012 11:28:11 -0400
Received: from [10.3.113.144] (ovpn-113-144.phx2.redhat.com [10.3.113.144])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q4BFSAqX020354; Fri, 11 May 2012 11:28:11 -0400
Message-ID: <4FAD300A.1020103@redhat.com>
Date: Fri, 11 May 2012 09:28:10 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Aaron Davies <aaron.davies@gmail.com>
Subject: Re: slow ls -l due to lgetxattr
References: <20D64221-7256-4AAE-B91B-4CAE6011861F@gmail.com>
In-Reply-To: <20D64221-7256-4AAE-B91B-4CAE6011861F@gmail.com>
X-Enigmail-Version: 1.4.1
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigB7DF085E6938F2206ED137D4"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 11 May 2012 15:29:07 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigB7DF085E6938F2206ED137D4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 05/11/2012 09:25 AM, Aaron Davies wrote:
> `ls -l' (v. 8.12) is often brutally slow on our networked filesystems (=
nfs & afs) at work (~40s for a 1500 file directory). stracing reveals tha=
t almost all the time (~4.5ms per call) is spent in lgetxattr, which does=
n't even appear to be supported on these fs's. (all the calls return -1 a=
nd report EOPNOTSUPP (as do all the calls to getxattr, but they only seem=
 to take ~43=B5s each, slightly less than the lstat's which are doing the=
 actual work (~39=B5s), so that isn't such a big deal.)
>=20
> is this expected behavior?

Upgrade.  From the NEWS for 8.16 (and 8.17 is the current release), we ha=
ve:

  ls can be much more efficient, especially with large directories on fil=
e
  systems for which getfilecon-, ACL-check- and XATTR-check-induced sysca=
lls
  fail with ENOTSUP or similar.

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPrTAKAAoJEKeha0olJ0Nq6EwIAKOfss6B0dwq33Jpsvnc3qHQ
p3qkVqk8rk0gOH0NimJnwUo8ENyrt5tqTbirEFOZhntea2sIYf5mFl0VqpWx5L+e
kL9kYLlBcvX1EEMntxY7PmcQ45ovTJG1HfTIlJdjZ7Cb6ehWdsxdR10Ruraos3QS
zpOfTyzabgx2ju2dcwMKC07MBTSmbf8UBe2QWOG2pJGaF6+ZlkutcasOPqILSRst
A8gQxV2i+45usLvWj41scA9moXthXg5tY/9nutMFv3EYj8K0bzFu4uxpUiljnI73
veEMGA8StMlAzoUJ2Df7SayeC/uxI3QbSVyLjX290NvpqNC6fB8HclW2sqgvg04=
=8g6V
-----END PGP SIGNATURE-----

--------------enigB7DF085E6938F2206ED137D4--


From MAILER-DAEMON Fri May 11 11:46:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SSs2e-00014M-OL
	for mharc-coreutils@gnu.org; Fri, 11 May 2012 11:46:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46204)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSs2W-00013u-W0
	for coreutils@gnu.org; Fri, 11 May 2012 11:46:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSs2Q-00017r-EG
	for coreutils@gnu.org; Fri, 11 May 2012 11:45:56 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:58919)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SSs2P-00017E-Sh
	for coreutils@gnu.org; Fri, 11 May 2012 11:45:50 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAOgzrU9tTAC//2dsb2JhbAANN7dBAQEBAwEyAUYFCwsNCwkWDwkDAgECAUUGDQEHAQGIBbsRixeGHQSXDoUGhSmHag
Received: from unknown (HELO [192.168.1.79]) ([109.76.0.191])
	by mail2.vodafone.ie with ESMTP; 11 May 2012 16:45:47 +0100
Message-ID: <4FAD342A.3050503@draigBrady.com>
Date: Fri, 11 May 2012 16:45:46 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Mark <markk@clara.co.uk>
Subject: Re: [RFC/PATCH] cp: Add option to pre-allocate space for files
References: <90cdbf76a2ca009ab20d719e55385197.squirrel@ssl-webmail-vh.clara.net>
In-Reply-To: <90cdbf76a2ca009ab20d719e55385197.squirrel@ssl-webmail-vh.clara.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 11 May 2012 15:46:03 -0000

On 05/11/2012 04:03 PM, Mark wrote:
> Hi,
> 
> Here's a patch for cp which adds a new --preallocate option. When
> specified, cp allocates disk space for the destination file before writing
> data. It uses fallocate() with FALLOC_FL_KEEP_SIZE on Linux, falling back
> to posix_fallocate() if that fails.

Thanks for taking the time to do this.
This feature is already under consideration.
See the comments at: http://bugs.gnu.org/9500

> Benefits of preallocation:
>  - Disk fragmentation can be greatly reduced. That means faster file
> access and less filesystem overhead (fewer extents).
>  - Recovering data after filesystem corruption should be more successful,
> since files are more likely to be contiguous.
>  - If you're e.g. copying a virtual machine disk image file, the
> destination should be (almost) contiguous, meaning that running a disk
> optimiser/defragmenter in the guest OS would work as it should (i.e.
> improve performance).
> 
> This is a very preliminary patch for testing. Hopefully someone will find
> it useful. And hopefully someone who (a) has a clue when it comes to C
> programming, and (b) is familiar with the coreutils source (I'm neither)
> can work from this to produce something which could be included in a
> future release.
> 
> Note that posix_fallocate() sets the destination file size. If your system
> doesn't support fallocate() with FALLOC_FL_KEEP_SIZE, you can't e.g. do
> "ls -l destfilename" to monitor the progress of a large file copy; the
> length shown will always be the final length.
> 
> Pre-allocating space can defeat the object of --sparse=always (or the
> default sparse-checking heuristic). If copying files with large holes you
> probably won't want to use --preallocate. If you do, regions in the
> destination corresponding to holes in the source will be allocated but
> unwritten. You'll lose the disk-space-saving benefit, but keep the
> fast-reading-of-holes benefit. On the other hand, that feature could be
> useful sometimes.
> 
> In the general case of copying non-sparse files, it should be beneficial
> to use --preallocate. However on some systems, when the destination
> filesystem does not support pre-allocation (e.g. FAT32), the
> implementation of posix_fallocate() might try to fill the region to be
> pre-allocated with zeros. That would double copy time for no benefit.
> 
> To-do list:
>  - Add --preallocate option to mv as well
>  - Should the option name be changed to --pre-allocate?
>  - Maybe have an option to tell cp to pre-allocate space for all
> destination files in one go, rather than pre-allocating space for each
> individual file before copying?

I don't think there should be an option at all.
cp should have enough info to do the right thing.
Why would you even not want to preallocate?
In saying that, using fallocate with XFS triggers
alignment behavior that causes fragmentation.
But this might change, and the user can't be expected to know this.
BTW I'm thinking of adding a new FALLOC_FL_ALIGN flag
to the kernel, that XFS can use in its tools to enable that
separate functionality.

>  - Check the error code that fallocate() returns. If it says the
> filesystem does not support fallocate(), don't call it again for every
> other file being copied.

>  - Better handling of sparse files, e.g. don't call fallocate() if source
> file is sparse and --sparse=always is given.

That's an important consideration.

>  - If pre-allocation fails due to insufficient disk space, cp prints a
> message and continues. So typically it will fill up the disk then abort
> with an out-of-disk-space error. It would be nice to be able to tell cp
> to abort when a pre-allocation fails, so it can exit without wasting
> time.

Yes it should exit immediately on ENOSPC

cheers,
Pádraig.


From MAILER-DAEMON Fri May 11 13:40:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SStpA-0004DJ-Dv
	for mharc-coreutils@gnu.org; Fri, 11 May 2012 13:40:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47580)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <markk@clara.co.uk>) id 1SStp6-0004C2-T7
	for coreutils@gnu.org; Fri, 11 May 2012 13:40:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <markk@clara.co.uk>) id 1SStp4-0002pw-SI
	for coreutils@gnu.org; Fri, 11 May 2012 13:40:12 -0400
Received: from claranet-outbound-smtp05.uk.clara.net ([195.8.89.38]:37970)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <markk@clara.co.uk>) id 1SStp4-0002po-KL
	for coreutils@gnu.org; Fri, 11 May 2012 13:40:10 -0400
Received: from webmail04.mail.eu.clara.net ([213.253.3.104]:47262
	helo=webmail.clara.net)
	by relay05.mail.eu.clara.net (relay.clara.net [213.253.3.45]:1025)
	with esmtpa (authdaemon_plain:markk@clara.co.uk) id 1SStox-0002eP-IY 
	(return-path <markk@clara.co.uk>); Fri, 11 May 2012 17:40:04 +0000
Received: from 2.27.247.8 (SquirrelMail authenticated user markk@clara.co.uk)
	by ssl-webmail-vh.clara.net with HTTP;
	Fri, 11 May 2012 18:40:03 +0100
Message-ID: <d7a3877bd5e2895596533d7b10a3c9b1.squirrel@ssl-webmail-vh.clara.net>
In-Reply-To: <4FAD342A.3050503@draigBrady.com>
References: <90cdbf76a2ca009ab20d719e55385197.squirrel@ssl-webmail-vh.clara.net>
	<4FAD342A.3050503@draigBrady.com>
Date: Fri, 11 May 2012 18:40:03 +0100
Subject: Re: [RFC/PATCH] cp: Add option to pre-allocate space for files
From: "Mark" <markk@clara.co.uk>
To: =?iso-8859-1?Q?=22P=E1draig_Brady=22?= <P@draigBrady.com>
User-Agent: SquirrelMail/1.4.21
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 195.8.89.38
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 11 May 2012 17:40:14 -0000

Hi,

On Fri, May 11, 2012 16:45, Pádraig Brady wrote:
> On 05/11/2012 04:03 PM, Mark wrote:
>> Here's a patch for cp which adds a new --preallocate option. When
>> specified, cp allocates disk space for the destination file before
>> ...
>>
>> To-do list:
>>  - Add --preallocate option to mv as well
>>  - Should the option name be changed to --pre-allocate?
>>  - Maybe have an option to tell cp to pre-allocate space for all
>> destination files in one go, rather than pre-allocating space for each
>> individual file before copying?
>
> I don't think there should be an option at all.
> cp should have enough info to do the right thing.
> Why would you even not want to preallocate?

Apart from the case I mentioned where posix_fallocate() might write out
zeros on some systems, I can't think of many cases where pre-allocating
wouldn't be a good idea. So perhaps at some point in the future it would
be the default, with a --no-preallocate option to disable.


>>  - Better handling of sparse files, e.g. don't call fallocate() if
>> source file is sparse and --sparse=always is given.
>
> That's an important consideration.

Even for sparse files, if cp can determine where the holes are beforehand
(using SEEK_HOLE/SEEK_DATA or fiemap), it could pre-allocate the non-hole
regions. So with more work, pre-allocation could be used with sparse
files. Implementing that is beyond my abilities though...

It would still be helpful to allow pre-allocation to be disabled. (E.g.
source file has many written/allocated all-zero regions, which the user
wants to turn into holes in the destination file.)

Still another option: the ability to use FALLOC_FL_PUNCH_HOLE to punch
holes in (pre-allocated) destination files. Then any all-zero non-hole
regions in the source could be turned into holes in the destination in
conjunction with --sparse=always. By pre-allocating, cp would at least
guarantee the copy won't fail due to insufficient disk space, which may be
useful in some cases.


>>  - If pre-allocation fails due to insufficient disk space, cp prints a
>> message and continues. So typically it will fill up the disk then abort
>> with an out-of-disk-space error. It would be nice to be able to tell cp
>> to abort when a pre-allocation fails, so it can exit without wasting
>> time.
>
> Yes it should exit immediately on ENOSPC

Aborting by default would make sense. Ideally that would be configurable.
In some cases the user might prefer to get a warning, so they can Ctrl-Z
suspend cp and delete/move other files to make space, instead of having cp
abort.


An interesting aside: I tried using cp to pre-allocate space for a very
large file on an ext4 partition, much larger than the amount of free
space. IMHO it would be best for the filesystem to fail immediately in
that case. ext4 does a lot of work (there was a lot of disk activity and
it took a long time to fail). ext4 pre-allocates as much of the requested
region as possible, rather than succeeding or failing all-or-nothing. So
you get a disk-full condition. (Of course that's no worse than what
happens when you run cp normally. But it would happen much more quickly
with pre-allocation.)

You can try that by doing something like this on an ext4 partition:
truncate -s 9999999999999 testfile   # (create a sparse file larger than
free space)
cp --preallocate testfile testfile.copy


-- Mark




From MAILER-DAEMON Sat May 12 23:27:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STPSd-00053J-VG
	for mharc-coreutils@gnu.org; Sat, 12 May 2012 23:27:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58738)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1STPSb-00051u-7G
	for coreutils@gnu.org; Sat, 12 May 2012 23:27:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1STPSZ-0000km-M2
	for coreutils@gnu.org; Sat, 12 May 2012 23:27:04 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:47241)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1STPSZ-0000kh-Ds
	for coreutils@gnu.org; Sat, 12 May 2012 23:27:03 -0400
Received: by obbwd18 with SMTP id wd18so6798365obb.0
	for <coreutils@gnu.org>; Sat, 12 May 2012 20:27:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=XupXa63VaG7NJlV28oOHP0+chTE7iEI0MOOoKdkJ2r4=;
	b=1EoLKIQPZL/qTBnJgv+UkFSvPguuBMkxoojrGJX0yDpCDOIM6+PlVgQBycAcz69874
	8np2RusHs0aMBNVeVeHW7Q++/1tqc3DCaEl7AlSBfNl8SILqpe3Cq1obN9/o8dw597go
	iGKPcm6St8niPPHq2o/89EYyLOn6PzEJxgYstWZOXnqp/Fg+7PQdrzbjP+iRtRnJ916O
	h4xUkcdIGRQCO8HX3pUu1vuvWZoFPwfrkvP15h7E2qxiOFmXBBnygKEZhbvJXEY2tMsj
	2rDXeFcmd9OGwKGrd1dNCL6YmoEgmJrO+G9mmBlSnzSgaYSpy09pcYEAOFoAFzMoYLMq
	nBnw==
MIME-Version: 1.0
Received: by 10.60.4.1 with SMTP id g1mr5090613oeg.55.1336879620707; Sat, 12
	May 2012 20:27:00 -0700 (PDT)
Received: by 10.182.226.65 with HTTP; Sat, 12 May 2012 20:27:00 -0700 (PDT)
In-Reply-To: <4F0193C0.2020602@draigBrady.com>
References: <CABrM6w=BLFdiS3V4cXzwNtgvu4bauxj4od3x_W=GHXLGRiU5sg@mail.gmail.com>
	<4EDC9DCD.6000703@draigBrady.com> <4EDC9E9C.5070202@draigBrady.com>
	<4EE549A6.5000006@draigBrady.com> <4EFE3E3C.3070704@draigBrady.com>
	<87d3b55b5q.fsf@rho.meyering.net> <4EFEE7E4.5040204@draigBrady.com>
	<87vcox3rr8.fsf@rho.meyering.net> <4F0193C0.2020602@draigBrady.com>
Date: Sat, 12 May 2012 22:27:00 -0500
Message-ID: <CABrM6w=AQL4Pha76pJEtJxRwFYCw_Ey85G==fdYsyFD0bM9znQ@mail.gmail.com>
Subject: Re: PATCH: relpath
From: Peng Yu <pengyu.ut@gmail.com>
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigbrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 03:27:06 -0000

> `--relative-base=3DBASE'
> =A0 =A0 Only output relative names when both the `--relative-to' and proc=
essed
> =A0 =A0 FILEs are descendants of BASE. =A0Otherwise output the absolute f=
ile name.
> =A0 =A0 Note this option honors the @option{-m} and @option{-e} options
> =A0 =A0 pertaining to file existence.

'--relative-to' and '--relative-base' are too long. Would you please
add a one-letter shortcut, such as -t and -b?

--=20
Regards,
Peng


From MAILER-DAEMON Sun May 13 16:43:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STfdV-0006HH-RU
	for mharc-coreutils@gnu.org; Sun, 13 May 2012 16:43:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57081)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjordan1@uw.edu>) id 1STRaj-0005vj-7J
	for coreutils@gnu.org; Sun, 13 May 2012 01:43:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjordan1@uw.edu>) id 1STRah-0002Za-JD
	for coreutils@gnu.org; Sun, 13 May 2012 01:43:36 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:42053)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjordan1@uw.edu>) id 1STRah-0002Z9-Ez
	for coreutils@gnu.org; Sun, 13 May 2012 01:43:35 -0400
Received: by yenm7 with SMTP id m7so4407734yen.0
	for <coreutils@gnu.org>; Sat, 12 May 2012 22:43:32 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=hfUksz4m8Pam4tPkZethD4CUv3cxahIv+YOF+qc+Rv0=;
	b=MgCz32rQU2Rtw0nDq+86yAs0/l12vPQ9MF8BHXMSeBoGS1AK/5fhhkdY/0bNhE1/TF
	iqW0gbov/Nl6yEb1S0Sy7HowFAFl1AXytuR0pMexau9lKbCaaxZnqaXj8U5MWY3eQWKJ
	yzY27me9ItLVy03vdQpnEMa2zg2IhyucJEF2dKdXyQdemXPbL9q4DSgQxEy4hmLxU8C/
	eDBtaU8p61PT921ySPTITKiI4ZWXgZaAR9/kgR61B0oUl4e3Q1Owc7wfxY2PXnPTIivy
	Fe6UOtEyhFsxFw7VGTrn2bT9+8ZStS5RYjOyL4P9k/vI6GBiKSSZJQ+042W9bpLwuTAF
	1MyA==
MIME-Version: 1.0
Received: by 10.236.37.168 with SMTP id y28mr3591099yha.111.1336887812885;
	Sat, 12 May 2012 22:43:32 -0700 (PDT)
Received: by 10.100.74.10 with HTTP; Sat, 12 May 2012 22:43:32 -0700 (PDT)
Date: Sat, 12 May 2012 22:43:32 -0700
Message-ID: <CAEJxiFq1r0BOT=F4nUFC02Xr0B32PocRBzNoKnqOo-P+fUAZtQ@mail.gmail.com>
Subject: wc 'Is a directory' output
From: Christopher Jordan-Squire <cjordan1@uw.edu>
To: coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-Gm-Message-State: ALoCoQnkZFlirwjCA36KTokHyBmAeidKIdddnAsIkUk6Wh6qqNSEIsBQhhTNis2Hc8YMes+zC6Th
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.169
X-Mailman-Approved-At: Sun, 13 May 2012 16:43:23 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 05:43:38 -0000

Hi--I was playing around with using awk on wc output and discovered
that when wc prints "wc: DIR: Is a directory", where DIR is the
appropriate directory name, it doesn't seem to be printing to stdout.
If I redirect the output of, say, wc -l ./* to a text file with '>'
then I don't get the "wc: DIRE: Is a directory" statements. That's
also causing some weird issues when I pipe wc's output to awk.

I was trying to understand how wc prints the "Is a directory" line.
But I haven't been able to figure it out after looking through the
source for 45 minutes. (I'm a very inexperienced C coder, though. So I
could have missed something easy.) Could anyone tell me what wc is
doing and where this shows up in the source?

Thanks,
Chris JS


From MAILER-DAEMON Mon May 14 02:49:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STp6G-0006T2-Ej
	for mharc-coreutils@gnu.org; Mon, 14 May 2012 02:49:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33934)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1STp6E-0006Sw-E8
	for coreutils@gnu.org; Mon, 14 May 2012 02:49:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1STp6C-0002es-K6
	for coreutils@gnu.org; Mon, 14 May 2012 02:49:41 -0400
Received: from mx.meyering.net ([88.168.87.75]:57131)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1STp6C-0002ea-6u
	for coreutils@gnu.org; Mon, 14 May 2012 02:49:40 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 7B5E9600B5;
	Mon, 14 May 2012 08:49:36 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Christopher Jordan-Squire <cjordan1@uw.edu>
Subject: Re: wc 'Is a directory' output
In-Reply-To: <CAEJxiFq1r0BOT=F4nUFC02Xr0B32PocRBzNoKnqOo-P+fUAZtQ@mail.gmail.com>
	(Christopher Jordan-Squire's message of "Sat, 12 May 2012 22:43:32
	-0700")
References: <CAEJxiFq1r0BOT=F4nUFC02Xr0B32PocRBzNoKnqOo-P+fUAZtQ@mail.gmail.com>
Date: Mon, 14 May 2012 08:49:36 +0200
Message-ID: <87sjf3gsu7.fsf@rho.meyering.net>
Lines: 99
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 06:49:44 -0000

Christopher Jordan-Squire wrote:
> Hi--I was playing around with using awk on wc output and discovered
> that when wc prints "wc: DIR: Is a directory", where DIR is the
> appropriate directory name, it doesn't seem to be printing to stdout.
> If I redirect the output of, say, wc -l ./* to a text file with '>'
> then I don't get the "wc: DIRE: Is a directory" statements. That's
> also causing some weird issues when I pipe wc's output to awk.
>
> I was trying to understand how wc prints the "Is a directory" line.
> But I haven't been able to figure it out after looking through the
> source for 45 minutes. (I'm a very inexperienced C coder, though. So I
> could have missed something easy.) Could anyone tell me what wc is
> doing and where this shows up in the source?

The easiest/quickest way to answer a question like that is via gdb:
[This is using Fedora 17/x86_64]

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

Run gdb with --args, the program name, and any arguments ("."):

    $ gdb --args wc .
    Reading symbols from /usr/bin/wc...(no debugging symbols found)...done.
    Missing separate debuginfos, use: debuginfo-install \
      coreutils-8.15-6.fc17.x86_64
    (gdb) q

That warning is relevant, so I'll get out of gdb and run the suggested command:
(without debuginfo, you wouldn't see some line number and file name
information in the backtrace)

    $ sudo debuginfo-install coreutils-8.15-6.fc17.x86_64
    $ gdb --args wc .
    Reading symbols from /usr/bin/wc...Reading symbols from \
      /usr/lib/debug/usr/bin/wc.debug...done.
    done.
    (gdb) b write
    Function "write" not defined.
    Make breakpoint pending on future shared library load? (y or [n]) y

    Breakpoint 1 (write) pending.
    (gdb) run
    Starting program: /usr/bin/wc .

    Breakpoint 1, write () at ../sysdeps/unix/syscall-template.S:82
    82      T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
    (gdb) backtrace
    #0  write () at ../sysdeps/unix/syscall-template.S:82
    #1  0x0000003134676793 in _IO_new_file_write (f=0x31349b1180,
        data=<optimized out>, n=13) at fileops.c:1289
    #2  0x0000003134676672 in new_do_write (fp=fp@entry=0x31349b1180,
        data=data@entry=0x7fffffff6e20 "/usr/bin/wc: ", to_do=to_do@entry=13)
        at fileops.c:543
    #3  0x00000031346772fe in _IO_new_file_xsputn (n=13, data=<optimized out>,
        f=0x31349b1180) at fileops.c:1383
    #4  _IO_new_file_xsputn (f=0x31349b1180, data=<optimized out>, n=13)
        at fileops.c:1305
    #5  0x000000313464b744 in buffered_vfprintf (s=s@entry=0x31349b1180,
        format=format@entry=0x3134777ad1 "%s: ", args=args@entry=0x7fffffff94a8)
        at vfprintf.c:2258
    #6  0x000000313464656e in _IO_vfprintf_internal (s=s@entry=0x31349b1180,
        format=format@entry=0x3134777ad1 "%s: ", ap=ap@entry=0x7fffffff94a8)
        at vfprintf.c:1258
    #7  0x000000313466b632 in __fxprintf (fp=0x31349b1180, fp@entry=0x0,
        fmt=fmt@entry=0x3134777ad1 "%s: ") at fxprintf.c:51
    #8  0x00000031346f0ae2 in __error (status=status@entry=0, errnum=21,
        message=message@entry=0x406135 "%s") at error.c:241
    #9  0x0000000000402d40 in wc (fd=fd@entry=7,
        file_x=file_x@entry=0x7fffffffde4d ".", fstatus=fstatus@entry=0x6090a0)
        at wc.c:434
    #10 0x0000000000402df6 in wc_file (file=file@entry=0x7fffffffde4d ".",
        fstatus=fstatus@entry=0x6090a0) at wc.c:516
    #11 0x0000000000401e80 in wc_file (fstatus=0x6090a0, file=0x7fffffffde4d ".")
        at wc.c:499
    #12 main (argc=<optimized out>, argv=<optimized out>) at wc.c:777

That shows the write was via a use of the error function in wc.c,
9 frames up the stack.  Go up the stack 9 levels and list the source:

    (gdb) up 9
    #9  0x0000000000402d40 in wc (fd=fd@entry=7,
        file_x=file_x@entry=0x7fffffffde4d ".", fstatus=fstatus@entry=0x6090a0)
        at wc.c:434
    434                   error (0, errno, "%s", file);
    (gdb) list
    429           while ((bytes_read = safe_read (fd, buf, BUFFER_SIZE)) > 0)
    430             {
    431               const char *p = buf;
    432               if (bytes_read == SAFE_READ_ERROR)
    433                 {
    434                   error (0, errno, "%s", file);
    435                   ok = false;
    436                   break;
    437                 }
    438

What is wc doing?
The read syscall (via safe_read) failed with errno=EISDIR.
The error function uses that errno value to print the diagnostic you saw.


From MAILER-DAEMON Mon May 14 04:33:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STqih-0006WP-3m
	for mharc-coreutils@gnu.org; Mon, 14 May 2012 04:33:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54898)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1STqiW-0006VM-FW
	for coreutils@gnu.org; Mon, 14 May 2012 04:33:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1STqiK-0005Sz-Fi
	for coreutils@gnu.org; Mon, 14 May 2012 04:33:20 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:25149)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1STqiK-0005Rt-Ap
	for coreutils@gnu.org; Mon, 14 May 2012 04:33:08 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAC7CsE9tTfly/2dsb2JhbAANN7AShmsBAQEEMgFGEAsNCwkWDwkDAgECAUUGDQEHAQHCG4sahggEnBSNEw
Received: from unknown (HELO [192.168.1.79]) ([109.77.249.114])
	by mail2.vodafone.ie with ESMTP; 14 May 2012 09:33:05 +0100
Message-ID: <4FB0C340.5010907@draigBrady.com>
Date: Mon, 14 May 2012 09:33:04 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: PATCH: relpath
References: <CABrM6w=BLFdiS3V4cXzwNtgvu4bauxj4od3x_W=GHXLGRiU5sg@mail.gmail.com>
	<4EDC9DCD.6000703@draigBrady.com> <4EDC9E9C.5070202@draigBrady.com>
	<4EE549A6.5000006@draigBrady.com> <4EFE3E3C.3070704@draigBrady.com>
	<87d3b55b5q.fsf@rho.meyering.net> <4EFEE7E4.5040204@draigBrady.com>
	<87vcox3rr8.fsf@rho.meyering.net> <4F0193C0.2020602@draigBrady.com>
	<CABrM6w=AQL4Pha76pJEtJxRwFYCw_Ey85G==fdYsyFD0bM9znQ@mail.gmail.com>
In-Reply-To: <CABrM6w=AQL4Pha76pJEtJxRwFYCw_Ey85G==fdYsyFD0bM9znQ@mail.gmail.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:33:30 -0000

On 05/13/2012 04:27 AM, Peng Yu wrote:
>> `--relative-base=BASE'
>>     Only output relative names when both the `--relative-to' and processed
>>     FILEs are descendants of BASE.  Otherwise output the absolute file name.
>>     Note this option honors the @option{-m} and @option{-e} options
>>     pertaining to file existence.
> 
> '--relative-to' and '--relative-base' are too long. Would you please
> add a one-letter shortcut, such as -t and -b?

Well short options are a bit of a trade off.

-t or -b would detract from the readability of a command
using them and thus would be useful just to save typing.
These days though there are other aids to both memory
and typing, like shell tab completion and
editor auto completion.

Also a factor is the frequency of use.
ls for example is a command used very often,
so can benefit from some short options.
I see realpath being used less interactively,
and more in scripts where readability is more important.

cheers,
Pádraig.


From MAILER-DAEMON Mon May 14 07:41:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STteq-00015e-1D
	for mharc-coreutils@gnu.org; Mon, 14 May 2012 07:41:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35849)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1STtek-00014h-RQ
	for coreutils@gnu.org; Mon, 14 May 2012 07:41:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1STtej-0000wC-4O
	for coreutils@gnu.org; Mon, 14 May 2012 07:41:38 -0400
Received: from mx.meyering.net ([88.168.87.75]:57918)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1STtei-0000w6-Ou
	for coreutils@gnu.org; Mon, 14 May 2012 07:41:37 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id A37E96005C;
	Mon, 14 May 2012 13:41:34 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: PATCH: relpath
In-Reply-To: <4FB0C340.5010907@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Mon, 14 May 2012 09:33:04 +0100")
References: <CABrM6w=BLFdiS3V4cXzwNtgvu4bauxj4od3x_W=GHXLGRiU5sg@mail.gmail.com>
	<4EDC9DCD.6000703@draigBrady.com> <4EDC9E9C.5070202@draigBrady.com>
	<4EE549A6.5000006@draigBrady.com> <4EFE3E3C.3070704@draigBrady.com>
	<87d3b55b5q.fsf@rho.meyering.net> <4EFEE7E4.5040204@draigBrady.com>
	<87vcox3rr8.fsf@rho.meyering.net> <4F0193C0.2020602@draigBrady.com>
	<CABrM6w=AQL4Pha76pJEtJxRwFYCw_Ey85G==fdYsyFD0bM9znQ@mail.gmail.com>
	<4FB0C340.5010907@draigBrady.com>
Date: Mon, 14 May 2012 13:41:34 +0200
Message-ID: <87k40fgfbl.fsf@rho.meyering.net>
Lines: 27
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Coreutils <coreutils@gnu.org>, Peng Yu <pengyu.ut@gmail.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 11:41:43 -0000

P=E1draig Brady wrote:

> On 05/13/2012 04:27 AM, Peng Yu wrote:
>>> `--relative-base=3DBASE'
>>>     Only output relative names when both the `--relative-to' and proces=
sed
>>>     FILEs are descendants of BASE.  Otherwise output the absolute file =
name.
>>>     Note this option honors the @option{-m} and @option{-e} options
>>>     pertaining to file existence.
>>
>> '--relative-to' and '--relative-base' are too long. Would you please
>> add a one-letter shortcut, such as -t and -b?
>
> Well short options are a bit of a trade off.
>
> -t or -b would detract from the readability of a command
> using them and thus would be useful just to save typing.
> These days though there are other aids to both memory
> and typing, like shell tab completion and
> editor auto completion.
>
> Also a factor is the frequency of use.
> ls for example is a command used very often,
> so can benefit from some short options.
> I see realpath being used less interactively,
> and more in scripts where readability is more important.

Good answer.  Thanks.


From MAILER-DAEMON Mon May 14 08:09:02 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STu5G-0006jF-EI
	for mharc-coreutils@gnu.org; Mon, 14 May 2012 08:09:02 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55820)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1STu59-0006hh-0l
	for coreutils@gnu.org; Mon, 14 May 2012 08:09:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1STu52-0006zb-KX
	for coreutils@gnu.org; Mon, 14 May 2012 08:08:54 -0400
Received: from moutng.kundenserver.de ([212.227.17.10]:60459)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1STu52-0006zI-BG
	for coreutils@gnu.org; Mon, 14 May 2012 08:08:48 -0400
Received: from [192.168.2.108] (p4FF763C5.dip.t-dialin.net [79.247.99.197])
	by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis)
	id 0Lm4GH-1RuqFA1yq1-00ZdVr; Mon, 14 May 2012 14:08:45 +0200
Message-ID: <4FB0F5CC.3020705@bernhard-voelker.de>
Date: Mon, 14 May 2012 14:08:44 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120421 Thunderbird/12.0
MIME-Version: 1.0
To: Christopher Jordan-Squire <cjordan1@uw.edu>
Subject: Re: wc 'Is a directory' output
References: <CAEJxiFq1r0BOT=F4nUFC02Xr0B32PocRBzNoKnqOo-P+fUAZtQ@mail.gmail.com>
In-Reply-To: <CAEJxiFq1r0BOT=F4nUFC02Xr0B32PocRBzNoKnqOo-P+fUAZtQ@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:5tYJbrmb6894mQsA43MZK2Xa83ygrb+SBjgQu4zAAfj
	9bdYg35UMKIVmaO/PKHt5OvbTZ+ngtpMjjz7vrZkXNsBp8IwMC
	M54ogwlhHFgJECmvWj96NFj7PylRSviv3eR560tt6fRlqZ5J+n
	/Zi1IPeY1iA9pqet+KGJNufWa+fzwHXckUXt3P88ykzURotyLU
	ukqhrJH+9eOZfQtk1cKBrychuo0F2Bq26RUXKW0UrbMQN13Cw4
	ENj0uE7JiQ9JOdy5yDulEb0m/HzjQfx8JsiDCm90QO0BSxpFJM
	G8tE2jY9mzjo555GAAqG3hIkzXywY5FufegCjvbyqgovk6RGlB
	+FC1MpbsIX/h/s3pkZkXH29RskRaM+47R3ESQZrOf
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.17.10
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 12:09:00 -0000

On 05/13/2012 07:43 AM, Christopher Jordan-Squire wrote:
> Hi--I was playing around with using awk on wc output and discovered
> that when wc prints "wc: DIR: Is a directory", where DIR is the
> appropriate directory name, it doesn't seem to be printing to stdout.
> If I redirect the output of, say, wc -l ./* to a text file with '>'
> then I don't get the "wc: DIRE: Is a directory" statements. That's
> also causing some weird issues when I pipe wc's output to awk.
> 
> I was trying to understand how wc prints the "Is a directory" line.
> But I haven't been able to figure it out after looking through the
> source for 45 minutes. (I'm a very inexperienced C coder, though. So I
> could have missed something easy.) Could anyone tell me what wc is
> doing and where this shows up in the source?
> 
> Thanks,
> Chris JS

While Jim has explained where in the code that "Is a directory" message
is written, I have the feeling that you may still not yet know where
that string is written to ... as you've redirected wc's output to a file
using something like 'wc -l ./* > /tmp/somefile' and you seem to have
expected that message there.

Normal output - i.e. the word count in wc's case - is written to the
standard output stream (aka stdout) which is usually bound to the file
descriptor number 1 and therefore can be redirected using the '>'
operator (which is short for '1>').

Error messages are written to the standard error stream (aka stderr)
which is usually bound to the file descriptor number 2 and therefore
can be redirected using the '2>' operator.

Try
    wc -l . >/tmp/somefile.out 2>/tmp/somefile.err
to see what's going where.

Hope this helps.

Have a nice day,
Berny


From MAILER-DAEMON Mon May 14 08:39:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STuYd-0007fv-0f
	for mharc-coreutils@gnu.org; Mon, 14 May 2012 08:39:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43003)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1STuYZ-0007e3-Eb
	for coreutils@gnu.org; Mon, 14 May 2012 08:39:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1STuYU-0005I5-7J
	for coreutils@gnu.org; Mon, 14 May 2012 08:39:18 -0400
Received: from mail-gg0-f169.google.com ([209.85.161.169]:41192)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1STuYU-0005HY-0C
	for coreutils@gnu.org; Mon, 14 May 2012 08:39:14 -0400
Received: by ggm4 with SMTP id 4so2273278ggm.0
	for <coreutils@gnu.org>; Mon, 14 May 2012 05:39:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=VvWUs986Bt2vKmmOKsUtVUJg/NjDf7zTt5YD7O7cc4c=;
	b=N2N6uw1kSlF0aphPa1PU8TMHv3L/ttvXOSq2No5/MGxf02CeU74Dk+tNbxjzw471Oh
	KDr2Lcr1+aBj3gEIBW4YFiOWOfwMWtBPz+o5l4TbsZ3YZuNyKYjurTbcFGuGiFE6Aif6
	IUS5O2TWhRjLGODx0EUo0UHk2tpqQmNH6yBH2+1O5Um0rBBgPgIee8gGB2P2UtTx0JGm
	6GfZhURm7+9I7GpGREEpwJcG8aKoK09LUEqmcdPyuzH/NrTvCfblDm8bR9UrG9Dx/zhz
	guUDoQSMUcNc5FJLaom6E5gPDeeZheZ8zBAoIMKQE0cS3+p3pbPl0JsDtYtbDMcEVKy5
	X1VQ==
MIME-Version: 1.0
Received: by 10.60.169.174 with SMTP id af14mr2925422oec.13.1336999151251;
	Mon, 14 May 2012 05:39:11 -0700 (PDT)
Received: by 10.182.226.65 with HTTP; Mon, 14 May 2012 05:39:11 -0700 (PDT)
In-Reply-To: <4FB0C340.5010907@draigBrady.com>
References: <CABrM6w=BLFdiS3V4cXzwNtgvu4bauxj4od3x_W=GHXLGRiU5sg@mail.gmail.com>
	<4EDC9DCD.6000703@draigBrady.com> <4EDC9E9C.5070202@draigBrady.com>
	<4EE549A6.5000006@draigBrady.com> <4EFE3E3C.3070704@draigBrady.com>
	<87d3b55b5q.fsf@rho.meyering.net> <4EFEE7E4.5040204@draigBrady.com>
	<87vcox3rr8.fsf@rho.meyering.net> <4F0193C0.2020602@draigBrady.com>
	<CABrM6w=AQL4Pha76pJEtJxRwFYCw_Ey85G==fdYsyFD0bM9znQ@mail.gmail.com>
	<4FB0C340.5010907@draigBrady.com>
Date: Mon, 14 May 2012 07:39:11 -0500
Message-ID: <CABrM6wmB6NYdvQc0Xmrj4wEjN5Ovu5XXCxxYWL60-rskbXaYFg@mail.gmail.com>
Subject: Re: PATCH: relpath
From: Peng Yu <pengyu.ut@gmail.com>
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigbrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.161.169
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 12:39:21 -0000

On Mon, May 14, 2012 at 3:33 AM, P=E1draig Brady <P@draigbrady.com> wrote:
> On 05/13/2012 04:27 AM, Peng Yu wrote:
>>> `--relative-base=3DBASE'
>>> =A0 =A0 Only output relative names when both the `--relative-to' and pr=
ocessed
>>> =A0 =A0 FILEs are descendants of BASE. =A0Otherwise output the absolute=
 file name.
>>> =A0 =A0 Note this option honors the @option{-m} and @option{-e} options
>>> =A0 =A0 pertaining to file existence.
>>
>> '--relative-to' and '--relative-base' are too long. Would you please
>> add a one-letter shortcut, such as -t and -b?
>
> Well short options are a bit of a trade off.
>
> -t or -b would detract from the readability of a command
> using them and thus would be useful just to save typing.
> These days though there are other aids to both memory
> and typing, like shell tab completion and
> editor auto completion.

I original suggested adding "relpath". I don't agree to bury this
under realpath. Having realpath for relpath is already awkward and
inconvenient. I don't think that it is wise having even long option
names to make it even more inconvenient.

I think that some names in coreutils is not good. This is just one
instance and should corrected.

> Also a factor is the frequency of use.
> ls for example is a command used very often,
> so can benefit from some short options.
> I see realpath being used less interactively,
> and more in scripts where readability is more important.

You can't tell for others how frequent they will use it. Just a like,
a rare disease is rare for a common person. But for persons who have
the disease it is 100%.

Bottom line, as a convention, for each long name option, there should
be a short name option, unless there are more than 26x2=3D52 options, in
which case the command is too large and should be broken into multiple
commands.

--=20
Regards,
Peng


From MAILER-DAEMON Mon May 14 09:00:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1STusz-0006IP-Jb
	for mharc-coreutils@gnu.org; Mon, 14 May 2012 09:00:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51572)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1STuso-0006AM-O2
	for coreutils@gnu.org; Mon, 14 May 2012 09:00:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1STusj-0003jB-GC
	for coreutils@gnu.org; Mon, 14 May 2012 09:00:14 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:54712)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1STusj-0003hu-AF
	for coreutils@gnu.org; Mon, 14 May 2012 09:00:09 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBANMAsU9tTfly/2dsb2JhbAANN7cPAQEBBDIBRhALDQsJFg8JAwIBAgFFBg0BBQIBAcJNixqGCAScFI0T
Received: from unknown (HELO [192.168.1.79]) ([109.77.249.114])
	by mail2.vodafone.ie with ESMTP; 14 May 2012 14:00:07 +0100
Message-ID: <4FB101D6.1000904@draigBrady.com>
Date: Mon, 14 May 2012 14:00:06 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: PATCH: relpath
References: <CABrM6w=BLFdiS3V4cXzwNtgvu4bauxj4od3x_W=GHXLGRiU5sg@mail.gmail.com>
	<4EDC9DCD.6000703@draigBrady.com> <4EDC9E9C.5070202@draigBrady.com>
	<4EE549A6.5000006@draigBrady.com> <4EFE3E3C.3070704@draigBrady.com>
	<87d3b55b5q.fsf@rho.meyering.net> <4EFEE7E4.5040204@draigBrady.com>
	<87vcox3rr8.fsf@rho.meyering.net> <4F0193C0.2020602@draigBrady.com>
	<CABrM6w=AQL4Pha76pJEtJxRwFYCw_Ey85G==fdYsyFD0bM9znQ@mail.gmail.com>
	<4FB0C340.5010907@draigBrady.com>
	<CABrM6wmB6NYdvQc0Xmrj4wEjN5Ovu5XXCxxYWL60-rskbXaYFg@mail.gmail.com>
In-Reply-To: <CABrM6wmB6NYdvQc0Xmrj4wEjN5Ovu5XXCxxYWL60-rskbXaYFg@mail.gmail.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:00:24 -0000

On 05/14/2012 01:39 PM, Peng Yu wrote:
> On Mon, May 14, 2012 at 3:33 AM, Pádraig Brady <P@draigbrady.com> wrote:
>> On 05/13/2012 04:27 AM, Peng Yu wrote:
>>>> `--relative-base=BASE'
>>>>     Only output relative names when both the `--relative-to' and processed
>>>>     FILEs are descendants of BASE.  Otherwise output the absolute file name.
>>>>     Note this option honors the @option{-m} and @option{-e} options
>>>>     pertaining to file existence.
>>>
>>> '--relative-to' and '--relative-base' are too long. Would you please
>>> add a one-letter shortcut, such as -t and -b?
>>
>> Well short options are a bit of a trade off.
>>
>> -t or -b would detract from the readability of a command
>> using them and thus would be useful just to save typing.
>> These days though there are other aids to both memory
>> and typing, like shell tab completion and
>> editor auto completion.
> 
> I original suggested adding "relpath". I don't agree to bury this
> under realpath. Having realpath for relpath is already awkward and
> inconvenient. I don't think that it is wise having even long option
> names to make it even more inconvenient.
> 
> I think that some names in coreutils is not good. This is just one
> instance and should corrected.
> 
>> Also a factor is the frequency of use.
>> ls for example is a command used very often,
>> so can benefit from some short options.
>> I see realpath being used less interactively,
>> and more in scripts where readability is more important.
> 
> You can't tell for others how frequent they will use it. Just a like,
> a rare disease is rare for a common person. But for persons who have
> the disease it is 100%.
> 
> Bottom line, as a convention, for each long name option, there should
> be a short name option, unless there are more than 26x2=52 options, in
> which case the command is too large and should be broken into multiple
> commands.

There are similar medicines for many diseases.
Here is a function you can put in your scripts or shell startup file,
to provide the interface you desired from a relpath command.

relpath() { realpath --relative-to="$2" "$1"; }

cheers,
Pádraig.


From MAILER-DAEMON Tue May 15 22:01:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUTY4-0000Ah-Jb
	for mharc-coreutils@gnu.org; Tue, 15 May 2012 22:01:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47455)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SUTY2-0000AZ-Q9
	for coreutils@gnu.org; Tue, 15 May 2012 22:01:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SUTY1-0008Gt-6I
	for coreutils@gnu.org; Tue, 15 May 2012 22:01:06 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:42911)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SUTY0-0008Gm-VW
	for coreutils@gnu.org; Tue, 15 May 2012 22:01:05 -0400
Received: by obbwd18 with SMTP id wd18so407527obb.0
	for <coreutils@gnu.org>; Tue, 15 May 2012 19:01:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=zwxr+P1X49941t9xSa9k4fsdDhQdPx2cxmSqitT3JLs=;
	b=0/f63F8vLhPbdN/Xl90n0j9n2dmtoZqsutihS2jAUsx2qV03nOYZL0zdPlajghdhhr
	pzhobU2tl/LBaLbgeWv0M8heEtcAPjWo5fB7W2nYVEk/Y+EeM3wKsqZQOVVhICBsU7lr
	guJ3fEO5yi/2CsDrI3U/rZX6d1mLng59nA1fDivNU6pDLGPGw4Fx+oQpmJQucp3XO1X/
	Pg7LgJe2ILb5YNSp9WMTWshbQPdx59Yv3TY6oWyPgcKmgTBAoimKfIHHJaJLGkp2WfhC
	KARbUdnNNB1FRai6hJ0pjwxR8/T6UF/UpAdd6L0MB8kglJbiNvlFWv/fTTPFIlXfSMow
	VIDQ==
MIME-Version: 1.0
Received: by 10.182.145.40 with SMTP id sr8mr1104568obb.42.1337133661985; Tue,
	15 May 2012 19:01:01 -0700 (PDT)
Received: by 10.182.226.65 with HTTP; Tue, 15 May 2012 19:01:01 -0700 (PDT)
Date: Tue, 15 May 2012 21:01:01 -0500
Message-ID: <CABrM6wkwkaYzX=2MPVYw3JWBMAX5SrUhJBJA1DaJiazfhfHqKw@mail.gmail.com>
Subject: Is there a way to prompt error if 'ln -s'es target does not exist?
From: Peng Yu <pengyu.ut@gmail.com>
To: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 02:01:08 -0000

Hi,

I don't see an option of 'ln -s' that prompts some error if the target
does not exist. In case that I miss anything, could anybody who are
more familar with ln confirm with me? Thanks!

-- 
Regards,
Peng


From MAILER-DAEMON Wed May 16 01:50:02 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUX7a-0002Jn-Om
	for mharc-coreutils@gnu.org; Wed, 16 May 2012 01:50:02 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40372)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUX7X-0002JR-Rl
	for coreutils@gnu.org; Wed, 16 May 2012 01:50:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUX7W-0001Ve-4u
	for coreutils@gnu.org; Wed, 16 May 2012 01:49:59 -0400
Received: from mx.meyering.net ([88.168.87.75]:36487)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUX7V-0001VU-Sa
	for coreutils@gnu.org; Wed, 16 May 2012 01:49:58 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 390AF60090
	for <coreutils@gnu.org>; Wed, 16 May 2012 07:49:56 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: use $AWK, not awk
Date: Wed, 16 May 2012 07:49:56 +0200
Message-ID: <87txzgy8sb.fsf@rho.meyering.net>
Lines: 57
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 05:50:01 -0000

FYI, I noticed a few hard-coded uses of "awk" in tests/:

>From 2e9f5ca4ebbbdb6a9fa2dd3d5add3f7720a172d7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 16 May 2012 07:46:51 +0200
Subject: [PATCH] tests: use $AWK, not awk

* tests/cp/sparse-fiemap: Don't hard-code "awk".  Use $AWK.
* tests/init.cfg: Likewise.
* tests/misc/sort-rand: Likewise.
---
 tests/cp/sparse-fiemap | 2 +-
 tests/init.cfg         | 2 +-
 tests/misc/sort-rand   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index 61e807c..f2e5f33 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -64,7 +64,7 @@ fi
 f()
 {
   sed 's/ [a-z,][a-z,]*$//' $@ \
-    | awk '/^ *[0-9]/ {printf "%d %d ", $2, (NF<5 ? $NF : $5) } END {print ""}'
+    | $AWK '/^ *[0-9]/ {printf "%d %d ", $2, (NF<5 ? $NF : $5) } END {print ""}'
 }

 for i in $(seq 1 2 21); do
diff --git a/tests/init.cfg b/tests/init.cfg
index 2e43c16..c1cb92f 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -183,7 +183,7 @@ require_file_system_bytes_free_()
 {
   local req=$1
   local expr=$(stat -f --printf "$req / %S <= %a" .)
-  awk "BEGIN{ exit !($expr) }" \
+  $AWK "BEGIN{ exit !($expr) }" \
     || skip_ "this test needs at least $req bytes of free space"
 }

diff --git a/tests/misc/sort-rand b/tests/misc/sort-rand
index 79730e9..1782a9a 100755
--- a/tests/misc/sort-rand
+++ b/tests/misc/sort-rand
@@ -35,7 +35,7 @@ compare in out1 || { fail=1; echo "not a permutation" 1>&2; }

 # If locale is available then use it to find a random non-C locale.
 if (locale --version) > /dev/null 2>&1; then
-  locale=$(locale -a | sort --random-sort | awk '/^.._/{print;exit}')
+  locale=$(locale -a | sort --random-sort | $AWK '/^.._/{print;exit}')
   LC_ALL=$locale sort --random-sort in > out1 || fail=1
   LC_ALL=$locale sort --random-sort in > out2 || fail=1

--
1.7.10.2.520.g6a4a482


From MAILER-DAEMON Wed May 16 09:40:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUeSR-0001l4-Rx
	for mharc-coreutils@gnu.org; Wed, 16 May 2012 09:40:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35079)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SUeSH-0001ik-FW
	for coreutils@gnu.org; Wed, 16 May 2012 09:40:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SUeSA-00050x-BI
	for coreutils@gnu.org; Wed, 16 May 2012 09:39:53 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:55241)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SUeSA-00050W-5Y
	for coreutils@gnu.org; Wed, 16 May 2012 09:39:46 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApUBAEqts09tTlGZ/2dsb2JhbAANN7AzhnQBAQEEMgFGEAsNCwkWDwkDAgECAUUGDQEHAQHDQ4sThVUDnBGNEw
Received: from unknown (HELO [192.168.1.79]) ([109.78.81.153])
	by mail2.vodafone.ie with ESMTP; 16 May 2012 14:39:43 +0100
Message-ID: <4FB3AE1E.9060402@draigBrady.com>
Date: Wed, 16 May 2012 14:39:42 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: Is there a way to prompt error if 'ln -s'es target does not exist?
References: <CABrM6wkwkaYzX=2MPVYw3JWBMAX5SrUhJBJA1DaJiazfhfHqKw@mail.gmail.com>
In-Reply-To: <CABrM6wkwkaYzX=2MPVYw3JWBMAX5SrUhJBJA1DaJiazfhfHqKw@mail.gmail.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:40:02 -0000

On 05/16/2012 03:01 AM, Peng Yu wrote:
> Hi,
> 
> I don't see an option of 'ln -s' that prompts some error if the target
> does not exist. In case that I miss anything, could anybody who are
> more familar with ln confirm with me? Thanks!

ln will create a dangling like without error.
If that's not what you want you can:

[ -e "$target" ] && ln -s "$target" linkname

cheers,
Pádraig.


From MAILER-DAEMON Wed May 16 13:35:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUi87-0008UG-GQ
	for mharc-coreutils@gnu.org; Wed, 16 May 2012 13:35:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34393)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUi83-0008Mw-8G
	for coreutils@gnu.org; Wed, 16 May 2012 13:35:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUi7y-00064a-7Q
	for coreutils@gnu.org; Wed, 16 May 2012 13:35:14 -0400
Received: from mx.meyering.net ([88.168.87.75]:38432)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUi7y-00064J-00
	for coreutils@gnu.org; Wed, 16 May 2012 13:35:10 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 70B7B60090
	for <coreutils@gnu.org>; Wed, 16 May 2012 19:35:08 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: Re: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
In-Reply-To: <87hawzwl71.fsf@rho.meyering.net> (Jim Meyering's message of
	"Wed, 04 Apr 2012 17:50:10 +0200")
References: <87hawzwl71.fsf@rho.meyering.net>
Date: Wed, 16 May 2012 19:35:08 +0200
Message-ID: <87wr4cuj03.fsf@rho.meyering.net>
Lines: 39
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 17:35:17 -0000

Jim Meyering wrote:
> I wrote this months ago, and like the minimalist (avoiding unnecessary
> printf) and more type-safe aspects.  The code-duplication is not ideal,
> but the duplicated code is small and fragile, and not generally useful
> enough to put in system.h -- too easy to use it from a context where
> it would fail.  We could always give it a few more buffer entries, like
> human.c does, so two invocations in the same statement won't misbehave.
>
> Opinions?

No response, so I guess it's not horribly to
anyone else, either...

> Subject: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
>
> * src/id.c (gidtostr, uidtostr): Define macros.
> (gidtostr_ptr, uidtostr_ptr): Define safer functions.
> Use gidtostr and uidtostr to print GID and UID without
> need/risk of casts.
> * src/group-list.c: Likewise.
> ---
>  src/group-list.c |   16 ++++++++++++----
>  src/id.c         |   38 +++++++++++++++++++++++++++++---------
>  2 files changed, 41 insertions(+), 13 deletions(-)
...

I rebased and was about to push it, but discovered that tests were failing:
when compiled with -O2 and with today's (from-svn-this-morning) gcc,

    gcc version 4.8.0 20120516 (experimental) (GCC)

it segfaults.  It works fine when compiled with -O1, or with F17's

    gcc (GCC) 4.7.0 20120504 (Red Hat 4.7.0-4)

Whee...  While trying to debug that, I managed to trigger
a failed assertion in gdb.  First priority is to report that.

I'll hold off until I know more...


From MAILER-DAEMON Thu May 17 03:08:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUuom-00013E-1T
	for mharc-coreutils@gnu.org; Thu, 17 May 2012 03:08:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50393)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUuof-0000yk-LZ
	for coreutils@gnu.org; Thu, 17 May 2012 03:08:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUuoY-0007p0-Ue
	for coreutils@gnu.org; Thu, 17 May 2012 03:08:05 -0400
Received: from mx.meyering.net ([88.168.87.75]:40599)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUuoY-0007ol-Mr
	for coreutils@gnu.org; Thu, 17 May 2012 03:07:58 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 40CD660090
	for <coreutils@gnu.org>; Thu, 17 May 2012 09:07:57 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: Re: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
In-Reply-To: <87wr4cuj03.fsf@rho.meyering.net> (Jim Meyering's message of
	"Wed, 16 May 2012 19:35:08 +0200")
References: <87hawzwl71.fsf@rho.meyering.net> <87wr4cuj03.fsf@rho.meyering.net>
Date: Thu, 17 May 2012 09:07:57 +0200
Message-ID: <87ipfvqo8i.fsf@rho.meyering.net>
Lines: 77
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 07:08:10 -0000

Jim Meyering wrote:

> Jim Meyering wrote:
>> I wrote this months ago, and like the minimalist (avoiding unnecessary
>> printf) and more type-safe aspects.  The code-duplication is not ideal,
>> but the duplicated code is small and fragile, and not generally useful
>> enough to put in system.h -- too easy to use it from a context where
>> it would fail.  We could always give it a few more buffer entries, like
>> human.c does, so two invocations in the same statement won't misbehave.
>>
>> Opinions?
>
> No response, so I guess it's not horribly to
> anyone else, either...
>
>> Subject: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
>>
>> * src/id.c (gidtostr, uidtostr): Define macros.
>> (gidtostr_ptr, uidtostr_ptr): Define safer functions.
>> Use gidtostr and uidtostr to print GID and UID without
>> need/risk of casts.
>> * src/group-list.c: Likewise.
>> ---
>>  src/group-list.c |   16 ++++++++++++----
>>  src/id.c         |   38 +++++++++++++++++++++++++++++---------
>>  2 files changed, 41 insertions(+), 13 deletions(-)
> ...
>
> I rebased and was about to push it, but discovered that tests were failing:
> when compiled with -O2 and with today's (from-svn-this-morning) gcc,
>
>     gcc version 4.8.0 20120516 (experimental) (GCC)
>
> it segfaults.  It works fine when compiled with -O1, or with F17's
>
>     gcc (GCC) 4.7.0 20120504 (Red Hat 4.7.0-4)
>
> Whee...  While trying to debug that, I managed to trigger
> a failed assertion in gdb.  First priority is to report that.

Reported here:

    http://sourceware.org/bugzilla/show_bug.cgi?id=14119

> I'll hold off until I know more...

When you write 9 bytes past the end of a stack buffer,
you should expect bad things to happen.  The type used
as the INT_BUFSIZE_BOUND argument must match the *tostr
function that uses that buffer.

Yet another reason I'm glad to use cutting-edge gcc.

I'm squashing this in:

diff --git a/src/id.c b/src/id.c
index d060a94..1f99b9f 100644
--- a/src/id.c
+++ b/src/id.c
@@ -280,7 +280,7 @@ main (int argc, char **argv)
 static char *
 gidtostr_ptr (gid_t const *gid)
 {
-  static char buf[INT_BUFSIZE_BOUND (gid_t)];
+  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
   return umaxtostr (*gid, buf);
 }
 #define gidtostr(g) gidtostr_ptr (&(g))
@@ -291,7 +291,7 @@ gidtostr_ptr (gid_t const *gid)
 static char *
 uidtostr_ptr (uid_t const *uid)
 {
-  static char buf[INT_BUFSIZE_BOUND (uid_t)];
+  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
   return umaxtostr (*uid, buf);
 }
 #define uidtostr(u) uidtostr_ptr (&(u))


From MAILER-DAEMON Thu May 17 03:10:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUuqv-0001WK-Bd
	for mharc-coreutils@gnu.org; Thu, 17 May 2012 03:10:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43889)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUuqp-0001Vq-Dt
	for coreutils@gnu.org; Thu, 17 May 2012 03:10:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUuqj-00087J-4C
	for coreutils@gnu.org; Thu, 17 May 2012 03:10:18 -0400
Received: from mx.meyering.net ([88.168.87.75]:40603)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUuqi-000874-Sh
	for coreutils@gnu.org; Thu, 17 May 2012 03:10:13 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 301F660090
	for <coreutils@gnu.org>; Thu, 17 May 2012 09:10:11 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: Re: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
In-Reply-To: <87ipfvqo8i.fsf@rho.meyering.net> (Jim Meyering's message of
	"Thu, 17 May 2012 09:07:57 +0200")
References: <87hawzwl71.fsf@rho.meyering.net>
	<87wr4cuj03.fsf@rho.meyering.net> <87ipfvqo8i.fsf@rho.meyering.net>
Date: Thu, 17 May 2012 09:10:11 +0200
Message-ID: <87d363qo4s.fsf@rho.meyering.net>
Lines: 82
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 07:10:24 -0000

Jim Meyering wrote:

> Jim Meyering wrote:
>
>> Jim Meyering wrote:
>>> I wrote this months ago, and like the minimalist (avoiding unnecessary
>>> printf) and more type-safe aspects.  The code-duplication is not ideal,
>>> but the duplicated code is small and fragile, and not generally useful
>>> enough to put in system.h -- too easy to use it from a context where
>>> it would fail.  We could always give it a few more buffer entries, like
>>> human.c does, so two invocations in the same statement won't misbehave.
>>>
>>> Opinions?
>>
>> No response, so I guess it's not horribly to
>> anyone else, either...
>>
>>> Subject: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
>>>
>>> * src/id.c (gidtostr, uidtostr): Define macros.
>>> (gidtostr_ptr, uidtostr_ptr): Define safer functions.
>>> Use gidtostr and uidtostr to print GID and UID without
>>> need/risk of casts.
>>> * src/group-list.c: Likewise.
>>> ---
>>>  src/group-list.c |   16 ++++++++++++----
>>>  src/id.c         |   38 +++++++++++++++++++++++++++++---------
>>>  2 files changed, 41 insertions(+), 13 deletions(-)
>> ...
>>
>> I rebased and was about to push it, but discovered that tests were failing:
>> when compiled with -O2 and with today's (from-svn-this-morning) gcc,
>>
>>     gcc version 4.8.0 20120516 (experimental) (GCC)
>>
>> it segfaults.  It works fine when compiled with -O1, or with F17's
>>
>>     gcc (GCC) 4.7.0 20120504 (Red Hat 4.7.0-4)
>>
>> Whee...  While trying to debug that, I managed to trigger
>> a failed assertion in gdb.  First priority is to report that.
>
> Reported here:
>
>     http://sourceware.org/bugzilla/show_bug.cgi?id=14119
>
>> I'll hold off until I know more...
>
> When you write 9 bytes past the end of a stack buffer,
> you should expect bad things to happen.  The type used
> as the INT_BUFSIZE_BOUND argument must match the *tostr
> function that uses that buffer.
>
> Yet another reason I'm glad to use cutting-edge gcc.
>
> I'm squashing this in:
>
> diff --git a/src/id.c b/src/id.c
> index d060a94..1f99b9f 100644
> --- a/src/id.c
> +++ b/src/id.c
> @@ -280,7 +280,7 @@ main (int argc, char **argv)
>  static char *
>  gidtostr_ptr (gid_t const *gid)
>  {
> -  static char buf[INT_BUFSIZE_BOUND (gid_t)];
> +  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
>    return umaxtostr (*gid, buf);
>  }
>  #define gidtostr(g) gidtostr_ptr (&(g))
> @@ -291,7 +291,7 @@ gidtostr_ptr (gid_t const *gid)
>  static char *
>  uidtostr_ptr (uid_t const *uid)
>  {
> -  static char buf[INT_BUFSIZE_BOUND (uid_t)];
> +  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
>    return umaxtostr (*uid, buf);
>  }
>  #define uidtostr(u) uidtostr_ptr (&(u))

And the same for the duplicated function (hmm... :-( )
in group-list.c


From MAILER-DAEMON Fri May 18 11:01:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SVOgh-0001Bi-Nc
	for mharc-coreutils@gnu.org; Fri, 18 May 2012 11:01:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43454)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SVOdk-0000cY-1V
	for coreutils@gnu.org; Fri, 18 May 2012 10:58:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SVOdi-0007Wu-9e
	for coreutils@gnu.org; Fri, 18 May 2012 10:58:47 -0400
Received: from mail-bk0-f41.google.com ([209.85.214.41]:38779)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SVOdh-0007Wh-W3
	for coreutils@gnu.org; Fri, 18 May 2012 10:58:46 -0400
Received: by bkcjm19 with SMTP id jm19so2041849bkc.0
	for <coreutils@gnu.org>; Fri, 18 May 2012 07:58:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=20120113;
	h=date:from:to:subject:message-id:mime-version:content-type
	:content-disposition:user-agent;
	bh=w6dq8akyk6rimMr33eS8oZkpqr3vC19tS0lG4/iqljU=;
	b=mNbznvJDHdNiqPjPVq1ruogwIF20GuYGK5Br0UqtJYrcUHBuP3XmCCvB9JAf5l3PQE
	5xqZeEOdpRioZtJGAq7PEKOG9XNuxLHi0dmxSuoWwCPnwy3duUpRy7nrhKxgNrk62zfJ
	KYR5FlGDtVWqxvsLUuzGvR3fGAYtuxRFBiNwvt7mnM/aVlPmZDY3aCVRjV955tXtOkyM
	GCA6bsFsU8k3DYvU9AVWyTrz7NSrug7+r8hwqD/GsoqrGpipYDMXFkYCveoSdviGckKf
	R+1zK9sWF2qWOabUrruH6pkv/M3RBEJ1Tsc8tsde6GCXfbpScOon5adaokPzeOPy1YNY
	UrEQ==
Received: by 10.204.10.70 with SMTP id o6mr4126989bko.70.1337353123539;
	Fri, 18 May 2012 07:58:43 -0700 (PDT)
Received: from Jann-PC.fritz.box (77-22-154-252-dynip.superkabel.de.
	[77.22.154.252])
	by mx.google.com with ESMTPS id f11sm17923062bkw.6.2012.05.18.07.58.40
	(version=SSLv3 cipher=OTHER); Fri, 18 May 2012 07:58:40 -0700 (PDT)
Date: Fri, 18 May 2012 16:58:38 +0200
From: Jann Horn <jannhorn@googlemail.com>
To: coreutils@gnu.org
Subject: feature proposal for tee: exit immediately when the output pipe closes
Message-ID: <20120518145838.GA31109@Jann-PC.fritz.box>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.41
X-Mailman-Approved-At: Fri, 18 May 2012 11:01:50 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 18 May 2012 14:58:49 -0000


--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,
what would you think about letting "tee" exit immediately when the output pipe was closed? It
should be pretty straightforward to implement using select/epoll, right?

 -- Jann

--sdtB3X0nJg68CQEu
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJPtmOdAAoJEGhmizV0f2d1mtQP/jOhUBAnA50iuz4gRXX/nws8
BJctu4acNPocphlrQlFva3zT6vTuQ/SaqJc2uCcMnc8EHgjj7I0UluQM+93pnxu1
H1SxVd5a6PWJlAvQD+1Us3V4OwCh26kA1Pi9bDckVibwWvEBJ7FXjMMWRD3kgdv/
Y/L4RAyGNTkWZJ2RYM2mwjek9ZaslhCwjXxEqrkFqdZ78i4NxHQEwQPRixVJTm6C
lNdpeTM+Ba5U4+fPupIqEC7MRHBfKPLrqjwH0RmeDJZ4uAuU5hkzWWJ0Eu0TtFty
6GsFo6pUVSY2Nmjj3hHNatq7x45IPvMkEI9S9VwvePS9thK0yCbzuP4+1ggxuzuN
Fx8Sz8qRKfdplAuqSjD/6N7rL/s/6vBq/M2KCmcooT+TDU+HyI1SQCNxeGAvpH+o
w9iUgfRzYs72NKygNAZ+uNr1DsLwx4dWwp0Ugin+NtM6F7sSws5nQPAwK5bpSMH/
7wKVpQHer3rO89or9XGttT+ZpESF0Ol6QMq9yIE1OqmZdR2V+tpA6NoekTAv/Ntd
veA2YroGkipx2SGQwmW4er1C8cTGCLMPFY+3oUBylmTC8z3LQuwC1IT4f+SoGcdP
DGHRbZNJcVR8LYeFYdPs1O6knVuweBj5MyZ4HMGBpfni4OG7LwEjDeEepi8wJUQv
FdD8zWZ9xMt1rJ8BefIS
=Wr3h
-----END PGP SIGNATURE-----

--sdtB3X0nJg68CQEu--


From MAILER-DAEMON Fri May 18 15:00:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SVSPd-0003xI-9a
	for mharc-coreutils@gnu.org; Fri, 18 May 2012 15:00:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54879)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SVSPb-0003wo-48
	for coreutils@gnu.org; Fri, 18 May 2012 15:00:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SVSPY-0003D9-GQ
	for coreutils@gnu.org; Fri, 18 May 2012 15:00:26 -0400
Received: from mail-bk0-f41.google.com ([209.85.214.41]:60683)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SVSPY-0003Cm-5i
	for coreutils@gnu.org; Fri, 18 May 2012 15:00:24 -0400
Received: by bkcjm19 with SMTP id jm19so2257789bkc.0
	for <coreutils@gnu.org>; Fri, 18 May 2012 12:00:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=20120113;
	h=date:from:to:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=rwwatUnHk1mdlx3dIcz+nCe6u1eG6Eyo9CQuAMM/fAo=;
	b=f9pQfR6oFWMEMJUXK+7Rc/nCDUljYUOsfcLwZjHXCZPO4utM3OF0iYQL83qzB8jysF
	EApT4xEDfpoQXArRvZs4q2xNK4ThxH2giT6wOP+wpWA+gIsVO1+h/h7yQJ8/kuwGUS8l
	OODMjqYxNJdRsSWXlziFiFZHGNAvxWsbS49RTSKtxUwRFx72LclTYz8Ep3zVvp3RZTox
	6zwz7SEN5gqoIzbX+j8510EjkaNmqTKmHn8KZz58dFBKKxXLay0WaN0I+7zePrO/V5bG
	jLn1tmgqgnWPBkT48dUXLJWw414gjoNUNFX93JtY8JS1lCscM6tfZ73fl9r94dCLUdek
	fdLA==
Received: by 10.204.129.196 with SMTP id p4mr4442853bks.28.1337367621861;
	Fri, 18 May 2012 12:00:21 -0700 (PDT)
Received: from Jann-PC.fritz.box (77-22-154-252-dynip.superkabel.de.
	[77.22.154.252])
	by mx.google.com with ESMTPS id ig1sm18928555bkc.4.2012.05.18.12.00.20
	(version=SSLv3 cipher=OTHER); Fri, 18 May 2012 12:00:21 -0700 (PDT)
Date: Fri, 18 May 2012 21:00:18 +0200
From: Jann Horn <jannhorn@googlemail.com>
To: coreutils@gnu.org
Subject: Re: feature proposal for tee: exit immediately when the output pipe
	closes
Message-ID: <20120518190018.GB31109@Jann-PC.fritz.box>
References: <20120518145838.GA31109@Jann-PC.fritz.box>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD"
Content-Disposition: inline
In-Reply-To: <20120518145838.GA31109@Jann-PC.fritz.box>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.41
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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, 18 May 2012 19:00:28 -0000


--69pVuxX8awAiJ7fD
Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH"
Content-Disposition: inline


--i9LlY+UWpKt15+FH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, May 18, 2012 at 04:58:38PM +0200, Jann Horn wrote:
> Hello,
> what would you think about letting "tee" exit immediately when the output=
 pipe was closed? It
> should be pretty straightforward to implement using select/epoll, right?
>=20
>  -- Jann

Here's a patch that works for me.

--i9LlY+UWpKt15+FH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0001-tee-use-poll-to-exit-immediately-when-an-output-clos.patch"
Content-Transfer-Encoding: quoted-printable

=46rom 7e86dabc0a88f2f69ea54a373fb6dba4b3e4cbdd Mon Sep 17 00:00:00 2001
=46rom: Jann Horn <jannhorn@googlemail.com>
Date: Fri, 18 May 2012 20:52:55 +0200
Subject: [PATCH] tee: use poll() to exit immediately when an output closes

---
 src/tee.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/tee.c b/src/tee.c
index 2d82577..a45002e 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -20,6 +20,7 @@
 #include <sys/types.h>
 #include <signal.h>
 #include <getopt.h>
+#include <poll.h>
=20
 #include "system.h"
 #include "error.h"
@@ -179,8 +180,25 @@ tee_files (int nfiles, const char **files)
         setvbuf (descriptors[i], NULL, _IONBF, 0);
     }
=20
+  struct pollfd pollfds[nfiles + 2];
+  for (i =3D 0; i <=3D nfiles; i++)
+    {
+      pollfds[i].fd =3D fileno(descriptors[i]);
+      pollfds[i].events =3D POLLERR | POLLHUP | POLLNVAL;
+    }
+  pollfds[i].fd =3D 0;
+  pollfds[i].events =3D POLLIN;
+
   while (1)
     {
+      poll(pollfds, nfiles + 2, -1);
+      if ((pollfds[nfiles + 1].revents & POLLIN) =3D=3D 0)
+        {
+          /* If there's no incoming data, it means
+             an output was closed or so. */
+          exit(141);
+        }
+
       bytes_read =3D read (0, buffer, sizeof buffer);
       if (bytes_read < 0 && errno =3D=3D EINTR)
         continue;
--=20
1.7.6.5


--i9LlY+UWpKt15+FH--

--69pVuxX8awAiJ7fD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJPtpxCAAoJEGhmizV0f2d110MP/1DKFJzGlBwRNZ0ZFyWbYXTh
/5XsdofgMysenh/ikUCR+wQid7DhuubpUAXUA0mVXz4zVqdVo4XPo5J29zS6uCRF
RiOuQ99dDtBj+Npa0GlxtjO2+BU45zFPoUy4qs1BRO1TE7batxmXyed8eZPJakWC
ItOCPbyVKh0z2s06GTFECH6vlMBwRCy9MqnyvNRj0FAkwCRfwUQ4J3ZW2B5q8gYa
i4u9OVCGxfRkU33vSQ5TtP9V3ZB7xPKCIRTaD4AlOl1HRyU4UXHShvTE5hAmgKDF
8olJKSiw++WidNDaKaWxU1pYTliBsrJo6lgljlgQV0NBRdT5lxSGwcaKJCd3NfI+
o5QDkcqvVskpUpiG9S3k6CHHm0Nx6nPWzjw5GxVD60+ERJvybjgWgV/6ujvr3NCY
gv9uN8xgSQw3IrXBWetvcl58EU1PkdnqWWglA1sakQBAae/8cvZpnchvzCHIFtmW
o9cN+waJY6vSeygQZMQVc1rD3lKbYxPYU3uMrpwiP7dLkf3dWyLHIMYdy5XvE1gL
yBHkrUOppDxiw09bbc5Klkjp6whE9Ht+WQb5l76KzK1HTf4KEyLiCuNyKYsPJzGo
jjYTCjgCV7sU2FBIoDh43CxVKElUQkvQGItAnvGYMFzEJT5ecfBEAQ3TrLVHu0w/
4QWWMObQEyhX0ku3Bw+U
=SRVO
-----END PGP SIGNATURE-----

--69pVuxX8awAiJ7fD--


From MAILER-DAEMON Mon May 21 11:04:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SWUA9-0000nb-0k
	for mharc-coreutils@gnu.org; Mon, 21 May 2012 11:04:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60708)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SWUA1-0000lW-Vt
	for coreutils@gnu.org; Mon, 21 May 2012 11:04:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SWU9r-0005oC-GT
	for coreutils@gnu.org; Mon, 21 May 2012 11:04:37 -0400
Received: from mx.meyering.net ([88.168.87.75]:57516)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SWU9r-0005nl-9i
	for coreutils@gnu.org; Mon, 21 May 2012 11:04:27 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 749DD600AE
	for <coreutils@gnu.org>; Mon, 21 May 2012 17:04:24 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: remove comment that suggested to remove support for
	mktemp -V
Date: Mon, 21 May 2012 17:04:24 +0200
Message-ID: <87pq9xlgnb.fsf@rho.meyering.net>
Lines: 31
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:04:44 -0000

Addressing a FIXME-in-2012 comment:

>From 785234bc173a87ca26ad62ff2a64197039f0c459 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 20 May 2012 17:19:10 +0200
Subject: [PATCH] maint: remove comment that suggested to remove support for
 mktemp -V

* src/mktemp.c (main): Don't suggest to remove support for -V, an
undocumented alias for --version, since that would introduce a
gratuitous incompatibility with the original mktemp program.
---
 src/mktemp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mktemp.c b/src/mktemp.c
index bab0c2b..67d3a40 100644
--- a/src/mktemp.c
+++ b/src/mktemp.c
@@ -206,7 +206,8 @@ main (int argc, char **argv)

         case_GETOPT_HELP_CHAR;

-        case 'V': /* Undocumented alias.  FIXME: remove in 2011.  */
+        case 'V': /* Undocumented alias, for compatibility with the original
+                     mktemp program.  */
         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
         default:
           usage (EXIT_FAILURE);
--
1.7.10.2.552.gaa3bb87


From MAILER-DAEMON Mon May 21 11:08:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SWUEB-0002eo-Tk
	for mharc-coreutils@gnu.org; Mon, 21 May 2012 11:08:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53078)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SWUE6-0002d5-Hu
	for coreutils@gnu.org; Mon, 21 May 2012 11:08:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SWUE3-0007Ml-9g
	for coreutils@gnu.org; Mon, 21 May 2012 11:08:50 -0400
Received: from mx.meyering.net ([88.168.87.75]:57530)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SWUE2-0007MR-VD
	for coreutils@gnu.org; Mon, 21 May 2012 11:08:47 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 2487C600AE
	for <coreutils@gnu.org>; Mon, 21 May 2012 17:08:45 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: Re: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts
In-Reply-To: <87d363qo4s.fsf@rho.meyering.net> (Jim Meyering's message of
	"Thu, 17 May 2012 09:10:11 +0200")
References: <87hawzwl71.fsf@rho.meyering.net>
	<87wr4cuj03.fsf@rho.meyering.net> <87ipfvqo8i.fsf@rho.meyering.net>
	<87d363qo4s.fsf@rho.meyering.net>
Date: Mon, 21 May 2012 17:08:45 +0200
Message-ID: <87k405lgg2.fsf@rho.meyering.net>
Lines: 181
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:08:55 -0000

Jim Meyering wrote:
...
>> I'm squashing this in:
>>
>> diff --git a/src/id.c b/src/id.c
>> index d060a94..1f99b9f 100644
>> --- a/src/id.c
>> +++ b/src/id.c
>> @@ -280,7 +280,7 @@ main (int argc, char **argv)
>>  static char *
>>  gidtostr_ptr (gid_t const *gid)
>>  {
>> -  static char buf[INT_BUFSIZE_BOUND (gid_t)];
>> +  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
>>    return umaxtostr (*gid, buf);
>>  }
>>  #define gidtostr(g) gidtostr_ptr (&(g))
>> @@ -291,7 +291,7 @@ gidtostr_ptr (gid_t const *gid)
>>  static char *
>>  uidtostr_ptr (uid_t const *uid)
>>  {
>> -  static char buf[INT_BUFSIZE_BOUND (uid_t)];
>> +  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
>>    return umaxtostr (*uid, buf);
>>  }
>>  #define uidtostr(u) uidtostr_ptr (&(u))

That was the bug fix for a not-yet-pushed patch.

> And the same for the duplicated function (hmm... :-( )
> in group-list.c

Since then, I spotted two more places in id.c that can trivially use
the new gidtostr function instead of a cast and %lu conversion,
so I'm going ahead with this:

>From b663bc8eb0b87c21584b931872db5fd82cf72f49 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 1 Jan 2012 22:31:41 +0100
Subject: [PATCH] id,groups: use gidtostr/uidtostr to avoid casts

* src/id.c (gidtostr, uidtostr): Define macros.
(gidtostr_ptr, uidtostr_ptr): Define safer functions.
Use gidtostr and uidtostr to print GID and UID without
need/risk of casts.
* src/group-list.c: Likewise.
---
 src/group-list.c | 16 ++++++++++++----
 src/id.c         | 42 +++++++++++++++++++++++++++++++-----------
 2 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/src/group-list.c b/src/group-list.c
index edbb342..a25601e 100644
--- a/src/group-list.c
+++ b/src/group-list.c
@@ -88,6 +88,16 @@ print_group_list (const char *username,
   return ok;
 }

+/* Convert a gid_t to string.  Do not use this function directly.
+   Instead, use it via the gidtostr macro.
+   Beware that it returns a pointer to static storage.  */
+static char *
+gidtostr_ptr (gid_t const *gid)
+{
+  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
+  return umaxtostr (*gid, buf);
+}
+#define gidtostr(g) gidtostr_ptr (&(g))

 /* Print the name or value of group ID GID. */
 extern bool
@@ -107,9 +117,7 @@ print_group (gid_t gid, bool use_name)
         }
     }

-  if (grp == NULL)
-    printf ("%lu", (unsigned long int) gid);
-  else
-    printf ("%s", grp->gr_name);
+  char *s = grp ? grp->gr_name : gidtostr (gid);
+  fputs (s, stdout);
   return ok;
 }
diff --git a/src/id.c b/src/id.c
index 41ae024..435d9e8 100644
--- a/src/id.c
+++ b/src/id.c
@@ -274,6 +274,28 @@ main (int argc, char **argv)
   exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
 }

+/* Convert a gid_t to string.  Do not use this function directly.
+   Instead, use it via the gidtostr macro.
+   Beware that it returns a pointer to static storage.  */
+static char *
+gidtostr_ptr (gid_t const *gid)
+{
+  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
+  return umaxtostr (*gid, buf);
+}
+#define gidtostr(g) gidtostr_ptr (&(g))
+
+/* Convert a uid_t to string.  Do not use this function directly.
+   Instead, use it via the uidtostr macro.
+   Beware that it returns a pointer to static storage.  */
+static char *
+uidtostr_ptr (uid_t const *uid)
+{
+  static char buf[INT_BUFSIZE_BOUND (uintmax_t)];
+  return umaxtostr (*uid, buf);
+}
+#define uidtostr(u) uidtostr_ptr (&(u))
+
 /* Print the name or value of user ID UID. */

 static void
@@ -286,16 +308,14 @@ print_user (uid_t uid)
       pwd = getpwuid (uid);
       if (pwd == NULL)
         {
-          error (0, 0, _("cannot find name for user ID %lu"),
-                 (unsigned long int) uid);
+          error (0, 0, _("cannot find name for user ID %s"),
+                 uidtostr (uid));
           ok = false;
         }
     }

-  if (pwd == NULL)
-    printf ("%lu", (unsigned long int) uid);
-  else
-    printf ("%s", pwd->pw_name);
+  char *s = pwd ? pwd->pw_name : uidtostr (uid);
+  fputs (s, stdout);
 }

 /* Print all of the info about the user's user and group IDs. */
@@ -306,19 +326,19 @@ print_full_info (const char *username)
   struct passwd *pwd;
   struct group *grp;

-  printf (_("uid=%lu"), (unsigned long int) ruid);
+  printf (_("uid=%s"), uidtostr (ruid));
   pwd = getpwuid (ruid);
   if (pwd)
     printf ("(%s)", pwd->pw_name);

-  printf (_(" gid=%lu"), (unsigned long int) rgid);
+  printf (_(" gid=%s"), gidtostr (rgid));
   grp = getgrgid (rgid);
   if (grp)
     printf ("(%s)", grp->gr_name);

   if (euid != ruid)
     {
-      printf (_(" euid=%lu"), (unsigned long int) euid);
+      printf (_(" euid=%s"), uidtostr (euid));
       pwd = getpwuid (euid);
       if (pwd)
         printf ("(%s)", pwd->pw_name);
@@ -326,7 +346,7 @@ print_full_info (const char *username)

   if (egid != rgid)
     {
-      printf (_(" egid=%lu"), (unsigned long int) egid);
+      printf (_(" egid=%s"), gidtostr (egid));
       grp = getgrgid (egid);
       if (grp)
         printf ("(%s)", grp->gr_name);
@@ -359,7 +379,7 @@ print_full_info (const char *username)
       {
         if (i > 0)
           putchar (',');
-        printf ("%lu", (unsigned long int) groups[i]);
+        fputs (gidtostr (groups[i]), stdout);
         grp = getgrgid (groups[i]);
         if (grp)
           printf ("(%s)", grp->gr_name);
--
1.7.10.2.552.gaa3bb87


From MAILER-DAEMON Thu May 24 09:08:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXXmh-0001c2-F2
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 09:08:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43546)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXXmZ-0001bd-Uz
	for coreutils@gnu.org; Thu, 24 May 2012 09:08:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXXmP-0003SS-UU
	for coreutils@gnu.org; Thu, 24 May 2012 09:08:47 -0400
Received: from mail3.vodafone.ie ([213.233.128.45]:17074)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXXmP-0003Ry-OU
	for coreutils@gnu.org; Thu, 24 May 2012 09:08:37 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAJ4xvk9tTHCs/2dsb2JhbAANNoUxsjEBAQEEIw8BGzcEGAQDAQIDAgUNAQgLAgIJAwIBAgEfHAIIBggFBgIBARkEh3eoOJJngSSJW4IGAYIHgRIDlieEYoxqgVc
Received: from unknown (HELO [192.168.1.79]) ([109.76.112.172])
	by mail3.vodafone.ie with ESMTP; 24 May 2012 14:08:35 +0100
Message-ID: <4FBE32D2.5060905@draigBrady.com>
Date: Thu, 24 May 2012 14:08:34 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Coreutils <coreutils@gnu.org>
Subject: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de>
In-Reply-To: <4FBE3059.3030806@suse.de>
X-Enigmail-Version: 1.3.2
X-Forwarded-Message-Id: <4FBE3059.3030806@suse.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.45
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:08:53 -0000



-------- Original Message --------
Subject: [PULL] su
Date: Thu, 24 May 2012 14:58:01 +0200
From: Ludwig Nussel <ludwig.nussel@suse.de>
To: util-linux@vger.kernel.org

Hi,

coreutils isn't really interested in maintaining su anymore.
Distributions have to add custom patches to fix bugs and add
features. The worst offender is probably the pam patch. Fortunately
we managed to sync the patch between openSUSE and Fedora meanwhile.
Over time the risk that the patches divert again increases though.
Since util-linux now contains a common login program it looks like a
good new home for su too.

To integrate su into util-linux I've extracted the history of the su
program until the last GPLv2 version (they've changed to GPLv3
meanwhile) from coreutils' git and merged it with util-linux.
Then I've added the patches used in Fedora and openSUSE and fixed the
files to actually build.

You can find the result in branch su-v1 (ff6b15d) at
git@github.com:lnussel/util-linux.git

I've also filed a pull request on github:
https://github.com/karelzak/util-linux/pull/10

Originally I had planned to implement separate tty allocation for
the child program on top of that to get rid of the evil setsid
patch. It turned out to be more complicated than I thought though. The
change would be too massive to backport anyways I guess. So the next
step would be to rip out the non-pam legacy stuff and clean up the code
to make it readable again.

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix ImendÃ¶rffer, HRB 16746 (AG NÃ¼rnberg)
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



From MAILER-DAEMON Thu May 24 09:21:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXXyg-00059k-5a
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 09:21:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59671)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXXyc-00058R-LQ
	for coreutils@gnu.org; Thu, 24 May 2012 09:21:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXXyS-0007Ub-AF
	for coreutils@gnu.org; Thu, 24 May 2012 09:21:14 -0400
Received: from mx.meyering.net ([88.168.87.75]:40550)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1SXXyS-0007Ts-2w; Thu, 24 May 2012 09:21:04 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id D6BE96005C;
	Thu, 24 May 2012 15:21:01 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: removing "su" from coreutils [Re: Fwd: [PULL] su
In-Reply-To: <4FBE32D2.5060905@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Thu, 24 May 2012 14:08:34 +0100")
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
Date: Thu, 24 May 2012 15:21:01 +0200
Message-ID: <87aa0xbtqa.fsf_-_@rho.meyering.net>
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: hurd-devel@gnu.org, Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:21:16 -0000

P=E1draig Brady wrote:
> -------- Original Message --------
> Subject: [PULL] su
> Date: Thu, 24 May 2012 14:58:01 +0200
> From: Ludwig Nussel <ludwig.nussel@suse.de>
> To: util-linux@vger.kernel.org
>
> Hi,
>
> coreutils isn't really interested in maintaining su anymore.
> Distributions have to add custom patches to fix bugs and add
> features. The worst offender is probably the pam patch. Fortunately
> we managed to sync the patch between openSUSE and Fedora meanwhile.
> Over time the risk that the patches divert again increases though.
> Since util-linux now contains a common login program it looks like a
> good new home for su too.
>
> To integrate su into util-linux I've extracted the history of the su
> program until the last GPLv2 version (they've changed to GPLv3
> meanwhile) from coreutils' git and merged it with util-linux.
> Then I've added the patches used in Fedora and openSUSE and fixed the
> files to actually build.
>
> You can find the result in branch su-v1 (ff6b15d) at
> git@github.com:lnussel/util-linux.git
>
> I've also filed a pull request on github:
> https://github.com/karelzak/util-linux/pull/10
>
> Originally I had planned to implement separate tty allocation for
> the child program on top of that to get rid of the evil setsid
> patch. It turned out to be more complicated than I thought though. The
> change would be too massive to backport anyways I guess. So the next
> step would be to rip out the non-pam legacy stuff and clean up the code
> to make it readable again.

Hi P=E1draig,

Thanks for forwarding that.

I would like to remove su.c, if/when possible from coreutils.
The last time I proposed that, the Hurd was mentioned as a
reason not to, since they relied on the su from coreutils.

Is that still the case, and if so, can you (the Hurd) switch
to the one from util-linux?


From MAILER-DAEMON Thu May 24 09:51:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXYRR-0001hC-R5
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 09:51:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44873)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXYRG-0001gg-Ig
	for coreutils@gnu.org; Thu, 24 May 2012 09:51:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXYR9-0007cB-Rr
	for coreutils@gnu.org; Thu, 24 May 2012 09:50:50 -0400
Received: from mail3.vodafone.ie ([213.233.128.45]:3876)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>)
	id 1SXYR9-0007bo-M1; Thu, 24 May 2012 09:50:43 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAFU8vk9tTHCs/2dsb2JhbAANNrdjAQEBBDIBRgwECw0EAwECAQkNAQgPCQMCAQIBPQgGDQEFAgEBiBS7Kop/ggYBgxkDlieEYoUJh2GBVw
Received: from unknown (HELO [192.168.1.79]) ([109.76.112.172])
	by mail3.vodafone.ie with ESMTP; 24 May 2012 14:50:41 +0100
Message-ID: <4FBE3CB0.7090901@draigBrady.com>
Date: Thu, 24 May 2012 14:50:40 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net>
In-Reply-To: <87aa0xbtqa.fsf_-_@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.45
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:51:00 -0000

On 05/24/2012 02:21 PM, Jim Meyering wrote:
> Pádraig Brady wrote:
>> -------- Original Message --------
>> Subject: [PULL] su
>> Date: Thu, 24 May 2012 14:58:01 +0200
>> From: Ludwig Nussel <ludwig.nussel@suse.de>
>> To: util-linux@vger.kernel.org
>>
>> Hi,
>>
>> coreutils isn't really interested in maintaining su anymore.
>> Distributions have to add custom patches to fix bugs and add
>> features. The worst offender is probably the pam patch. Fortunately
>> we managed to sync the patch between openSUSE and Fedora meanwhile.
>> Over time the risk that the patches divert again increases though.
>> Since util-linux now contains a common login program it looks like a
>> good new home for su too.
>>
>> To integrate su into util-linux I've extracted the history of the su
>> program until the last GPLv2 version (they've changed to GPLv3
>> meanwhile) from coreutils' git and merged it with util-linux.
>> Then I've added the patches used in Fedora and openSUSE and fixed the
>> files to actually build.
>>
>> You can find the result in branch su-v1 (ff6b15d) at
>> git@github.com:lnussel/util-linux.git
>>
>> I've also filed a pull request on github:
>> https://github.com/karelzak/util-linux/pull/10
>>
>> Originally I had planned to implement separate tty allocation for
>> the child program on top of that to get rid of the evil setsid
>> patch. It turned out to be more complicated than I thought though. The
>> change would be too massive to backport anyways I guess. So the next
>> step would be to rip out the non-pam legacy stuff and clean up the code
>> to make it readable again.
> 
> Hi Pádraig,
> 
> Thanks for forwarding that.
> 
> I would like to remove su.c, if/when possible from coreutils.
> The last time I proposed that, the Hurd was mentioned as a
> reason not to, since they relied on the su from coreutils.
> 
> Is that still the case, and if so, can you (the Hurd) switch
> to the one from util-linux?
> 

Well it's not clear cut to me, given that su
isn't really Linux specific.

Note Fedora and Suse use su from coreutils
while debian use their own:
http://pkg-shadow.alioth.debian.org/

Note also Fedora has `runuser` which is based on su:
http://pkgs.fedoraproject.org/gitweb/?p=coreutils.git;a=blob;f=coreutils-8.7-runuser.patch;hb=HEAD

There was also a very related request for
`runuser` like functionality to be generally available:
http://bugs.gnu.org/8700

It's probably worth bringing runuser with su,
no matter where they end up.

cheers,
Pádraig.



From MAILER-DAEMON Thu May 24 10:07:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXYhS-0005dh-63
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 10:07:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48985)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXYhH-0005b8-70
	for coreutils@gnu.org; Thu, 24 May 2012 10:07:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXYhF-0004Hm-3l
	for coreutils@gnu.org; Thu, 24 May 2012 10:07:22 -0400
Received: from mx.meyering.net ([88.168.87.75]:40687)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1SXYhE-0004HV-T3; Thu, 24 May 2012 10:07:21 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 093066005C;
	Thu, 24 May 2012 16:07:18 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
In-Reply-To: <4FBE3CB0.7090901@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Thu, 24 May 2012 14:50:40 +0100")
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net> <4FBE3CB0.7090901@draigBrady.com>
Date: Thu, 24 May 2012 16:07:18 +0200
Message-ID: <87396pbrl5.fsf@rho.meyering.net>
Lines: 43
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:07:32 -0000

P=E1draig Brady wrote:
...
>> Hi P=E1draig,
>>
>> Thanks for forwarding that.
>>
>> I would like to remove su.c, if/when possible from coreutils.
>> The last time I proposed that, the Hurd was mentioned as a
>> reason not to, since they relied on the su from coreutils.
>>
>> Is that still the case, and if so, can you (the Hurd) switch
>> to the one from util-linux?
>>
>
> Well it's not clear cut to me, given that su
> isn't really Linux specific.

Right, but how many non-Linux-based systems rely on coreutils' su?
When this last came up, that the Hurd needed it was a deciding factor
(along with Fedora/Suse, of course).

> Note Fedora and Suse use su from coreutils

Sure, but the point of the message you forwarded seemed to be that
Fedora and Suse might soon have a good incentive to use the su from
util-linux, rather than from coreutils.

> while debian use their own:
> http://pkg-shadow.alioth.debian.org/
>
> Note also Fedora has `runuser` which is based on su:
> http://pkgs.fedoraproject.org/gitweb/?p=3Dcoreutils.git;a=3Dblob;f=3Dcore=
utils-8.7-runuser.patch;hb=3DHEAD
>
> There was also a very related request for
> `runuser` like functionality to be generally available:
> http://bugs.gnu.org/8700

I wouldn't mind adding such a program to the list of things
coreutils installs by default.  So far, no one has volunteered
to do the work.

> It's probably worth bringing runuser with su,
> no matter where they end up.


From MAILER-DAEMON Thu May 24 10:22:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXYwA-0005b8-2U
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 10:22:46 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44424)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXYvz-0005ay-CW
	for coreutils@gnu.org; Thu, 24 May 2012 10:22:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SXYvt-0008V8-6P
	for coreutils@gnu.org; Thu, 24 May 2012 10:22:34 -0400
Received: from mail3.vodafone.ie ([213.233.128.45]:8367)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>)
	id 1SXYvt-0008Uv-0A; Thu, 24 May 2012 10:22:29 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAGpDvk9tTHCs/2dsb2JhbAANNrdjAQEBAwEyAUYQCw0LCRYPCQMCAQIBRQYNAQcBAYgEu0KKf4UgA5YnhGKFCYdh
Received: from unknown (HELO [192.168.1.79]) ([109.76.112.172])
	by mail3.vodafone.ie with ESMTP; 24 May 2012 15:22:26 +0100
Message-ID: <4FBE4422.7080902@draigBrady.com>
Date: Thu, 24 May 2012 15:22:26 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com> <87396pbrl5.fsf@rho.meyering.net>
In-Reply-To: <87396pbrl5.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.45
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:22:44 -0000

On 05/24/2012 03:07 PM, Jim Meyering wrote:
> Pádraig Brady wrote:

>> Well it's not clear cut to me, given that su
>> isn't really Linux specific.
> 
> Right, but how many non-Linux-based systems rely on coreutils' su?
> When this last came up, that the Hurd needed it was a deciding factor
> (along with Fedora/Suse, of course).

Fair point.

>> There was also a very related request for
>> `runuser` like functionality to be generally available:
>> http://bugs.gnu.org/8700
> 
> I wouldn't mind adding such a program to the list of things
> coreutils installs by default.  So far, no one has volunteered
> to do the work.

OK cool, I guess we can split up `runuser` and `su`.
I'll look at doing a separate `runuser` in coreutils upstream
in the next few weeks.

cheers,
Pádraig.


From MAILER-DAEMON Thu May 24 10:24:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXYxa-0006Nd-Oy
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 10:24:14 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44703)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXYxS-0005vI-Av
	for coreutils@gnu.org; Thu, 24 May 2012 10:24:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXYxJ-0000IW-7s
	for coreutils@gnu.org; Thu, 24 May 2012 10:24:05 -0400
Received: from mx.meyering.net ([88.168.87.75]:40753)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXYxJ-0000IN-1M
	for coreutils@gnu.org; Thu, 24 May 2012 10:23:57 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 40C60600B2
	for <coreutils@gnu.org>; Thu, 24 May 2012 16:23:54 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: prohibit use of strncpy
Date: Thu, 24 May 2012 16:23:54 +0200
Message-ID: <87wr41ac91.fsf@rho.meyering.net>
Lines: 40
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:24:12 -0000

The use of strncpy is so seldom justifiable, that it is best
just to avoid it altogether.  Thus, we should enforce that:

>From 22695d676de21d0af6d50ca8218eeb49b45608ab Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 24 May 2012 16:21:34 +0200
Subject: [PATCH] maint: prohibit use of strncpy

* cfg.mk (sc_prohibit_strncpy): New syntax-check rule.
Exempt pinky.c and who.c, at least for now.
---
 cfg.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index 7a86c2a..ff5d996 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -403,6 +403,12 @@ sc_prohibit_strncmp:
 	  { echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
 		1>&2; exit 1; } || :

+# Really.  You don't want to use this function.
+sc_prohibit_strncpy:
+	@prohibit='\<str''ncpy *\('					\
+	halt='do not use str''ncpy, period'				\
+	  $(_sc_search_regexp)
+
 # Enforce recommended preprocessor indentation style.
 sc_preprocessor_indentation:
 	@if cppi --version >/dev/null 2>&1; then			\
@@ -472,3 +478,6 @@ exclude_file_name_regexp--sc_prohibit_test_backticks = \
 # Exempt test.c, since it's nominally shared, and relatively static.
 exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
   ^src/(ptx|test|head)\.c$$
+
+# Exempt pinky and who: their uses of this function appear to be correct.
+exclude_file_name_regexp--sc_prohibit_strncpy = ^src/(pinky|who)\.c$$
--
1.7.10.2.565.gbd578b5


From MAILER-DAEMON Thu May 24 10:52:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXZOx-0000GO-5C
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 10:52:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34331)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ludwig.nussel@suse.de>) id 1SXZGF-00031J-4U
	for coreutils@gnu.org; Thu, 24 May 2012 10:43:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ludwig.nussel@suse.de>) id 1SXZG8-00066Z-VB
	for coreutils@gnu.org; Thu, 24 May 2012 10:43:30 -0400
Received: from cantor2.suse.de ([195.135.220.15]:52665 helo=mx2.suse.de)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ludwig.nussel@suse.de>)
	id 1SXZG8-00065w-Pg; Thu, 24 May 2012 10:43:24 -0400
Received: from relay1.suse.de (unknown [195.135.220.254])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 6D8DA93EDB;
	Thu, 24 May 2012 16:43:21 +0200 (CEST)
Message-ID: <4FBE4906.2070207@suse.de>
Date: Thu, 24 May 2012 16:43:18 +0200
From: Ludwig Nussel <ludwig.nussel@suse.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120421 Thunderbird/12.0
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com>
In-Reply-To: <4FBE3CB0.7090901@draigBrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.135.220.15
X-Mailman-Approved-At: Thu, 24 May 2012 10:52:30 -0400
Cc: hurd-devel@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:43:41 -0000

P=E1draig Brady wrote:
> [...]
> There was also a very related request for
> `runuser` like functionality to be generally available:
> http://bugs.gnu.org/8700

Looks like chroot fulfils the requirements stated in that bug report
already. You can just chroot to / and have it switch uids only after
all :-)
Beware of CVE-2005-4890 when switching to unprivileged and
potentially compromised user accounts though.

cu
Ludwig

--=20
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rf=
fer, HRB 16746 (AG N=FCrnberg)=20


From MAILER-DAEMON Thu May 24 10:55:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXZRp-0001ff-0r
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 10:55:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53287)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SXZRm-0001et-Cz
	for coreutils@gnu.org; Thu, 24 May 2012 10:55:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SXZRg-0000xX-7U
	for coreutils@gnu.org; Thu, 24 May 2012 10:55:25 -0400
Received: from mx1.redhat.com ([209.132.183.28]:62791)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>)
	id 1SXZRT-0000vJ-P0; Thu, 24 May 2012 10:55:07 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4OEt3uY009325
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 24 May 2012 10:55:03 -0400
Received: from [10.3.113.16] ([10.3.113.16])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q4OEt3PT022393; Thu, 24 May 2012 10:55:03 -0400
Message-ID: <4FBE4BC6.5000802@redhat.com>
Date: Thu, 24 May 2012 08:55:02 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net>
In-Reply-To: <87aa0xbtqa.fsf_-_@rho.meyering.net>
X-Enigmail-Version: 1.4.1
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigD5E611181DDD9CDE405C469A"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: hurd-devel@gnu.org, Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:55:27 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigD5E611181DDD9CDE405C469A
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 05/24/2012 07:21 AM, Jim Meyering wrote:

> I would like to remove su.c, if/when possible from coreutils.
> The last time I proposed that, the Hurd was mentioned as a
> reason not to, since they relied on the su from coreutils.

Cygwin is another platform that currently uses su from coreutils.
However, on cygwin, su is rather restricted in what it can do, and
already carries a cygwin-specific patch for hooking into Windows
mechanisms for switching privileges.  So it's no big loss if coreutils
drops su, cygwin will adapt (possibly by using util-linux, possibly by
forking the coreutils version with cygwin-specific patches into a
cygwin-specific fork).

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPvkvGAAoJEKeha0olJ0NqmI4H/jagMm34xtKNaJB0aJt2mtMD
D3rbQVVC26PvbdFsJ9cEE5txKXgRgHebMta0QBtPWRt00oBMgrCRF5BjKZPrkGBS
mhe34tzAwcHddswuFd3xEpyFFzaFw6gnvt6dFarv3SNw7yKSCiM+0xhTAxjPWsQ2
YxOKQiI4DqwacQmX/XaI/EwrFafBP7omV6k0T5IkESdPYs54f99FIORxKUrZc8Ow
CphL9Oolz/oM36AaP0SZmvRFgpnYhRdCMhLkLhDJ/SLrNO7UBpO+tkrngaKhdk7u
fRBpECL1SrcwlfE5XLk1kHx1fB1MJd3YQnoNKtJI/pNLTlFOtdos33UljxHJHGg=
=iDkG
-----END PGP SIGNATURE-----

--------------enigD5E611181DDD9CDE405C469A--


From MAILER-DAEMON Thu May 24 12:52:57 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXbHV-0001U8-9D
	for mharc-coreutils@gnu.org; Thu, 24 May 2012 12:52:57 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48159)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1SXbHP-0007jQ-GU
	for coreutils@gnu.org; Thu, 24 May 2012 12:52:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1SXb39-0007pd-3J
	for coreutils@gnu.org; Thu, 24 May 2012 12:38:09 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:58199)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>)
	id 1SXb38-0007oN-SD; Thu, 24 May 2012 12:38:06 -0400
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id A5BE51B4037;
	Thu, 24 May 2012 16:38:03 +0000 (UTC)
From: Mike Frysinger <vapier@gentoo.org>
Organization: wh0rd.org
To: coreutils@gnu.org
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Date: Thu, 24 May 2012 12:39:21 -0400
User-Agent: KMail/1.13.7 (Linux/3.4.0; KDE/4.6.5; x86_64; ; )
References: <4FBE3059.3030806@suse.de> <87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com>
In-Reply-To: <4FBE3CB0.7090901@draigBrady.com>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1980847.onUpWoAFzY";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201205241239.23442.vapier@gentoo.org>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 140.211.166.183
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 16:52:56 -0000

--nextPart1980847.onUpWoAFzY
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Thursday 24 May 2012 09:50:40 P=E1draig Brady wrote:
> On 05/24/2012 02:21 PM, Jim Meyering wrote:
> > I would like to remove su.c, if/when possible from coreutils.
> > The last time I proposed that, the Hurd was mentioned as a
> > reason not to, since they relied on the su from coreutils.
> >=20
> > Is that still the case, and if so, can you (the Hurd) switch
> > to the one from util-linux?
>=20
> Well it's not clear cut to me, given that su
> isn't really Linux specific.
>=20
> Note Fedora and Suse use su from coreutils
> while debian use their own:
> http://pkg-shadow.alioth.debian.org/

"shadow" isn't really a Debian project.  it was an independent one that slo=
wly=20
died, so peeps at Debian decided to pick it up.  the alioth site is a gener=
ic=20
project hosting site that Debian maintains to help out its developers.

Gentoo uses su from the shadow package too which makes sense considering it=
=20
provides the user management utilities (adduser/deluser/etc...) as well as=
=20
things like `login`.

it would be nice to find a single home for these guys (su, login, sulogin) =
as=20
we've got overlap with at least 4 projects: coreutils shadow util-linux=20
sysvinit.
=2Dmike

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJPvmQ7AAoJEEFjO5/oN/WBWY4QALmAbc2wQGAFCwyRxLTHdc0G
iMR8P5BPuIz08Y2p6eUqYt2ElkaT4AEucx45QBRrVz2l/oEJUamYUwP57YRleEBO
leO13rWNJ+P9jX4KXk1VQtZuiZvCRm9gNqkeCZqLxPtTHAbCQfh/ZnJC4ZT0p1J/
P/Ufol7UiaNqG3Fnnm7dBovlV2YyLjDju9zPoHN8TMNMNuClrZMI7vjSUyVCrnHz
Z4Pu8jNDW+o4xtQ6YTc5V4DVejSTG4SraKsl4urMKZpXaKlZ5rLmqdaEe75xL8QH
Mx2bnJxZY5E/XykP5OtJaVlvwCvZKbZ1NhUUxQuxcNhnHmwVhFTVbb1JX9GEjRZI
oqt2ElWKHWTHDTRXaLMLP4b50vRmT/nDu3z0LABD4y/JIiTOqRg/xeVOUxCYalv/
rbkKTYVfRp7mWkKkQd9bbZI+T4ze20H9esfCBv8J+V9s4f9hQYEbN6/GdQkh7rbo
9EMjLY0nJO3FU4R8oZ1eWSO3y8zV4amt4eFLTROrbBye5u7y8kOz5p3rDfKpRbRt
HPs9f34cZAEHdyQjt0UI0LyR2FWaXrHTShQwaUJm9Pfrp9VHg8bsf1RYNwhaCqkF
ufGWH4YVXYSYRb1TIE7enZfdgJEaSLkWM0XQW//vB30Ld98vfGrWDT0yF/TQJi7c
Z7pOAd9k6lE2aU6Es7ul
=cMI/
-----END PGP SIGNATURE-----

--nextPart1980847.onUpWoAFzY--


From MAILER-DAEMON Fri May 25 06:08:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXrRg-0001OY-CR
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 06:08:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38820)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXrRZ-0001BZ-W7
	for coreutils@gnu.org; Fri, 25 May 2012 06:08:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXrRY-0005tx-1L
	for coreutils@gnu.org; Fri, 25 May 2012 06:08:25 -0400
Received: from mx.meyering.net ([88.168.87.75]:44099)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1SXrRX-0005tJ-RS; Fri, 25 May 2012 06:08:23 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 4F80B6026B;
	Fri, 25 May 2012 12:08:21 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
In-Reply-To: <87zk8wboif.fsf@schwinge.name> (Thomas Schwinge's message of
	"Fri, 25 May 2012 11:26:00 +0200")
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net> <87zk8wboif.fsf@schwinge.name>
Date: Fri, 25 May 2012 12:08:21 +0200
Message-ID: <87likg8tey.fsf@rho.meyering.net>
Lines: 15
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: 88.168.87.75
Cc: hurd-devel@gnu.org, ludwig.nussel@suse.de, Coreutils <coreutils@gnu.org>,
	debian-hurd@lists.debian.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 10:08:31 -0000

Thomas Schwinge wrote:
...
>> I would like to remove su.c, if/when possible from coreutils.
>> The last time I proposed that, the Hurd was mentioned as a
>> reason not to, since they relied on the su from coreutils.
>>
>> Is that still the case, and if so, can you (the Hurd) switch
>> to the one from util-linux?
>
> Yes, that appears to be fine -- despite its name, we're using a lot of
> executables provided by util-linux.
>
> I'll test the branch in the lnussel repository and report back.

Glad to hear it.  Thanks!


From MAILER-DAEMON Fri May 25 10:31:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXvYU-0008Hk-DQ
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 10:31:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37369)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SXvYN-0008GK-QH
	for coreutils@gnu.org; Fri, 25 May 2012 10:31:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SXvYD-00054V-Uu
	for coreutils@gnu.org; Fri, 25 May 2012 10:31:43 -0400
Received: from mx1.redhat.com ([209.132.183.28]:59276)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>)
	id 1SXvYD-00054A-MV; Fri, 25 May 2012 10:31:33 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4PEVVKD017011
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 25 May 2012 10:31:31 -0400
Received: from [10.3.113.142] (ovpn-113-142.phx2.redhat.com [10.3.113.142])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q4PEVVIr000840; Fri, 25 May 2012 10:31:31 -0400
Message-ID: <4FBF97C2.6090502@redhat.com>
Date: Fri, 25 May 2012 08:31:30 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] maint: prohibit use of strncpy
References: <87wr41ac91.fsf@rho.meyering.net>
In-Reply-To: <87wr41ac91.fsf@rho.meyering.net>
X-Enigmail-Version: 1.4.1
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig2A8ED6B922696B415128D749"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: bug-gnulib <bug-gnulib@gnu.org>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:31:48 -0000

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

On 05/24/2012 08:23 AM, Jim Meyering wrote:
> The use of strncpy is so seldom justifiable, that it is best
> just to avoid it altogether.  Thus, we should enforce that:
>=20
>>From 22695d676de21d0af6d50ca8218eeb49b45608ab Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Thu, 24 May 2012 16:21:34 +0200
> Subject: [PATCH] maint: prohibit use of strncpy
>=20
> * cfg.mk (sc_prohibit_strncpy): New syntax-check rule.
> Exempt pinky.c and who.c, at least for now.
> ---
>  cfg.mk | 9 +++++++++
>  1 file changed, 9 insertions(+)
>=20
> diff --git a/cfg.mk b/cfg.mk
> index 7a86c2a..ff5d996 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -403,6 +403,12 @@ sc_prohibit_strncmp:
>  	  { echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
>  		1>&2; exit 1; } || :
>=20
> +# Really.  You don't want to use this function.
> +sc_prohibit_strncpy:
> +	@prohibit=3D'\<str''ncpy *\('					\
> +	halt=3D'do not use str''ncpy, period'				\
> +	  $(_sc_search_regexp)


This seems like it is worth floating into gnulib's maint.mk.

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPv5fCAAoJEKeha0olJ0Nq3W0H/im0OcBXMLuYKhYVM/73/97V
tzOOL7aulZ8bTcCkbP/VdBUx2PvMfAZIMDXF7G2NFwJ9ouSJuwcN1sZ2fphAsEv0
KGzKEWQSHeENs+boilY4CaImhDu3tdATN4ML5R+vV5XzGitM1cJvC5ZRKwgUYhYw
HQf1Uqj9/W6RGJgS5QK4jPTcMq63tGs1axsfK4wrrlSe/l9CTapQk1chuAHJwC1P
dNQB1e+y+nWYSdn3fa4AT8GMZeTM49AhLLciC35aXK5Ot10hWL855x+HbbslXwB1
lEX0Cc4vlhGj7//Q4Q0CFzjunlFHc8Ep41ZaFaVPuh1P6JyMZsJJsuNYJmwPXfY=
=94HK
-----END PGP SIGNATURE-----

--------------enig2A8ED6B922696B415128D749--


From MAILER-DAEMON Fri May 25 10:41:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXviF-0002Nx-LI
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 10:41:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56656)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXviD-0002Nn-0e
	for coreutils@gnu.org; Fri, 25 May 2012 10:41:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXvi2-0007lV-Vq
	for coreutils@gnu.org; Fri, 25 May 2012 10:41:52 -0400
Received: from mx.meyering.net ([88.168.87.75]:44873)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1SXvhy-0007kQ-2c; Fri, 25 May 2012 10:41:38 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 45BC360183;
	Fri, 25 May 2012 16:41:36 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH] maint: prohibit use of strncpy
In-Reply-To: <4FBF97C2.6090502@redhat.com> (Eric Blake's message of "Fri, 25
	May 2012 08:31:30 -0600")
References: <87wr41ac91.fsf@rho.meyering.net> <4FBF97C2.6090502@redhat.com>
Date: Fri, 25 May 2012 16:41:36 +0200
Message-ID: <87y5og7273.fsf@rho.meyering.net>
Lines: 86
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: 88.168.87.75
Cc: bug-gnulib <bug-gnulib@gnu.org>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 14:41:54 -0000

Eric Blake wrote:
> On 05/24/2012 08:23 AM, Jim Meyering wrote:
>> The use of strncpy is so seldom justifiable, that it is best
>> just to avoid it altogether.  Thus, we should enforce that:
>>
>>>From 22695d676de21d0af6d50ca8218eeb49b45608ab Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <meyering@redhat.com>
>> Date: Thu, 24 May 2012 16:21:34 +0200
>> Subject: [PATCH] maint: prohibit use of strncpy
>>
>> * cfg.mk (sc_prohibit_strncpy): New syntax-check rule.
>> Exempt pinky.c and who.c, at least for now.
>> ---
>>  cfg.mk | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/cfg.mk b/cfg.mk
>> index 7a86c2a..ff5d996 100644
>> --- a/cfg.mk
>> +++ b/cfg.mk
>> @@ -403,6 +403,12 @@ sc_prohibit_strncmp:
>>  	  { echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
>>  		1>&2; exit 1; } || :
>>
>> +# Really.  You don't want to use this function.
>> +sc_prohibit_strncpy:
>> +	@prohibit='\<str''ncpy *\('					\
>> +	halt='do not use str''ncpy, period'				\
>> +	  $(_sc_search_regexp)
>
>
> This seems like it is worth floating into gnulib's maint.mk.

That was my plan.
I notice that libvirt has had a similar rule for a couple of years.

This rule has two minor improvements over the one in coreutils:
I removed the str''ncpy obfuscation, since it wasn't needed,
and added comments.


>From 71b2855288794404177296fab5db2f851db7a8a8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 25 May 2012 16:38:49 +0200
Subject: [PATCH] maint.mk: add strncpy-prohibiting syntax-check rule

* top/maint.mk (sc_prohibit_strncpy): New rule, from coreutils.
---
 ChangeLog    | 5 +++++
 top/maint.mk | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 686228c..1252100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-25  Jim Meyering  <meyering@redhat.com>
+
+	maint.mk: add strncpy-prohibiting syntax-check rule
+	* top/maint.mk (sc_prohibit_strncpy): New rule, from coreutils.
+
 2012-05-24  Jim Meyering  <meyering@redhat.com>

 	maint.mk: compute $(gpg_key_ID) more portably
diff --git a/top/maint.mk b/top/maint.mk
index 9746410..11cb6a6 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -332,6 +332,14 @@ sc_prohibit_strcmp:
 	halt='$(ME): replace strcmp calls above with STREQ/STRNEQ'	\
 	  $(_sc_search_regexp)

+# Really.  You don't want to use this function.
+# It may fail to NUL-terminate the destination,
+# and always NUL-pads out to the specified length.
+sc_prohibit_strncpy:
+	@prohibit='\<strncpy *\('					\
+	halt='do not use strncpy, period'				\
+	  $(_sc_search_regexp)
+
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
 # Convert all uses automatically, via these two commands:
 # git grep -l '\<exit *(1)' \
--
1.7.10.2.565.gbd578b5


From MAILER-DAEMON Fri May 25 11:09:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXw98-00041q-9l
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 11:09:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45621)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1SXqI0-0007EF-SI
	for coreutils@gnu.org; Fri, 25 May 2012 04:54:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1SXqHu-0005DL-NG
	for coreutils@gnu.org; Fri, 25 May 2012 04:54:28 -0400
Received: from mx1.redhat.com ([209.132.183.28]:1025)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>)
	id 1SXqHj-0005An-Op; Fri, 25 May 2012 04:54:11 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4P8s1sd008076
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 25 May 2012 04:54:01 -0400
Received: from x2 (ovpn-116-57.ams2.redhat.com [10.36.116.57])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q4P8s0ZZ009931; Fri, 25 May 2012 04:54:00 -0400
Date: Fri, 25 May 2012 10:53:59 +0200
From: Karel Zak <kzak@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Message-ID: <20120525085359.GA3781@x2.net.home>
References: <4FBE3059.3030806@suse.de> <87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com>
	<201205241239.23442.vapier@gentoo.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201205241239.23442.vapier@gentoo.org>
User-Agent: Mutt/1.5.21 (2011-07-01)
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-Mailman-Approved-At: Fri, 25 May 2012 11:09:40 -0400
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:54:34 -0000

On Thu, May 24, 2012 at 12:39:21PM -0400, Mike Frysinger wrote:
> it would be nice to find a single home for these guys (su, login, sulogin) as 
> we've got overlap with at least 4 projects: coreutils shadow util-linux 
> sysvinit.

 mountpoint 
    - already merged from sysvinit into utils-linux 2.20

 sulogin
    - already merged from sysvinit into utils-linux 2.22

 last, lastb, wall, mesg
    - will be merged from sysvinit into util-linux (2.22 ?)

 pidof
    - from sysvinit; not sure, probably into procps-ng

 su
    - will be merged from coreutils into util-linux (2.22 ?)

 login
    - already merged Suse version into original login from utils-linux.
      The result is PAM-only login(1) with /etc/login.defs support.

      Fedora and Suse already use this login(1), Arch plans this change.


    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


From MAILER-DAEMON Fri May 25 11:09:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXw98-00042D-Cw
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 11:09:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56317)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>) id 1SXqn4-0006Ij-Eo
	for coreutils@gnu.org; Fri, 25 May 2012 05:26:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>) id 1SXqmx-0005Oe-UA
	for coreutils@gnu.org; Fri, 25 May 2012 05:26:34 -0400
Received: from relay1.mentorg.com ([192.94.38.131]:46272)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>)
	id 1SXqmp-0005Kv-QB; Fri, 25 May 2012 05:26:19 -0400
Received: from nat-ies.mentorg.com ([192.94.31.2]
	helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp 
	id 1SXqmi-0007hp-O3 from Thomas_Schwinge@mentor.com ;
	Fri, 25 May 2012 02:26:12 -0700
Received: from feldtkeller.schwinge.homeip.net ([172.30.72.54]) by
	EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); 
	Fri, 25 May 2012 10:26:11 +0100
From: Thomas Schwinge <thomas@codesourcery.com>
To: Jim Meyering <jim@meyering.net>, ludwig.nussel@suse.de
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
In-Reply-To: <87aa0xbtqa.fsf_-_@rho.meyering.net>
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net>
User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Fri, 25 May 2012 11:26:00 +0200
Message-ID: <87zk8wboif.fsf@schwinge.name>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"
X-OriginalArrivalTime: 25 May 2012 09:26:11.0966 (UTC)
	FILETIME=[6CBFE1E0:01CD3A58]
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 192.94.38.131
X-Mailman-Approved-At: Fri, 25 May 2012 11:09:40 -0400
Cc: hurd-devel@gnu.org, debian-hurd@lists.debian.org,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 09:26:40 -0000

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi!

CCing debian-hurd FYI.


On Thu, 24 May 2012 15:21:01 +0200, Jim Meyering <jim@meyering.net> wrote:
> P=C3=A1draig Brady wrote:
> > -------- Original Message --------
> > Subject: [PULL] su
> > Date: Thu, 24 May 2012 14:58:01 +0200
> > From: Ludwig Nussel <ludwig.nussel@suse.de>
> > To: util-linux@vger.kernel.org
> >
> > Hi,
> >
> > coreutils isn't really interested in maintaining su anymore.
> > Distributions have to add custom patches to fix bugs and add
> > features. The worst offender is probably the pam patch. Fortunately
> > we managed to sync the patch between openSUSE and Fedora meanwhile.
> > Over time the risk that the patches divert again increases though.
> > Since util-linux now contains a common login program it looks like a
> > good new home for su too.
> >
> > To integrate su into util-linux I've extracted the history of the su
> > program until the last GPLv2 version (they've changed to GPLv3
> > meanwhile) from coreutils' git and merged it with util-linux.
> > Then I've added the patches used in Fedora and openSUSE and fixed the
> > files to actually build.
> >
> > You can find the result in branch su-v1 (ff6b15d) at
> > git@github.com:lnussel/util-linux.git
> >
> > I've also filed a pull request on github:
> > https://github.com/karelzak/util-linux/pull/10
> >
> > Originally I had planned to implement separate tty allocation for
> > the child program on top of that to get rid of the evil setsid
> > patch. It turned out to be more complicated than I thought though. The
> > change would be too massive to backport anyways I guess. So the next
> > step would be to rip out the non-pam legacy stuff and clean up the code
> > to make it readable again.

> I would like to remove su.c, if/when possible from coreutils.
> The last time I proposed that, the Hurd was mentioned as a
> reason not to, since they relied on the su from coreutils.
>=20
> Is that still the case, and if so, can you (the Hurd) switch
> to the one from util-linux?

Yes, that appears to be fine -- despite its name, we're using a lot of
executables provided by util-linux.

I'll test the branch in the lnussel repository and report back.


Gr=C3=BC=C3=9Fe,
 Thomas

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJPv1AoAAoJENuKOtuXzphJrrIIAK5PRbUMGj/8MsL/R/Ggn8WQ
NE6E+rDvRgH0HU9UdyD5cgUbR3Alct35O9Ik8K+IGEBOmPsepJJs3hQg1qFiElMe
VVwrgQ7Rkb+Qk2Aq7vnevvPDmzgo7Owu2BwYY6DZL4Q7+awSzqiddRmr2W5PYbyj
Qv2UAPOCW9SS3CuCqLN7XF0Fa4lvqNyebYhjtRWqC4VJxkyDYHfsS6S03TJyuaXn
ywQz6gGW5FuOTYq15nOuG1jvPgdvM0/ivscoQz3KA+GNj0n9O2zh7colYGadwkxV
5EJfn1akZKjWDvtWkzN3Ytj7d59mRW/ceWes9+rupNxtsLd/UdhNj1qMbCwtR2w=
=jwST
-----END PGP SIGNATURE-----
--=-=-=--


From MAILER-DAEMON Fri May 25 11:09:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXw98-00042X-HS
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 11:09:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40951)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <snogglethorpe@gmail.com>) id 1SXqXN-0003E6-Hw
	for coreutils@gnu.org; Fri, 25 May 2012 05:10:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <snogglethorpe@gmail.com>) id 1SXqXH-0001iQ-Bc
	for coreutils@gnu.org; Fri, 25 May 2012 05:10:21 -0400
Received: from mail-vc0-f169.google.com ([209.85.220.169]:39933)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <snogglethorpe@gmail.com>)
	id 1SXqX4-0001T2-D3; Fri, 25 May 2012 05:10:02 -0400
Received: by vcbfl10 with SMTP id fl10so423692vcb.0
	for <multiple recipients>; Fri, 25 May 2012 02:09:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	bh=h8VvhJFtJMk+equQyuKnjKzc9llvIvByqGbfLDZTigY=;
	b=Epz6WB1zdjy9WnrJkEuXjF0pv87mIKfm5zckAIyr4cwPZk3ojphDeL5lG9DFLMfngO
	d5PEeqsoqsiZgNcdHMFRaPIsnxBmfLeaC3mU8cg8BELCd5//j72Xgd42FupNO/uXuF+a
	Y/GNSZQf2MXK4E2VcRsCX/sAL8I0EP5HBpnfWSDv3c7BBn/yaxq1TRzd0ovI3kdymJmM
	Rp4f+w9AC7eijZL+4MczhWHXraXzlRmTswg2WR4eiutsyto3ih3I6qlh7KlXJHiFBPDM
	zPjcC88Cvm/OGjJGLPWjTDEx/0ufHwbi412lZ+SGLbGiV4B1Io3f0BYUEGFzAn9Vrawc
	wWUw==
Received: by 10.220.153.80 with SMTP id j16mr2619012vcw.55.1337936999429; Fri,
	25 May 2012 02:09:59 -0700 (PDT)
MIME-Version: 1.0
Sender: snogglethorpe@gmail.com
Received: by 10.220.144.1 with HTTP; Fri, 25 May 2012 02:09:18 -0700 (PDT)
In-Reply-To: <20120525085359.GA3781@x2.net.home>
References: <4FBE3059.3030806@suse.de> <87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com>
	<201205241239.23442.vapier@gentoo.org>
	<20120525085359.GA3781@x2.net.home>
From: Miles Bader <miles@gnu.org>
Date: Fri, 25 May 2012 18:09:18 +0900
X-Google-Sender-Auth: ZA5aff8bUUwHMAzB5L0xoIr2Afo
Message-ID: <CADCnXobgySNLkeMhkaFQrYYf+x9TB9f1uZ=U6cDCujnAAJBzCA@mail.gmail.com>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
To: Karel Zak <kzak@redhat.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.220.169
X-Mailman-Approved-At: Fri, 25 May 2012 11:09:40 -0400
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 09:10:22 -0000

hmmm, is "utils-linux" stuff that has dependencies on linux-specific interf=
aces?

-miles

--=20
Cat is power. =A0Cat is peace.


From MAILER-DAEMON Fri May 25 11:09:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXw98-00042t-Lo
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 11:09:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47516)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1SXr4P-0000p6-BP
	for coreutils@gnu.org; Fri, 25 May 2012 05:44:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1SXr4L-0000bD-My
	for coreutils@gnu.org; Fri, 25 May 2012 05:44:28 -0400
Received: from mx1.redhat.com ([209.132.183.28]:60254)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>)
	id 1SXr4L-0000ay-FH; Fri, 25 May 2012 05:44:25 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4P9iMUG014709
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 25 May 2012 05:44:22 -0400
Received: from x2 (ovpn-116-57.ams2.redhat.com [10.36.116.57])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q4P9iLtu025550; Fri, 25 May 2012 05:44:22 -0400
Date: Fri, 25 May 2012 11:44:20 +0200
From: Karel Zak <kzak@redhat.com>
To: Miles Bader <miles@gnu.org>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Message-ID: <20120525094420.GB3781@x2.net.home>
References: <4FBE3059.3030806@suse.de> <87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com>
	<201205241239.23442.vapier@gentoo.org>
	<20120525085359.GA3781@x2.net.home>
	<CADCnXobgySNLkeMhkaFQrYYf+x9TB9f1uZ=U6cDCujnAAJBzCA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CADCnXobgySNLkeMhkaFQrYYf+x9TB9f1uZ=U6cDCujnAAJBzCA@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2011-07-01)
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-Mailman-Approved-At: Fri, 25 May 2012 11:09:40 -0400
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 09:44:35 -0000

On Fri, May 25, 2012 at 06:09:18PM +0900, Miles Bader wrote:
> hmmm, is "utils-linux" stuff that has dependencies on linux-specific interfaces?

 Linux is primary goal, but it seems we're already friendly to
 non-Linux platforms too (GNU/Hurd and Solaris).

 $ git log | grep Hurd
 defaults for Hurd.
 build-sys: minor changes for GNU/Hurd
 Here is a patch to fix the build on GNU/Hurd.
 implemented that way on the Hurd.  Is TIOCSETD any kind of standard?  Else I
 GNU/Hurd uses linux-like swapspace, so mkswap makes sense on
 Set DEFAULT_DEVICE and ALTERNATE_DEVICE for GNU/Hurd and FreeBSD

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


From MAILER-DAEMON Fri May 25 11:09:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXw98-00043W-Sr
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 11:09:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41854)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>) id 1SXrJr-0007UX-IB
	for coreutils@gnu.org; Fri, 25 May 2012 06:00:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>) id 1SXrJp-00049P-P5
	for coreutils@gnu.org; Fri, 25 May 2012 06:00:27 -0400
Received: from relay1.mentorg.com ([192.94.38.131]:50120)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>)
	id 1SXrJd-00046t-KN; Fri, 25 May 2012 06:00:13 -0400
Received: from nat-ies.mentorg.com ([192.94.31.2]
	helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp 
	id 1SXrJZ-0002NQ-Iz from Thomas_Schwinge@mentor.com ;
	Fri, 25 May 2012 03:00:09 -0700
Received: from feldtkeller.schwinge.homeip.net ([172.30.72.54]) by
	EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); 
	Fri, 25 May 2012 11:00:08 +0100
From: Thomas Schwinge <thomas@codesourcery.com>
To: Miles Bader <miles@gnu.org>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
In-Reply-To: <CADCnXobgySNLkeMhkaFQrYYf+x9TB9f1uZ=U6cDCujnAAJBzCA@mail.gmail.com>
References: <4FBE3059.3030806@suse.de> <87aa0xbtqa.fsf_-_@rho.meyering.net>
	<4FBE3CB0.7090901@draigBrady.com>
	<201205241239.23442.vapier@gentoo.org>
	<20120525085359.GA3781@x2.net.home>
	<CADCnXobgySNLkeMhkaFQrYYf+x9TB9f1uZ=U6cDCujnAAJBzCA@mail.gmail.com>
User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Fri, 25 May 2012 11:59:57 +0200
Message-ID: <87txz4bmxu.fsf@schwinge.name>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"
X-OriginalArrivalTime: 25 May 2012 10:00:08.0625 (UTC)
	FILETIME=[2AB16210:01CD3A5D]
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 192.94.38.131
X-Mailman-Approved-At: Fri, 25 May 2012 11:09:40 -0400
Cc: hurd-devel@gnu.org, Karel Zak <kzak@redhat.com>,
	Ludwig Nussel <ludwig.nussel@suse.de>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 10:00:29 -0000

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi!

On Fri, 25 May 2012 18:09:18 +0900, Miles Bader <miles@gnu.org> wrote:
> hmmm, is "utils-linux" stuff that has dependencies on linux-specific inte=
rfaces?

A bunch of it is, but they do have autoconf checks for these features,
and a configure run ends as follows, for example:

    [...]
    configure: WARNING: non-linux system; do not build libmount
    configure: WARNING: non-linux system; do not build mount
    configure: WARNING: non-linux system; do not build losetup
    configure: WARNING: libmount disabled; do not build fsck
    configure: WARNING: non-linux system; do not build partx
    configure: WARNING: libmount disabled; do not build mountpoint
    configure: WARNING: non-linux system; do not build fallocate
    configure: WARNING: non-linux system; do not build unshare
    checking for crc32 in -lz... yes
    configure: WARNING: non-linux system; do not build swapon
    configure: WARNING: non-linux system; do not build lsblk
    configure: WARNING: non-linux system; do not build lscpu
    configure: WARNING: non-linux system; do not build chcpu
    configure: WARNING: non-linux system; do not build wdctl
    configure: WARNING: non-linux system; do not build prlimit
    configure: WARNING: non-linux system; do not build lslocks
    configure: WARNING: non-linux system; do not build switch_root
    checking for syscall pivot_root... no
    configure: WARNING: Unable to detect syscall pivot_root.
    configure: WARNING: pivot_root syscall not found; do not build pivot_ro=
ot
    configure: WARNING: non-linux system; do not build kill
    configure: WARNING: non-linux system; do not build raw
    checking for syscall ioprio_set... no
    configure: WARNING: Unable to detect syscall ioprio_set.
    configure: WARNING: ioprio_set syscall not found; do not build ionice
    checking for syscall sched_getaffinity... no
    configure: WARNING: Unable to detect syscall sched_getaffinity.
    configure: WARNING: sched_getaffinity syscall not found; do not build t=
askset
    [...]


Gr=C3=BC=C3=9Fe,
 Thomas

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJPv1gdAAoJENuKOtuXzphJzFUH/14u0C5yjy+gPhcihCM5Ic/v
PCjY9PpFJIrpCmqw5chRUBxnXAnhNGwEnU8pgSDQoRk2GrRRpHiick8Wy4J7W0ZS
ajvL9b59UhbmfZkoDUbJk0p51Ggj1HiThq1FZpGY75TnQMBhiU3oEg0h+ELOnYMf
KmDP5vdyHDu3lxo4e07WLNsRtAGJQXfL29WOQNUP8BZmPuCu7pneLssA4KeoQXXB
2beZwO8Ctu0XTykeCPdv228XiTR+bv6TaHFlLaK9lm0WwwejIMUWw3c453azbSvB
dRPLT7bOmVVaSPRrmWAjD13hBq8oJh9J4W3AqjhtVaFBQBERJcnmsu3SA1jYY/U=
=LwZR
-----END PGP SIGNATURE-----
--=-=-=--


From MAILER-DAEMON Fri May 25 11:21:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXwKs-0005ZQ-Bc
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 11:21:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45692)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXwKl-0005Yc-Mf
	for coreutils@gnu.org; Fri, 25 May 2012 11:21:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SXwKf-0003tG-FS
	for coreutils@gnu.org; Fri, 25 May 2012 11:21:43 -0400
Received: from mx.meyering.net ([88.168.87.75]:45013)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1SXwKV-0003qr-3u; Fri, 25 May 2012 11:21:27 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 6402060183;
	Fri, 25 May 2012 17:21:25 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH] maint: prohibit use of strncpy
In-Reply-To: <87y5og7273.fsf@rho.meyering.net> (Jim Meyering's message of
	"Fri, 25 May 2012 16:41:36 +0200")
References: <87wr41ac91.fsf@rho.meyering.net> <4FBF97C2.6090502@redhat.com>
	<87y5og7273.fsf@rho.meyering.net>
Date: Fri, 25 May 2012 17:21:25 +0200
Message-ID: <87mx4w70cq.fsf@rho.meyering.net>
Lines: 46
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: 88.168.87.75
Cc: bug-gnulib <bug-gnulib@gnu.org>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:21:49 -0000

Jim Meyering wrote:

> Eric Blake wrote:
>> On 05/24/2012 08:23 AM, Jim Meyering wrote:
>>> The use of strncpy is so seldom justifiable, that it is best
>>> just to avoid it altogether.  Thus, we should enforce that:
>>>
>>>>From 22695d676de21d0af6d50ca8218eeb49b45608ab Mon Sep 17 00:00:00 2001
>>> From: Jim Meyering <meyering@redhat.com>
>>> Date: Thu, 24 May 2012 16:21:34 +0200
>>> Subject: [PATCH] maint: prohibit use of strncpy
>>>
>>> * cfg.mk (sc_prohibit_strncpy): New syntax-check rule.
>>> Exempt pinky.c and who.c, at least for now.
>>> ---
>>>  cfg.mk | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/cfg.mk b/cfg.mk
>>> index 7a86c2a..ff5d996 100644
>>> --- a/cfg.mk
>>> +++ b/cfg.mk
>>> @@ -403,6 +403,12 @@ sc_prohibit_strncmp:
>>>  	  { echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
>>>  		1>&2; exit 1; } || :
>>>
>>> +# Really.  You don't want to use this function.
>>> +sc_prohibit_strncpy:
>>> +	@prohibit='\<str''ncpy *\('					\
>>> +	halt='do not use str''ncpy, period'				\
>>> +	  $(_sc_search_regexp)
>>
>>
>> This seems like it is worth floating into gnulib's maint.mk.
>
> That was my plan.
> I notice that libvirt has had a similar rule for a couple of years.
>
> This rule has two minor improvements over the one in coreutils:
> I removed the str''ncpy obfuscation, since it wasn't needed,
> and added comments.

BTW, thanks for the prod.
I had committed that locally for coreutils, but had not pushed.
So now I can just omit the rule addition, but I do need to keep
the exemption-adding part.  Hmm... easier just to push both, I guess.


From MAILER-DAEMON Fri May 25 13:47:11 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SXybX-0003Gm-8c
	for mharc-coreutils@gnu.org; Fri, 25 May 2012 13:47:11 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42693)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1SXybU-0003Gc-7x
	for coreutils@gnu.org; Fri, 25 May 2012 13:47:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1SXybS-0002X8-Hj
	for coreutils@gnu.org; Fri, 25 May 2012 13:47:07 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:50426)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>)
	id 1SXybS-0002WW-Bi; Fri, 25 May 2012 13:47:06 -0400
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 5005B1B4005;
	Fri, 25 May 2012 17:47:03 +0000 (UTC)
From: Mike Frysinger <vapier@gentoo.org>
Organization: wh0rd.org
To: Karel Zak <kzak@redhat.com>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Date: Fri, 25 May 2012 13:48:29 -0400
User-Agent: KMail/1.13.7 (Linux/3.4.0; KDE/4.6.5; x86_64; ; )
References: <4FBE3059.3030806@suse.de> <201205241239.23442.vapier@gentoo.org>
	<20120525085359.GA3781@x2.net.home>
In-Reply-To: <20120525085359.GA3781@x2.net.home>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1781025.H64iFW0MEr";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201205251348.30812.vapier@gentoo.org>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 140.211.166.183
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 17:47:09 -0000

--nextPart1781025.H64iFW0MEr
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Friday 25 May 2012 04:53:59 Karel Zak wrote:
>  pidof
>     - from sysvinit; not sure, probably into procps-ng

with the new project, this is probably possible

>  su
>     - will be merged from coreutils into util-linux (2.22 ?)
>=20
>  login
>     - already merged Suse version into original login from utils-linux.
>       The result is PAM-only login(1) with /etc/login.defs support.

requiring pam is a problem.  i won't be able to convert over to util-linux =
for=20
utils that are pam-only.
=2Dmike

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJPv8XuAAoJEEFjO5/oN/WBuFoQAMYzQMfUIoyDdMN0dZj2M+oB
SH+kMP/xaVE5IaGH1dNFCyv+Suxa1lglI/L5Dz/bDDdF7spGjfNk8ESK6exwmwWq
SuGsTA3iMTitAlMyI34KJ07AnC5YYS8x22IpC5GKf0ilJ4LUInt6ZjXIvdyaZOLc
5Uijsi3P75//vJ15GNXe8C/fP6PZ0A3tbXlwZg13x0SS31nA4qF61UQo7Z0tOvDJ
Ra6EaUW+BZ29nUWHvttltubI8gdcW1ycmEYCGPDXFPm9W5PydykPv9Sfliv6HQVE
XvUgqiYahsXUJgTiXIG6X5fG8ketxYLGIXLNC5MPJSUe0/vivbfYd2nCr2MQ367a
Y/h1JAa1dNBOWKE3zoFjdF0rzUC89k7Em6UDYvGpp+wnFMgRF8kWjP+ugS/UIbDJ
7MmDPEXDf97oBYxYALlB8z/PCwMFWZpnH41tjpKKZiFQ+lIbGLR/56sxiqlQVUcM
T1onKsFu3LloOSw6UWIH8H+mXiL8a/q2//REMM8l/Mkl+aGG3beipTRI9IUBqc5K
1A8s95WJGU8KL/Y4ENJefReP8ze99tvpgnIgUX/VlXYfgn+3vZ2KsqzyUbfPULh2
ZOtC1AQ8emGh0R5or443NbJuzCMTsmzsIzqLHdf/wKtQzCs1yzYbpSffz98ddDp9
t/1k+dGalFo8iJseDxT8
=Y5iv
-----END PGP SIGNATURE-----

--nextPart1781025.H64iFW0MEr--


From MAILER-DAEMON Sat May 26 09:09:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYGk0-0003um-61
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 09:09:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46274)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYGjx-0003uc-IW
	for coreutils@gnu.org; Sat, 26 May 2012 09:09:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYGjv-0007hb-E2
	for coreutils@gnu.org; Sat, 26 May 2012 09:09:04 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.161]:54234)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYGjv-0007hG-7A
	for coreutils@gnu.org; Sat, 26 May 2012 09:09:03 -0400
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbvY44zMkpA==
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-070-142.pools.arcor-ip.net [88.68.70.142])
	by smtp.strato.de (joses mo40) (RZmta 29.9 DYNA|AUTH)
	with ESMTPA id L0183ao4Q8eebi ; Sat, 26 May 2012 15:09:01 +0200 (CEST)
From: Bruno Haible <bruno@clisp.org>
To: coreutils@gnu.org
Bcc: bruno@haible.de
Subject: program that runs a given command under a given gid
Date: Sat, 26 May 2012 15:10:02 +0200
Message-ID: <1602772.WKngQfYvZi@linuix>
User-Agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 81.169.146.161
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:09:07 -0000

Hi,

Is there a program that runs a given command with the identity changed
to a given group id? Like 'sudo' does for the uid, but for the gid instead.
Does such a program exist?

I'd suggest that such a program gets added to coreutils.

My use-case is that I have a large program that I want specific users
to be able to execute, but not other users. To this effect, I have created
a group (in /etc/group) and added the users to it.

The program creates and modifies directories in a particular location
(e.g. under /var). Of course, these files should not be world-writable
but group-writable. So that a user U1 can create files that U2 will be
able to operate on, they should be chgrp'ed to the specific group, and
chmod'ed to mode 664.

There are two ways to accomplish this:
  1) Scan the source code and add, after every file creation via
     open() or fopen() or shell redirections etc. a
     "chgrp $g $file && chown g+w $file" action.
  2) Change the group of the process so that new files will be chgrp'ed
     to the specific group automatically, and set the umask to 002.

The first approach is not realizable if the program is large or not free.
Whereas with the second approach there is the problem that setgid()
and setregid() are not allowed to normal users, *even* if they are
members of the target group.

How to reproduce:
  $ id
  uid=1000(bruno) gid=100(users) groups=100(users),33(video)
  $ cat foo.c
  #include <stdio.h>
  #include <unistd.h>
  int main ()
  {
    if (setgid (33) < 0)
      perror ("setgid");
    if (setregid (33, 33) < 0)
      perror ("setregid");
    return 0;
  }
  $ gcc -Wall foo.c -o foo
  $ ./foo
  setgid: Operation not permitted
  setregid: Operation not permitted

In other words, when a user U has his primary group G1 and is additionally
in G2, there is an asymmetry between G1 and G2. In some cases the user
would want to act as if G2 was his primary group.

So, what is needed is a program that takes
  1) a group number or name as first argument,
  2) a program name and a set of further arguments.
It should first verify that the user is in the specified group (via
comparison with getgid() and gnulib's group_member() function), otherwise
we would be opening a security hole.
Then it should call setregid (g, g).
Finally it should execv() to the specified program.

I can write such a thing myself for my use-case, but since the asymmetry
between primary and additional groups is something that is not specific
to my application, it would be nice if coreutils had this.

Bruno



From MAILER-DAEMON Sat May 26 09:33:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYH7A-0006zd-Ny
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 09:33:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41982)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SYH77-0006yc-LT
	for coreutils@gnu.org; Sat, 26 May 2012 09:33:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SYH75-0005KD-SA
	for coreutils@gnu.org; Sat, 26 May 2012 09:33:01 -0400
Received: from mail-bk0-f41.google.com ([209.85.214.41]:37107)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SYH75-0005K7-Ik
	for coreutils@gnu.org; Sat, 26 May 2012 09:32:59 -0400
Received: by bkcjm19 with SMTP id jm19so1635655bkc.0
	for <coreutils@gnu.org>; Sat, 26 May 2012 06:32:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=tgZKpmVGKpkmMIjRhBHpRWxHXlP027GYdbJ1p+NRqew=;
	b=nNx0P4gjl3ITEt5DiCFbap74YRcWNpHXg80zmotLJmI5B8fVKiIqcXo7hkbW/1L/Dr
	uMn0pgOknHHJ8aknmK3+6pVFy49PtGSp4f0ovu3kDlzVOgohZlQD8yUM+Y4O15DWUGlm
	u0uxZKkqtkVMArbKwrZ6L6tuGOlQawB/hQvkPqrmS7B23mCN4fzCz83GMyxm6sLdKwnH
	dj4ZsVfZNk/vU2f8FQ9b3pjH/X78ohIp80aYNdoP5ySLken90bMxtfgMUZaDi/it9qHT
	TwLTt7YmUBxQWjzscCkoerzIhmHTK8pXn/RE6giwpzn2Nunz2jirkozn2uyfya0ZueDJ
	Gy8g==
Received: by 10.205.127.140 with SMTP id ha12mr930848bkc.105.1338039176525;
	Sat, 26 May 2012 06:32:56 -0700 (PDT)
Received: from Jann-PC.fritz.box (77-22-154-252-dynip.superkabel.de.
	[77.22.154.252])
	by mx.google.com with ESMTPS id h18sm9141868bkh.8.2012.05.26.06.32.55
	(version=SSLv3 cipher=OTHER); Sat, 26 May 2012 06:32:55 -0700 (PDT)
Date: Sat, 26 May 2012 15:32:52 +0200
From: Jann Horn <jannhorn@googlemail.com>
To: Bruno Haible <bruno@clisp.org>
Subject: Re: program that runs a given command under a given gid
Message-ID: <20120526133252.GB3238@Jann-PC.fritz.box>
References: <1602772.WKngQfYvZi@linuix>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz"
Content-Disposition: inline
In-Reply-To: <1602772.WKngQfYvZi@linuix>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.41
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:33:02 -0000


--0eh6TmSyL6TZE2Uz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 26, 2012 at 03:10:02PM +0200, Bruno Haible wrote:
> Hi,
>=20
> Is there a program that runs a given command with the identity changed
> to a given group id? Like 'sudo' does for the uid, but for the gid instea=
d.
> Does such a program exist?

=46rom the sudo manpage:

       -g group    Normally, sudo sets the primary group to the one specifi=
ed by the passwd database for the user the command is being run as (by defa=
ult, root).  The -g
                   (group) option causes sudo to run the specified command =
with the primary group set to group.  To specify a gid instead of a group n=
ame, use #gid.  When
                   running commands as a gid, many shells require that the =
'#' be escaped with a backslash ('\').  If no -u option is specified, the c=
ommand will be run as
                   the invoking user (not root).  In either case, the prima=
ry group will be set to group.



--0eh6TmSyL6TZE2Uz
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJPwNuDAAoJEGhmizV0f2d1CtEQAKOwTcJW25f4xxSKofFSiTiX
0YQrXh4YeH3QoCOpM+2IRMpvZNjcTGQo7zN4iBGmE4003l45d8nmuQKydltP+y9k
JBzT9HsP0ZDKdV71ieAF7vvjukWzVNdyhR18MAe+px3PvhWD227Ji21+D6dT50uD
dAJGQMghUHPaKDcQ/Qbh56fCLwAepl3x3tSxM1Gg8prxZ0sWnU0/yStm5rRXzMmr
LDXaNkZY0VGBZsYnrgN8XJt3GpUWmMFC8h6amfOP+y4N5e23YH2imvIMIt/Kq9J5
J342TuVK+HuoDCutdbGP9Pc1PHCH11CxMCO1MLshE+2EQosPA+31QT4QnXmIu/pP
Umh8IBZn+P4GVkCxlFFv1jQeXDQnAwWlhJFJXXSfmXrw1+FV0Zs8k7AVaysbvXq2
39ooPJqtTukUvt0RGyeQmKDHmCA2mgnlhITv8aVUiCiIphj/8kelrN26CWtj5ruJ
dkUBO5XHJH9wUCmPFlEto8Xx8YEAgg+zdpbf1gyU277vCwx4RNuNRwoN8ldjZk9B
fltuum2qvsvT468XgkGu623vKhv+omX4FuFBmjj/Jcwu0tepuoBi5x8FImycl7hb
OPHB/VRB/5KLXG85lv7798pO6KkVYfkvbgV80LvgmHPj6QVFHE36HFWb84nNO5U6
4Yr6b+ejcR5NadTjHVic
=B+Vy
-----END PGP SIGNATURE-----

--0eh6TmSyL6TZE2Uz--


From MAILER-DAEMON Sat May 26 09:36:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYHAG-0007Cd-2f
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 09:36:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59872)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SYHAD-0007Ba-Ep
	for coreutils@gnu.org; Sat, 26 May 2012 09:36:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SYHAB-0005s3-LI
	for coreutils@gnu.org; Sat, 26 May 2012 09:36:13 -0400
Received: from mail-bk0-f41.google.com ([209.85.214.41]:39981)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jannhorn@googlemail.com>) id 1SYHAB-0005q8-Bq
	for coreutils@gnu.org; Sat, 26 May 2012 09:36:11 -0400
Received: by bkcjm19 with SMTP id jm19so1636895bkc.0
	for <coreutils@gnu.org>; Sat, 26 May 2012 06:36:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	bh=terGyzjHw/S/5EsvVxNkZNV+lr8KtvAb14ew71JbzzE=;
	b=sB9U3ymlPqNulUBP33GjFgyurBhji+alLNNhH3ydirS1J3buFJFIuNUQ9wUTsUjw7n
	Y2QpkULB+XpIiaXCma6sirFqS9c3dm83Q7/i8axy8LpCtoUlNGWraTXm9Pw2/fmofFgZ
	JNlQmKt8MyA6FESimRvgwB4AiYajhRHutWFsvzMKryRtaQ0nua21uIZutiw0ZUNylEhj
	mO5tyW7TCjQ4YUnXryw0BTP5sh5EcKThDKpaXHNx+DjuC+3klpwEK+j0RUxiRONOKcha
	hn6/l3j+Jexf7GU3t150WcTgg0HMSsE8vZWrtNZRfvEqvgmHyXlTQgWbioBUTfTJ/lXr
	gL3g==
Received: by 10.205.119.146 with SMTP id fu18mr1011382bkc.14.1338039369278;
	Sat, 26 May 2012 06:36:09 -0700 (PDT)
Received: from Jann-PC.fritz.box (77-22-154-252-dynip.superkabel.de.
	[77.22.154.252])
	by mx.google.com with ESMTPS id n19sm9135513bkv.14.2012.05.26.06.36.08
	(version=SSLv3 cipher=OTHER); Sat, 26 May 2012 06:36:08 -0700 (PDT)
Date: Sat, 26 May 2012 15:36:05 +0200
From: Jann Horn <jannhorn@googlemail.com>
To: Bruno Haible <bruno@clisp.org>
Subject: Re: program that runs a given command under a given gid
Message-ID: <20120526133605.GC3238@Jann-PC.fritz.box>
References: <1602772.WKngQfYvZi@linuix>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="s9fJI615cBHmzTOP"
Content-Disposition: inline
In-Reply-To: <1602772.WKngQfYvZi@linuix>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.41
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:36:14 -0000


--s9fJI615cBHmzTOP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, May 26, 2012 at 03:10:02PM +0200, Bruno Haible wrote:
>   1) Scan the source code and add, after every file creation via
>      open() or fopen() or shell redirections etc. a
>      "chgrp $g $file && chown g+w $file" action.

> The first approach is not realizable if the program is large or not free.
> Whereas with the second approach there is the problem that setgid()
> and setregid() are not allowed to normal users, *even* if they are
> members of the target group.

As long as that program doesn't use syscalls directly and uses the libc instead, you should be able to shim in a custom open() using LD_PRELOAD or so, right?

--s9fJI615cBHmzTOP
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJPwNxFAAoJEGhmizV0f2d1ccwP/1zHQZVcVrCyvRsalDAschN9
zJRvoiU2IA7X9ANun6QnSnsowlaBk8uKliJJJYDyElX7ckrcJuMTHM9gQNmCbkG7
3r9VwUGgj9MpBC6ViDaxkZbTvMG7aDBLYWn4jR/oVVqKnEhH1AC5Efa/eOi5jYlt
RNxP3ZIxkmZjgKwdljID3x5HXna0TzDlCxB5x5D2OVmrFonN4P1vd5+FPuOO5P/H
C53psj/GcBpYnkQm5XrQh/fV0pjQjLe+kqUjs2cIvBGoh/evqIknvfhmrprspSVE
ONFYiSxQy9zvH/rkD9QWX+9kUp/R1HAL49Ic9DzwRQw2Qxk8gZ9/MRd/lhwj4bfM
YvKMdyM1AuYYJb0ozGl1sT1doB1TdvtG2KeFRsApoXFfsc9uDb4sKXtmGL4zodMP
GvMqFOdPyfrS1vFrH+S+JsgZeziVjA38YvSrk6mRtPSWgE/aVMYq80iu/wb0uJ8o
rKKRIrDk+SoIRJgb555XW+B46MgTmlfiyDMRO3TPGUo1MvvpJpRSGJ06VgbV1sHk
wtMK5Cj+Wt3+RqyXtUjxSbouGuSxEKWCfhzAPTVHuEJ5Oiao9QLqi9ZWxZi+BnaS
Z5o92TzYD7DAwE/uRsS4ylZfb1dgDT90lvoH/L/L30d0xfHB5xMeWJZxdx3AcnD+
WbkjvucwlATD9Lf99Ewc
=1snv
-----END PGP SIGNATURE-----

--s9fJI615cBHmzTOP--


From MAILER-DAEMON Sat May 26 12:29:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYJs9-0007um-QQ
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 12:29:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38702)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYJs6-0007sl-TJ
	for coreutils@gnu.org; Sat, 26 May 2012 12:29:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYJs5-00074G-8J
	for coreutils@gnu.org; Sat, 26 May 2012 12:29:42 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.161]:20564)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYJs5-000749-1q
	for coreutils@gnu.org; Sat, 26 May 2012 12:29:41 -0400
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbvY44zMkpA==
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-070-142.pools.arcor-ip.net [88.68.70.142])
	by smtp.strato.de (josoe mo44) (RZmta 29.9 DYNA|AUTH)
	with ESMTPA id j04a2ao4QFOsh5 ; Sat, 26 May 2012 18:29:39 +0200 (CEST)
From: Bruno Haible <bruno@clisp.org>
To: Jann Horn <jannhorn@googlemail.com>
Bcc: bruno@haible.de
Subject: Re: program that runs a given command under a given gid
Date: Sat, 26 May 2012 18:30:41 +0200
Message-ID: <2568718.2KHcguU0EW@linuix>
User-Agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )
In-Reply-To: <20120526133252.GB3238@Jann-PC.fritz.box>
References: <1602772.WKngQfYvZi@linuix>
	<20120526133252.GB3238@Jann-PC.fritz.box>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 81.169.146.161
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 16:29:44 -0000

Jann Horn wrote:
> From the sudo manpage:
> 
>        -g group    Normally, sudo sets the primary group to the one specified by the passwd database for the user the command is being run as (by default, root).  The -g
>                    (group) option causes sudo to run the specified command with the primary group set to group.  To specify a gid instead of a group name, use #gid.  When
>                    running commands as a gid, many shells require that the '#' be escaped with a backslash ('\').  If no -u option is specified, the command will be run as
>                    the invoking user (not root).  In either case, the primary group will be set to group.

It would be nice, but doesn't work (on openSUSE at least):

$ id
uid=1000(bruno) gid=100(users) groups=100(users),33(video)
$ sudo -g '#33' /bin/pwd
Sorry, user bruno is not allowed to execute '/bin/pwd' as bruno:video on linuix.
$ sudo -g video /bin/pwd
Sorry, user bruno is not allowed to execute '/bin/pwd' as bruno:video on linuix.

Probably this could be changed in the /etc/sudoers file...

Bruno



From MAILER-DAEMON Sat May 26 12:34:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYJx5-00005d-H9
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 12:34:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45203)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYJx3-00005W-Ae
	for coreutils@gnu.org; Sat, 26 May 2012 12:34:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYJx1-0007s2-Ez
	for coreutils@gnu.org; Sat, 26 May 2012 12:34:48 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.161]:40131)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1SYJx1-0007rr-9C
	for coreutils@gnu.org; Sat, 26 May 2012 12:34:47 -0400
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbvY44zMkpA==
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-070-142.pools.arcor-ip.net [88.68.70.142])
	by smtp.strato.de (joses mo87) (RZmta 29.9 DYNA|AUTH)
	with ESMTPA id U02958o4QDqwrC ; Sat, 26 May 2012 18:34:45 +0200 (CEST)
From: Bruno Haible <bruno@clisp.org>
To: coreutils@gnu.org
Bcc: bruno@haible.de
Subject: Re: program that runs a given command under a given gid
Date: Sat, 26 May 2012 18:35:48 +0200
Message-ID: <29759345.83clBTesIj@linuix>
User-Agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )
In-Reply-To: <1602772.WKngQfYvZi@linuix>
References: <1602772.WKngQfYvZi@linuix>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 81.169.146.161
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 16:34:50 -0000

I asked:
> Is there a program that runs a given command with the identity changed
> to a given group id? Like 'sudo' does for the uid, but for the gid instead.
> Does such a program exist?

Yes. 'newgrp' and 'sg'. newgrp is even specified by POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/newgrp.html

> I'd suggest that such a program gets added to coreutils.

'newgrp' and 'sg' already exist in pwdutils.

Sorry for the noise.

Bruno



From MAILER-DAEMON Sat May 26 23:06:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYToS-0001j8-Ct
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 23:06:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34036)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aedelatorre@gmail.com>) id 1SYRN1-0004jP-Rp
	for coreutils@gnu.org; Sat, 26 May 2012 20:30:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aedelatorre@gmail.com>) id 1SYRMy-0001Ob-T6
	for coreutils@gnu.org; Sat, 26 May 2012 20:30:07 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:63809)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aedelatorre@gmail.com>) id 1SYRMy-0001Lb-MP
	for coreutils@gnu.org; Sat, 26 May 2012 20:30:04 -0400
Received: by yenm7 with SMTP id m7so1152328yen.0
	for <coreutils@gnu.org>; Sat, 26 May 2012 17:30:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type;
	bh=NTVVH/q+CUtLhmJQxaBQmTyX6YxsgN9DfNa/PmR2MR8=;
	b=OkLwUJeFehzJjgCjeK7cBqh8dNV+TY1ZDZ6KPmkW/17OEIbtSo+ILfHgL6U6FHsPHm
	En4BTptiKDqWaUwZuQpYlQs/tOf7oaiiLJt/DMXNDwm2mAfBTVvT9A0uWJkK0Masdaf4
	EMAy9ssCxZSuHV+hNc27XZOmGlrI5aNip4RFs3YPLB+F7KipG3QMn9etcE9VK/RwQmMM
	tsa341wBZgK1zhQbE/gmWSHxqCZkVTVe5yPMLyQF3p2Li3DngnL2EW1hFk2IHi5gVZdt
	eVWSiDvGn2J1Mwew+xchilONe2zipqTZOxE3W4vYrkeBUExuylGExc/LKVLSaJzGHHjN
	ujDA==
MIME-Version: 1.0
Received: by 10.236.201.229 with SMTP id b65mr3382400yho.80.1338078603127;
	Sat, 26 May 2012 17:30:03 -0700 (PDT)
Received: by 10.146.245.6 with HTTP; Sat, 26 May 2012 17:30:03 -0700 (PDT)
Date: Sun, 27 May 2012 02:30:03 +0200
Message-ID: <CAKZ=RP_guxuSVMWF9M573wbM7D+=aOZ_CimPaiAcpJSOYMvO_A@mail.gmail.com>
Subject: Re: bug#7313: sha1sum etc, output in base64
From: Alfredo Esteban <aedelatorre@gmail.com>
To: coreutils@gnu.org
Content-Type: multipart/alternative; boundary=20cf3056423dd22a7504c0f9b3c8
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.169
X-Mailman-Approved-At: Sat, 26 May 2012 23:06:34 -0400
Cc: xenoterracide@gmail.com
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 00:30:09 -0000

--20cf3056423dd22a7504c0f9b3c8
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I'm sending the patch to have a new flag "--raw" to get raw binary output
format.

For example:

> ./sha256sum --raw sha256sum | base64
hEvelDEDIpi5Ed7hCkdj0+5kw8cWzuRDRrQthIPS6nU=

Alfredo

--20cf3056423dd22a7504c0f9b3c8
Content-Type: text/html; charset=ISO-8859-1

Hi,<br><br>I&#39;m sending the patch to have a new flag &quot;--raw&quot; to get raw binary output format.<br><br>For example:<br><br>&gt; ./sha256sum --raw sha256sum | base64<br>hEvelDEDIpi5Ed7hCkdj0+5kw8cWzuRDRrQthIPS6nU=<br>
<br>Alfredo<br>

--20cf3056423dd22a7504c0f9b3c8--


From MAILER-DAEMON Sat May 26 23:06:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SYToS-0001jP-Fu
	for mharc-coreutils@gnu.org; Sat, 26 May 2012 23:06:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34211)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aedelatorre@gmail.com>) id 1SYRP2-0004qw-No
	for coreutils@gnu.org; Sat, 26 May 2012 20:32:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aedelatorre@gmail.com>) id 1SYRP1-0001pX-5A
	for coreutils@gnu.org; Sat, 26 May 2012 20:32:12 -0400
Received: from mail-yw0-f41.google.com ([209.85.213.41]:52584)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aedelatorre@gmail.com>) id 1SYRP0-0001pT-UO
	for coreutils@gnu.org; Sat, 26 May 2012 20:32:11 -0400
Received: by yhr47 with SMTP id 47so1463339yhr.0
	for <coreutils@gnu.org>; Sat, 26 May 2012 17:32:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=cVGvLJQnW+SRaNsXNKmECsZ3pFe8vrClzZYF3IEK2i8=;
	b=ej59qfpQoUrBvrnlYQXJe9H8vWBX/9qEQ2mtioJm4PP0PH/CRLIneT5Yjol5685atc
	GC7AHC34HEKAUWI7jffAS4oWAJJLnHeUO4cZxAHzdggJKjwxyxgbw/4rnG+OBUgnniOx
	sqa1jV2m98HMZ2XNJAzLbNX+9uXIimYdgC3u+6ROFpY9V2roCFGX19KftIngLf29CzWt
	pBLxpdwio1OsfDL1u5S4ybCHM6fQjpDjt/UN0CCf0kIqhtFLCTgRx88eSEFffuisF0QG
	9XGt5IX0fv2hpumG9TAiPp+LuftrrFg59pObZCmKGVqBJUhu23OkVis9dArSIv2qd0ts
	V2VQ==
MIME-Version: 1.0
Received: by 10.236.78.227 with SMTP id g63mr3362707yhe.87.1338078729326; Sat,
	26 May 2012 17:32:09 -0700 (PDT)
Received: by 10.146.245.6 with HTTP; Sat, 26 May 2012 17:32:06 -0700 (PDT)
In-Reply-To: <CAKZ=RP_guxuSVMWF9M573wbM7D+=aOZ_CimPaiAcpJSOYMvO_A@mail.gmail.com>
References: <CAKZ=RP_guxuSVMWF9M573wbM7D+=aOZ_CimPaiAcpJSOYMvO_A@mail.gmail.com>
Date: Sun, 27 May 2012 02:32:06 +0200
Message-ID: <CAKZ=RP9GOh96hpG3jAdTh4k2vGdO6tYtMBnXXyVgdNa_CE2pKw@mail.gmail.com>
Subject: Re: bug#7313: sha1sum etc, output in base64
From: Alfredo Esteban <aedelatorre@gmail.com>
To: coreutils@gnu.org
Content-Type: multipart/mixed; boundary=20cf300fb41957ce7404c0f9bb80
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.213.41
X-Mailman-Approved-At: Sat, 26 May 2012 23:06:34 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 00:32:13 -0000

--20cf300fb41957ce7404c0f9bb80
Content-Type: multipart/alternative; boundary=20cf300fb41957ce7004c0f9bb7e

--20cf300fb41957ce7004c0f9bb7e
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I'm sending the patch to have a new flag "--raw" to get raw binary output
format.

For example:

> ./sha256sum --raw sha256sum | base64
hEvelDEDIpi5Ed7hCkdj0+5kw8cWzuRDRrQthIPS6nU=

Alfredo

--20cf300fb41957ce7004c0f9bb7e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">Hi,<br><br>I&#39;m sending the patch to have a n=
ew flag &quot;--raw&quot; to get raw binary output format.<br><br>For examp=
le:<br><br>&gt; ./sha256sum --raw sha256sum | base64<br>hEvelDEDIpi5Ed7hCkd=
j0+5kw8cWzuRDRrQthIPS6nU=3D<span class=3D"HOEnZb"><font color=3D"#888888"><=
br>

<br>Alfredo<br>
</font></span></div><br>

--20cf300fb41957ce7004c0f9bb7e--
--20cf300fb41957ce7404c0f9bb80
Content-Type: application/octet-stream; name="patch-raw_output.diff"
Content-Disposition: attachment; filename="patch-raw_output.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h2pdihva0

ZGlmZiAtLWdpdCBhL3NyYy9tZDVzdW0uYyBiL3NyYy9tZDVzdW0uYwppbmRleCBmN2UwODQ5Li43
YmY5MzkxIDEwMDY0NAotLS0gYS9zcmMvbWQ1c3VtLmMKKysrIGIvc3JjL21kNXN1bS5jCkBAIC0x
MjksMTMgKzEyOSwxNyBAQCBzdGF0aWMgYm9vbCBzdHJpY3QgPSBmYWxzZTsKIC8qIFdoZXRoZXIg
YSBCU0QgcmV2ZXJzZWQgZm9ybWF0IGNoZWNrc3VtIGlzIGRldGVjdGVkLiAgKi8KIHN0YXRpYyBp
bnQgYnNkX3JldmVyc2VkID0gLTE7CiAKKy8qIFdoZXRoZXIgb3V0cHV0IGlzIGJpbmFyeSBvciBo
ZXhhZGVjaW1hbCBmb3JtYXQuICAqLworc3RhdGljIGJvb2wgcmF3X291dHB1dCA9IGZhbHNlOwor
CiAvKiBGb3IgbG9uZyBvcHRpb25zIHRoYXQgaGF2ZSBubyBlcXVpdmFsZW50IHNob3J0IG9wdGlv
biwgdXNlIGEKICAgIG5vbi1jaGFyYWN0ZXIgYXMgYSBwc2V1ZG8gc2hvcnQgb3B0aW9uLCBzdGFy
dGluZyB3aXRoIENIQVJfTUFYICsgMS4gICovCiBlbnVtCiB7CiAgIFNUQVRVU19PUFRJT04gPSBD
SEFSX01BWCArIDEsCiAgIFFVSUVUX09QVElPTiwKLSAgU1RSSUNUX09QVElPTgorICBTVFJJQ1Rf
T1BUSU9OLAorICBSQVdfT1BUSU9OCiB9OwogCiBzdGF0aWMgc3RydWN0IG9wdGlvbiBjb25zdCBs
b25nX29wdGlvbnNbXSA9CkBAIC0xNDcsNiArMTUxLDcgQEAgc3RhdGljIHN0cnVjdCBvcHRpb24g
Y29uc3QgbG9uZ19vcHRpb25zW10gPQogICB7ICJ0ZXh0Iiwgbm9fYXJndW1lbnQsIE5VTEwsICd0
JyB9LAogICB7ICJ3YXJuIiwgbm9fYXJndW1lbnQsIE5VTEwsICd3JyB9LAogICB7ICJzdHJpY3Qi
LCBub19hcmd1bWVudCwgTlVMTCwgU1RSSUNUX09QVElPTiB9LAorICB7ICJyYXciLCBub19hcmd1
bWVudCwgTlVMTCwgUkFXX09QVElPTiB9LAogICB7IEdFVE9QVF9IRUxQX09QVElPTl9ERUNMIH0s
CiAgIHsgR0VUT1BUX1ZFUlNJT05fT1BUSU9OX0RFQ0wgfSwKICAgeyBOVUxMLCAwLCBOVUxMLCAw
IH0KQEAgLTE4OCw2ICsxOTMsOSBAQCBXaXRoIG5vIEZJTEUsIG9yIHdoZW4gRklMRSBpcyAtLCBy
ZWFkIHN0YW5kYXJkIGlucHV0LlxuXAogICAtdCwgLS10ZXh0ICAgICAgICAgICByZWFkIGluIHRl
eHQgbW9kZSAoZGVmYXVsdClcblwKICIpLCBzdGRvdXQpOwogICAgICAgZnB1dHMgKF8oIlwKKyAg
ICAgIC0tcmF3ICAgICAgICAgICAgb3V0cHV0IGluIGJpbmFyeSBmb3JtYXQgKHVzZWZ1bCB0byB1
c2UgcGlwZXMpXG5cCisiKSwgc3Rkb3V0KTsKKyAgICAgIGZwdXRzIChfKCJcCiBcblwKIFRoZSBm
b2xsb3dpbmcgdGhyZWUgb3B0aW9ucyBhcmUgdXNlZnVsIG9ubHkgd2hlbiB2ZXJpZnlpbmcgY2hl
Y2tzdW1zOlxuXAogICAgICAgLS1xdWlldCAgICAgICAgICBkb24ndCBwcmludCBPSyBmb3IgZWFj
aCBzdWNjZXNzZnVsbHkgdmVyaWZpZWQgZmlsZVxuXApAQCAtNjkwLDYgKzY5OCw5IEBAIG1haW4g
KGludCBhcmdjLCBjaGFyICoqYXJndikKICAgICAgIGNhc2UgU1RSSUNUX09QVElPTjoKICAgICAg
ICAgc3RyaWN0ID0gdHJ1ZTsKICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFJBV19PUFRJT046
CisgICAgICAgIHJhd19vdXRwdXQgPSB0cnVlOworICAgICAgICBicmVhazsKICAgICAgIGNhc2Vf
R0VUT1BUX0hFTFBfQ0hBUjsKICAgICAgIGNhc2VfR0VUT1BUX1ZFUlNJT05fQ0hBUiAoUFJPR1JB
TV9OQU1FLCBBVVRIT1JTKTsKICAgICAgIGRlZmF1bHQ6CkBAIC03NTIsNiArNzYzLDEzIEBAIG1h
aW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKIAogICAgICAgICAgIGlmICghIGRpZ2VzdF9maWxl
IChmaWxlLCAmZmlsZV9pc19iaW5hcnksIGJpbl9idWZmZXIpKQogICAgICAgICAgICAgb2sgPSBm
YWxzZTsKKyAgICAgICAgICBlbHNlIGlmIChyYXdfb3V0cHV0KQorICAgICAgICAgICAgeworICAg
ICAgICAgICAgICBzaXplX3QgaTsKKworICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgRElH
RVNUX0JJTl9CWVRFUzsgKytpKQorICAgICAgICAgICAgICAgIHB1dGNoYXIoYmluX2J1ZmZlcltp
XSk7CisgICAgICAgICAgICB9CiAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgewogICAgICAg
ICAgICAgICBzaXplX3QgaTsK
--20cf300fb41957ce7404c0f9bb80--


From MAILER-DAEMON Tue May 29 05:51:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZJ58-0007oR-3x
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 05:51:14 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55336)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>) id 1SZJ51-0007WP-LA
	for coreutils@gnu.org; Tue, 29 May 2012 05:51:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>) id 1SZJ4w-0003yF-Nt
	for coreutils@gnu.org; Tue, 29 May 2012 05:51:07 -0400
Received: from relay1.mentorg.com ([192.94.38.131]:59349)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Thomas_Schwinge@mentor.com>)
	id 1SZJ4k-0003vT-8d; Tue, 29 May 2012 05:50:50 -0400
Received: from nat-ies.mentorg.com ([192.94.31.2]
	helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp 
	id 1SZJ4d-0005BC-Cs from Thomas_Schwinge@mentor.com ;
	Tue, 29 May 2012 02:50:43 -0700
Received: from feldtkeller.schwinge.homeip.net ([172.30.72.159]) by
	EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); 
	Tue, 29 May 2012 10:50:42 +0100
From: Thomas Schwinge <thomas@codesourcery.com>
To: Jim Meyering <jim@meyering.net>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
In-Reply-To: <87zk8wboif.fsf@schwinge.name>
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net> <87zk8wboif.fsf@schwinge.name>
User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Tue, 29 May 2012 11:50:25 +0200
Message-ID: <87396jb9jy.fsf@schwinge.name>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"
X-OriginalArrivalTime: 29 May 2012 09:50:42.0439 (UTC)
	FILETIME=[82DF4170:01CD3D80]
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 192.94.38.131
Cc: hurd-devel@gnu.org, debian-hurd@lists.debian.org,
	Coreutils <coreutils@gnu.org>, ludwig.nussel@suse.de
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 09:51:12 -0000

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi!

On Fri, 25 May 2012 11:26:00 +0200, I wrote:
> On Thu, 24 May 2012 15:21:01 +0200, Jim Meyering <jim@meyering.net> wrote:
> > P=C3=A1draig Brady wrote:
> > > -------- Original Message --------
> > > Subject: [PULL] su
> > > Date: Thu, 24 May 2012 14:58:01 +0200
> > > From: Ludwig Nussel <ludwig.nussel@suse.de>
> > > To: util-linux@vger.kernel.org
> > >
> > > Hi,
> > >
> > > coreutils isn't really interested in maintaining su anymore.
> > > Distributions have to add custom patches to fix bugs and add
> > > features. The worst offender is probably the pam patch. Fortunately
> > > we managed to sync the patch between openSUSE and Fedora meanwhile.
> > > Over time the risk that the patches divert again increases though.
> > > Since util-linux now contains a common login program it looks like a
> > > good new home for su too.
> > >
> > > To integrate su into util-linux I've extracted the history of the su
> > > program until the last GPLv2 version (they've changed to GPLv3
> > > meanwhile) from coreutils' git and merged it with util-linux.
> > > Then I've added the patches used in Fedora and openSUSE and fixed the
> > > files to actually build.
> > >
> > > You can find the result in branch su-v1 (ff6b15d) at
> > > git@github.com:lnussel/util-linux.git
> > >
> > > I've also filed a pull request on github:
> > > https://github.com/karelzak/util-linux/pull/10
> > >
> > > Originally I had planned to implement separate tty allocation for
> > > the child program on top of that to get rid of the evil setsid
> > > patch. It turned out to be more complicated than I thought though. The
> > > change would be too massive to backport anyways I guess. So the next
> > > step would be to rip out the non-pam legacy stuff and clean up the co=
de
> > > to make it readable again.
>=20
> > I would like to remove su.c, if/when possible from coreutils.
> > The last time I proposed that, the Hurd was mentioned as a
> > reason not to, since they relied on the su from coreutils.
> >=20
> > Is that still the case, and if so, can you (the Hurd) switch
> > to the one from util-linux?
>=20
> Yes, that appears to be fine -- despite its name, we're using a lot of
> executables provided by util-linux.
>=20
> I'll test the branch in the lnussel repository and report back.

A minor portability patch was all that was needed,
<http://news.gmane.org/find-root.php?message_id=3D%3C1337971261-20684-1-git=
-send-email-thomas@codesourcery.com%3E>,
and all that has now been merged to util-linux.


How to coordinate this with Debian?  Chances are that an updated
coreutils release with su removed is made before an util-linux release
with su added.


Gr=C3=BC=C3=9Fe,
 Thomas

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJPxJvhAAoJENuKOtuXzphJM7sH/izAKGq0FdCWkEjbEt9JMSe7
1i9m86Y74Mgg7+tng6yY+79dA+Iszm3qkC/hASPwirL/dooE9wlbZhD3Yux/Df8J
g9Cqhm9QGR30T8RdrYj2lPhS1531lhwRtFZqTTPnzYKlbnx5zwOeUO2zfFheZy8g
X8WlqCtuV7dzc9fuzDIqz5Q6WlpkVJort7ua3v1CKJDQhl6uSiLMFvRDChWtJe6P
ruZZEHTwlGqNYWSe06hryfVP5G07P0AHQsGD+SCpBdmgG64KYJ484+r12kjOsVpx
rx+X5JvdXtZmScpgdi1PIEbxoo7KgT3cIVLpb3BRhhLPIy/RKqm2nA1SoPRM5kk=
=Swrw
-----END PGP SIGNATURE-----
--=-=-=--


From MAILER-DAEMON Tue May 29 06:02:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZJGS-0006LU-2O
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 06:02:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49514)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SZJGO-0006Co-Uy
	for coreutils@gnu.org; Tue, 29 May 2012 06:02:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SZJGN-00073H-8S
	for coreutils@gnu.org; Tue, 29 May 2012 06:02:52 -0400
Received: from mx1.redhat.com ([209.132.183.28]:3915)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>)
	id 1SZJG2-00071S-9X; Tue, 29 May 2012 06:02:30 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4TA2OjP023894
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 29 May 2012 06:02:24 -0400
Received: from [10.36.116.78] (ovpn-116-78.ams2.redhat.com [10.36.116.78])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q4TA2KBS029269
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Tue, 29 May 2012 06:02:22 -0400
Message-ID: <4FC49EAC.5030502@draigBrady.com>
Date: Tue, 29 May 2012 11:02:20 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de> <4FBE32D2.5060905@draigBrady.com>
	<87aa0xbtqa.fsf_-_@rho.meyering.net>
	<87zk8wboif.fsf@schwinge.name> <87396jb9jy.fsf@schwinge.name>
In-Reply-To: <87396jb9jy.fsf@schwinge.name>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q4TA2OjP023894
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: hurd-devel@gnu.org, debian-hurd@lists.debian.org, ludwig.nussel@suse.de,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 10:02:54 -0000

On 05/29/2012 10:50 AM, Thomas Schwinge wrote:
> A minor portability patch was all that was needed,
> <http://news.gmane.org/find-root.php?message_id=3D%3C1337971261-20684-1=
-git-send-email-thomas@codesourcery.com%3E>,
> and all that has now been merged to util-linux.
>=20
> How to coordinate this with Debian?  Chances are that an updated
> coreutils release with su removed is made before an util-linux release
> with su added.

coreutils currently needs to be explicitly configured to include `su`.
So exisiting releases should support this transition.

cheers,
P=C3=A1draig.



From MAILER-DAEMON Tue May 29 11:17:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZOAS-0000gs-Pq
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 11:17:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55950)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZOAI-0000fm-4I
	for coreutils@gnu.org; Tue, 29 May 2012 11:17:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZOA8-0007OS-Fn
	for coreutils@gnu.org; Tue, 29 May 2012 11:16:53 -0400
Received: from mx.meyering.net ([88.168.87.75]:60755)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZOA7-0007Lt-NJ
	for coreutils@gnu.org; Tue, 29 May 2012 11:16:44 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id C2BD360156;
	Tue, 29 May 2012 17:16:41 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] su: remove program (util-linux is now the best source for it)
Date: Tue, 29 May 2012 17:16:41 +0200
Message-ID: <87ipffvwyu.fsf@rho.meyering.net>
Lines: 1217
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: bwalton@artsci.utoronto.ca
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:17:04 -0000

After the discussion on
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/5881
no one objected to removing su.c from coreutils,
now that it is clear there is a better (and still portable)
version in the util-linux package.

Going back through the old feedback on http://bugs.gnu.org/7572,
I see that Ben Walton mentioned a preference for the su.c from
coreutils, for OpenCSW.

Ben, can you use the "su" from util-linux, now?

Here's a patch to remove almost all su-related artifacts from coreutils.
I'm in no big hurry to push it, but so far don't see any reason not to.

>From 741a5c76e68ba1f40cd7e7dd5c4669d30a381503 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 25 May 2012 18:10:25 +0200
Subject: [PATCH] su: remove program (util-linux is now the best source for
 it)

* README: Omit "su" from list of programs.
* src/su.c: Remove file.
* src/Makefile.am: Remove su-related rules and variables.
* tests/misc/su-fail: Remove test.
* tests/Makefile.am (TESTS): Remove misc/su-fail.
* tests/misc/invalid-opt: Remove su-related code.
* src/.gitignore: Remove su.
* man/su.x: Remove file.
* man/Makefile.am (su.1): Remove rule.
* po/POTFILES.in: Remove su.c from the list.
* TODO: Remove ancient entry.
* NEWS (Changes in behavior): Mention it.
* doc/coreutils.texi: Remove su-related description.
* AUTHORS: Remove su.
* m4/lib-check.m4 (cu_LIB_CHECK): Remove file/macro.
* configure.ac: Remove su-related code and sole use of cu_LIB_CHECK.
---
 AUTHORS                 |   1 -
 NEWS                    |   8 +
 README                  |   2 +-
 TODO                    |   3 -
 configure.ac            |  13 +-
 doc/coreutils.texi      | 164 +--------------
 m4/lib-check.m4         |  60 ------
 man/.gitignore          |   1 -
 man/Makefile.am         |   3 +-
 man/su.x                |   4 -
 po/POTFILES.in          |   1 -
 src/.gitignore          |   1 -
 src/Makefile.am         |  63 +-----
 src/su.c                | 520 --------------------------------------------=
----
 tests/Makefile.am       |   1 -
 tests/misc/help-version |   1 -
 tests/misc/invalid-opt  |   1 -
 tests/misc/su-fail      |  30 ---
 18 files changed, 16 insertions(+), 861 deletions(-)
 delete mode 100644 m4/lib-check.m4
 delete mode 100644 man/su.x
 delete mode 100644 src/su.c
 delete mode 100755 tests/misc/su-fail

diff --git a/AUTHORS b/AUTHORS
index d1024a5..9984a2e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -80,7 +80,6 @@ split: Torbj=F6rn Granlund, Richard M. Stallman
 stat: Michael Meskes
 stdbuf: P=E1draig Brady
 stty: David MacKenzie
-su: David MacKenzie
 sum: Kayvan Aghaiepour, David MacKenzie
 sync: Jim Meyering
 tac: Jay Lepreau, David MacKenzie
diff --git a/NEWS b/NEWS
index daea549..efcb1c8 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,14 @@ GNU coreutils NEWS                                    -*=
- outline -*-
   in all situations on GNU/Linux, by correctly determining the block size.
   [df bug since coreutils-5.0.91, stat bug since the initial implementatio=
n]

+** Changes in behavior
+
+  su: this program has been removed.  We stopped installing "su" by
+  default with the release of coreutils-6.9.90 on 2007-12-01.  Now,
+  that the util-linux package has the union of the Suse and Fedora
+  patches as well as enough support to build on the Hurd, we no longer
+  have any reason to include it here.
+

 * Noteworthy changes in release 8.17 (2012-05-10) [stable]

diff --git a/README b/README
index 3cc476a..09961a0 100644
--- a/README
+++ b/README
@@ -13,7 +13,7 @@ The programs that can be built with this package are:
   link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
   nproc od paste pathchk pinky pr printenv printf ptx pwd readlink realpath
   rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
-  shuf sleep sort split stat stdbuf stty su sum sync tac tail tee test
+  shuf sleep sort split stat stdbuf stty sum sync tac tail tee test
   timeout touch tr true truncate tsort tty uname unexpand uniq unlink
   uptime users vdir wc who whoami yes

diff --git a/TODO b/TODO
index 8a8cf43..cd434e5 100644
--- a/TODO
+++ b/TODO
@@ -78,9 +78,6 @@ unexpand: [http://www.opengroup.org/onlinepubs/007908799/=
xcu/unexpand.html]
   printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodified.
   printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n"

-Let GNU su use the 'wheel' group if appropriate.
-  (there are a couple patches, already)
-
 sort: Investigate better sorting algorithms; see Knuth vol. 3.

   We tried list merge sort, but it was about 50% slower than the
diff --git a/configure.ac b/configure.ac
index 5a4860e..5651fd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,7 +380,6 @@ AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, _=
_sys_siglist], , ,
   [AC_INCLUDES_DEFAULT
 #include <signal.h>])

-cu_LIB_CHECK
 cu_GMP

 # Build df only if there's a point to it.
@@ -421,7 +420,7 @@ t=3D`sed -n '/^'$v' =3D/,/[[^\]]$/p' $mk \
 no_install_progs_default=3D`echo "$t"|sed 's/ $//'`

 # Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list
-# of default-not-installed programs, "arch hostname su", must appear in two
+# of default-not-installed programs, "arch hostname", must appear in two
 # places: in this file below, and in $mk.  Using "$no_install_progs_defaul=
t"
 # below cannot work.  And we can't substitute the names into $mk because
 # automake needs the literals, too.
@@ -448,7 +447,7 @@ esac
 # Note how the second argument below is a literal, with "," separators.
 # That is required due to the way the macro works, and since the
 # corresponding ./configure option argument is comma-separated on input.
-gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su])
+gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname])

 # Now that we know which programs will actually be built up, figure out
 # which optional helper progs should be compiled.
@@ -457,14 +456,6 @@ case " $optional_bin_progs " in
   *' stdbuf '*) gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so]) ;;
 esac

-# Set INSTALL_SU if su installation has been requested via
-# --enable-install-program=3Dsu.
-AC_SUBST([INSTALL_SU])
-case " $optional_bin_progs " in
-  *' su '*) INSTALL_SU=3Dyes ;;
-  *)        INSTALL_SU=3Dno ;;
-esac
-
 MAN=3D`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\01=
2'`

 # Change "ginstall.1" to "install.1" in $MAN.
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 767267b..f7251b2 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -109,7 +109,6 @@
 * stat: (coreutils)stat invocation.             Report file(system) status.
 * stdbuf: (coreutils)stdbuf invocation.         Modify stdio buffering.
 * stty: (coreutils)stty invocation.             Print/change terminal sett=
ings.
-* su: (coreutils)su invocation.                 Modify user and group ID.
 * sum: (coreutils)sum invocation.               Print traditional checksum.
 * sync: (coreutils)sync invocation.             Synchronize memory and dis=
k.
 * tac: (coreutils)tac invocation.               Reverse files.
@@ -200,7 +199,7 @@ Top
 * User information::             id logname whoami groups users who
 * System context::               date arch nproc uname hostname hostid upt=
ime
 * SELinux context::              chcon runcon
-* Modified command invocation::  chroot env nice nohup stdbuf su timeout
+* Modified command invocation::  chroot env nice nohup stdbuf timeout
 * Process control::              kill
 * Delaying::                     sleep
 * Numeric operations::           factor seq
@@ -443,7 +442,6 @@ Top
 * nice invocation::              Run a command with modified niceness
 * nohup invocation::             Run a command immune to hangups
 * stdbuf invocation::            Run a command with modified I/O buffering
-* su invocation::                Run a command with substitute user and gr=
oup ID
 * timeout invocation::           Run a command with a time limit

 Process control
@@ -766,7 +764,7 @@ Exit status
 Here are some of the exceptions:
 @command{chroot}, @command{env}, @command{expr}, @command{nice},
 @command{nohup}, @command{printenv}, @command{sort}, @command{stdbuf},
-@command{su}, @command{test}, @command{timeout}, @command{tty}.
+@command{test}, @command{timeout}, @command{tty}.


 @node Backup options
@@ -15266,7 +15264,6 @@ Modified command invocation
 * nice invocation::             Modify niceness.
 * nohup invocation::            Immunize to hangups.
 * stdbuf invocation::           Modify buffering of standard streams.
-* su invocation::               Modify user and group ID.
 * timeout invocation::          Run with time limit.
 @end menu

@@ -15794,163 +15791,6 @@ stdbuf invocation
 @end display


-@node su invocation
-@section @command{su}: Run a command with substitute user and group ID
-
-@pindex su
-@cindex substitute user and group IDs
-@cindex user ID, switching
-@cindex super-user, becoming
-@cindex root, becoming
-
-@command{su} allows one user to temporarily become another user.  It runs a
-command (often an interactive shell) with the real and effective user
-ID, group ID, and supplemental groups of a given @var{user}.  Synopsis:
-
-@example
-su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
-@end example
-
-@cindex passwd entry, and @command{su} shell
-@flindex /bin/sh
-@flindex /etc/passwd
-If no @var{user} is given, the default is @code{root}, the super-user.
-The shell to use is taken from @var{user}'s @code{passwd} entry, or
-@file{/bin/sh} if none is specified there.  If @var{user} has a
-password, @command{su} prompts for the password unless run by a user with
-effective user ID of zero (the super-user).
-
-@vindex HOME
-@vindex SHELL
-@vindex USER
-@vindex LOGNAME
-@cindex login shell
-By default, @command{su} does not change the current directory.
-It sets the environment variables @env{HOME} and @env{SHELL}
-from the password entry for @var{user}, and if @var{user} is not
-the super-user, sets @env{USER} and @env{LOGNAME} to @var{user}.
-By default, the shell is not a login shell.
-
-Any additional @var{arg}s are passed as additional arguments to the
-shell.
-
-@cindex @option{-su}
-GNU @command{su} does not treat @file{/bin/sh} or any other shells special=
ly
-(e.g., by setting @code{argv[0]} to @option{-su}, passing @option{-c} only
-to certain shells, etc.).
-
-@findex syslog
-@command{su} can optionally be compiled to use @code{syslog} to report
-failed, and optionally successful, @command{su} attempts.  (If the system
-supports @code{syslog}.)  However, GNU @command{su} does not check if the
-user is a member of the @code{wheel} group; see below.
-
-The program accepts the following options.  Also see @ref{Common options}.
-
-@table @samp
-@item -c @var{command}
-@itemx --command=3D@var{command}
-@opindex -c
-@opindex --command
-Pass @var{command}, a single command line to run, to the shell with
-a @option{-c} option instead of starting an interactive shell.
-
-@item -f
-@itemx --fast
-@opindex -f
-@opindex --fast
-@flindex .cshrc
-@cindex file name pattern expansion, disabled
-@cindex globbing, disabled
-Pass the @option{-f} option to the shell.  This probably only makes sense
-if the shell run is @command{csh} or @command{tcsh}, for which the @option=
{-f}
-option prevents reading the startup file (@file{.cshrc}).  With
-Bourne-like shells, the @option{-f} option disables file name pattern
-expansion (globbing), which is not likely to be useful.
-
-@item -
-@itemx -l
-@itemx --login
-@opindex -
-@opindex -l
-@opindex --login
-@c other variables already indexed above
-@vindex TERM
-@vindex PATH
-@cindex login shell, creating
-Make the shell a login shell.  This means the following.  Unset all
-environment variables except @env{TERM}, @env{HOME}, and @env{SHELL}
-(which are set as described above), and @env{USER} and @env{LOGNAME}
-(which are set, even for the super-user, as described above), and set
-@env{PATH} to a compiled-in default value.  Change to @var{user}'s home
-directory.  Prepend @samp{-} to the shell's name, intended to make it
-read its login startup file(s).
-
-@item -m
-@itemx -p
-@itemx --preserve-environment
-@opindex -m
-@opindex -p
-@opindex --preserve-environment
-@cindex environment, preserving
-@flindex /etc/shells
-@cindex restricted shell
-Do not change the environment variables @env{HOME}, @env{USER},
-@env{LOGNAME}, or @env{SHELL}.  Run the shell given in the environment
-variable @env{SHELL} instead of the shell from @var{user}'s passwd
-entry, unless the user running @command{su} is not the super-user and
-@var{user}'s shell is restricted.  A @dfn{restricted shell} is one that
-is not listed in the file @file{/etc/shells}, or in a compiled-in list
-if that file does not exist.  Parts of what this option does can be
-overridden by @option{--login} and @option{--shell}.
-
-@item -s @var{shell}
-@itemx --shell=3D@var{shell}
-@opindex -s
-@opindex --shell
-Run @var{shell} instead of the shell from @var{user}'s passwd entry,
-unless the user running @command{su} is not the super-user and @var{user}'s
-shell is restricted (see @option{-m} just above).
-
-@end table
-
-@cindex exit status of @command{su}
-Exit status:
-
-@display
-125 if @command{su} itself fails
-126 if subshell is found but cannot be invoked
-127 if subshell cannot be found
-the exit status of the subshell otherwise
-@end display
-
-@cindex wheel group, not supported
-@cindex group wheel, not supported
-@cindex fascism
-@subsection Why GNU @command{su} does not support the @samp{wheel} group
-
-(This section is by Richard Stallman.)
-
-@cindex Twenex
-@cindex MIT AI lab
-Sometimes a few of the users try to hold total power over all the
-rest.  For example, in 1984, a few users at the MIT AI lab decided to
-seize power by changing the operator password on the Twenex system and
-keeping it secret from everyone else.  (I was able to thwart this coup
-and give power back to the users by patching the kernel, but I
-wouldn't know how to do that in Unix.)
-
-However, occasionally the rulers do tell someone.  Under the usual
-@command{su} mechanism, once someone learns the root password who
-sympathizes with the ordinary users, he or she can tell the rest.  The
-``wheel group'' feature would make this impossible, and thus cement the
-power of the rulers.
-
-I'm on the side of the masses, not that of the rulers.  If you are
-used to supporting the bosses and sysadmins in whatever they do, you
-might find this idea strange at first.
-
-
 @node timeout invocation
 @section @command{timeout}: Run a command with a time limit

diff --git a/m4/lib-check.m4 b/m4/lib-check.m4
deleted file mode 100644
index a33c623..0000000
--- a/m4/lib-check.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-#serial 11
-
-dnl Misc lib-related macros for coreutils.
-
-# Copyright (C) 1993-2012 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 Jim Meyering.
-
-AC_DEFUN([cu_LIB_CHECK],
-[
-
-  # Check for libypsec.a on Dolphin M88K machines.
-  AC_CHECK_LIB([ypsec], [main])
-
-  # m88k running dgux 5.4 needs this
-  AC_CHECK_LIB([ldgc], [main])
-
-  # The -lsun library is required for YP support on Irix-4.0.5 systems.
-  # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
-  AC_SEARCH_LIBS([yp_match], [sun ypsec])
-
-  # SysV needs -lsec, older versions of Linux need -lshadow for
-  # shadow passwords.  UnixWare 7 needs -lgen.
-  AC_SEARCH_LIBS([getspnam], [shadow sec gen])
-
-  AC_CHECK_HEADERS([shadow.h])
-
-  # Requirements for su.c.
-  shadow_includes=3D"\
-$ac_includes_default
-#if HAVE_SHADOW_H
-# include <shadow.h>
-#endif
-"
-  AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
-  AC_CHECK_FUNCS([getspnam])
-
-  # SCO-ODT-3.0 is reported to need -lufc for crypt.
-  # NetBSD needs -lcrypt for crypt.
-  LIB_CRYPT=3D
-  cu_saved_libs=3D"$LIBS"
-  AC_SEARCH_LIBS([crypt], [ufc crypt],
-                 [test "$ac_cv_search_crypt" =3D "none required" ||
-                  LIB_CRYPT=3D"$ac_cv_search_crypt"])
-  LIBS=3D"$cu_saved_libs"
-  AC_SUBST([LIB_CRYPT])
-])
diff --git a/man/.gitignore b/man/.gitignore
index 9ae1183..aa6fa51 100644
--- a/man/.gitignore
+++ b/man/.gitignore
@@ -76,7 +76,6 @@ split.1
 stat.1
 stdbuf.1
 stty.1
-su.1
 sum.1
 sync.1
 tac.1
diff --git a/man/Makefile.am b/man/Makefile.am
index d869f9b..cc93a42 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -110,7 +110,6 @@ split.1:	$(common_dep)	$(srcdir)/split.x	../src/split.c
 stat.1:		$(common_dep)	$(srcdir)/stat.x	../src/stat.c
 stdbuf.1:	$(common_dep)	$(srcdir)/stdbuf.x	../src/stdbuf.c
 stty.1:		$(common_dep)	$(srcdir)/stty.x	../src/stty.c
-su.1:		$(common_dep)	$(srcdir)/su.x		../src/su.c
 sum.1:		$(common_dep)	$(srcdir)/sum.x		../src/sum.c
 sync.1:		$(common_dep)	$(srcdir)/sync.x	../src/sync.c
 tac.1:		$(common_dep)	$(srcdir)/tac.x		../src/tac.c
@@ -192,7 +191,7 @@ ASSORT =3D LC_ALL=3DC sort

 # Ensure that for each .x file in this directory, there is a
 # corresponding .1 file in the definition of $(dist_man1_MANS) above.
-# But since that expansion usually lacks programs like su and arch,
+# But since that expansion usually lacks programs like arch and hostname,
 # add them here manually.
 .PHONY: check-x-vs-1
 check-x-vs-1:
diff --git a/man/su.x b/man/su.x
deleted file mode 100644
index b368dd6..0000000
--- a/man/su.x
+++ /dev/null
@@ -1,4 +0,0 @@
-[NAME]
-su \- run a shell with substitute user and group IDs
-[DESCRIPTION]
-.\" Add any additional description here
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7b3de0b..b938dfc 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -118,7 +118,6 @@ src/split.c
 src/stat.c
 src/stdbuf.c
 src/stty.c
-src/su.c
 src/sum.c
 src/sync.c
 src/system.h
diff --git a/src/.gitignore b/src/.gitignore
index 9c4c9b7..d78178c 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -87,7 +87,6 @@ split
 stat
 stdbuf
 stty
-su
 sum
 sync
 tac
diff --git a/src/Makefile.am b/src/Makefile.am
index 06ab615..3099505 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,7 @@
 # Hence, if you want to install programs from this list anyway, say A and =
B,
 # use --enable-install-program=3DA,B
 no_install__progs =3D \
-  arch hostname su
+  arch hostname

 build_if_possible__progs =3D \
   chroot	\
@@ -32,7 +32,6 @@ build_if_possible__progs =3D \
   pinky		\
   stdbuf	\
   stty		\
-  su		\
   uptime	\
   users		\
   who
@@ -164,7 +163,7 @@ noinst_HEADERS =3D	\
 EXTRA_DIST =3D dcgen dircolors.hin tac-pipe.c \
   wheel-gen.pl extract-magic c99-to-c89.diff
 BUILT_SOURCES =3D
-CLEANFILES =3D $(SCRIPTS) su
+CLEANFILES =3D $(SCRIPTS)

 # Also remove these sometimes-built programs.
 # For example, even when excluded, they're built via _sc_check-AUTHORS.
@@ -268,7 +267,6 @@ split_LDADD =3D $(LDADD)
 stat_LDADD =3D $(LDADD)
 stdbuf_LDADD =3D $(LDADD)
 stty_LDADD =3D $(LDADD)
-su_LDADD =3D $(LDADD)
 sum_LDADD =3D $(LDADD)
 sync_LDADD =3D $(LDADD)
 tac_LDADD =3D $(LDADD)
@@ -357,9 +355,6 @@ factor_LDADD +=3D $(LIB_GMP)
 # for getloadavg
 uptime_LDADD +=3D $(GETLOADAVG_LIBS)

-# for crypt
-su_LDADD +=3D $(LIB_CRYPT)
-
 # for various ACL functions
 copy_LDADD +=3D $(LIB_ACL)
 ls_LDADD +=3D $(LIB_ACL)
@@ -402,60 +397,6 @@ RELEASE_YEAR =3D \
   `sed -n '/.*COPYRIGHT_YEAR =3D \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
     $(top_srcdir)/lib/version-etc.c`

-all-local: su$(EXEEXT)
-
-installed_su =3D $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
-
-setuid_root_mode =3D a=3Drx,u+s
-
-install_su =3D						\
-  if test "$(INSTALL_SU)" =3D yes; then			\
-    p=3Dsu;						\
-    echo " $(INSTALL_PROGRAM) $$p $(installed_su)";	\
-    $(INSTALL_PROGRAM) $$p $(installed_su);		\
-    echo " chown root $(installed_su)";			\
-    chown root $(installed_su);				\
-    echo " chmod $(setuid_root_mode) $(installed_su)";	\
-    chmod $(setuid_root_mode) $(installed_su);		\
-  else							\
-    :;							\
-  fi
-
-install-root: su$(EXEEXT)
-	@$(install_su)
-
-install-exec-hook: su$(EXEEXT)
-	@if test "$(INSTALL_SU)" =3D yes; then			\
-	  TMPFILE=3D$(DESTDIR)$(bindir)/.su-$$$$;			\
-	  rm -f $$TMPFILE;					\
-	  echo > $$TMPFILE;					\
-## See if we can create a setuid root executable in $(bindir).
-## If not, then don't even try to install su.
-	  can_create_suid_root_executable=3Dno;			\
-	  chown root $$TMPFILE > /dev/null 2>&1			\
-	    && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
-	    && can_create_suid_root_executable=3Dyes;		\
-	  rm -f $$TMPFILE;					\
-	  if test $$can_create_suid_root_executable =3D yes; then \
-	    $(install_su);					\
-	  else							\
-	    echo "WARNING: insufficient access; not installing su"; \
-	    echo "NOTE: to install su, run 'make install-root' as root"; \
-	    rm -f $(installed_su);				\
-	  fi;							\
-	else :;							\
-	fi
-
-uninstall-local:
-# Remove su only if it's one we installed.
-	@if test "$(INSTALL_SU)" =3D yes; then			\
-	  if grep '$(PACKAGE_NAME)' $(installed_su) > /dev/null 2>&1; then \
-	    echo "  rm -f $(installed_su)"; \
-	    rm -f $(installed_su); \
-	  else :; \
-	  fi; \
-	fi
-
 copy_sources =3D copy.c cp-hash.c extent-scan.c extent-scan.h

 # Use 'ginstall' in the definition of PROGRAMS and in dependencies to avoid
diff --git a/src/su.c b/src/su.c
deleted file mode 100644
index bb54cc3..0000000
--- a/src/su.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/* su for GNU.  Run a shell with substitute user and group IDs.
-   Copyright (C) 1992-2012 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/>.  =
*/
-
-/* Run a shell with the real and effective UID and GID and groups
-   of USER, default 'root'.
-
-   The shell run is taken from USER's password entry, /bin/sh if
-   none is specified there.  If the account has a password, su
-   prompts for a password unless run by a user with real UID 0.
-
-   Does not change the current directory.
-   Sets 'HOME' and 'SHELL' from the password entry for USER, and if
-   USER is not root, sets 'USER' and 'LOGNAME' to USER.
-   The subshell is not a login shell.
-
-   If one or more ARGs are given, they are passed as additional
-   arguments to the subshell.
-
-   Does not handle /bin/sh or other shells specially
-   (setting argv[0] to "-su", passing -c only to certain shells, etc.).
-   I don't see the point in doing that, and it's ugly.
-
-   This program intentionally does not support a "wheel group" that
-   restricts who can su to UID 0 accounts.  RMS considers that to
-   be fascist.
-
-   Compile-time options:
-   -DSYSLOG_SUCCESS	Log successful su's (by default, to root) with syslog.
-   -DSYSLOG_FAILURE	Log failed su's (by default, to root) with syslog.
-
-   -DSYSLOG_NON_ROOT	Log all su's, not just those to root (UID 0).
-   Never logs attempted su's to nonexistent accounts.
-
-   Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
-
-#include <config.h>
-#include <stdio.h>
-#include <getopt.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
-
-#include "system.h"
-#include "getpass.h"
-
-#if HAVE_SYSLOG_H && HAVE_SYSLOG
-# include <syslog.h>
-#else
-# undef SYSLOG_SUCCESS
-# undef SYSLOG_FAILURE
-# undef SYSLOG_NON_ROOT
-#endif
-
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-
-#ifndef HAVE_ENDGRENT
-# define endgrent() ((void) 0)
-#endif
-
-#ifndef HAVE_ENDPWENT
-# define endpwent() ((void) 0)
-#endif
-
-#if HAVE_SHADOW_H
-# include <shadow.h>
-#endif
-
-#include "error.h"
-
-/* The official name of this program (e.g., no 'g' prefix).  */
-#define PROGRAM_NAME "su"
-
-#define AUTHORS proper_name ("David MacKenzie")
-
-#if HAVE_PATHS_H
-# include <paths.h>
-#endif
-
-/* The default PATH for simulated logins to non-superuser accounts.  */
-#ifdef _PATH_DEFPATH
-# define DEFAULT_LOGIN_PATH _PATH_DEFPATH
-#else
-# define DEFAULT_LOGIN_PATH ":/usr/ucb:/bin:/usr/bin"
-#endif
-
-/* The default PATH for simulated logins to superuser accounts.  */
-#ifdef _PATH_DEFPATH_ROOT
-# define DEFAULT_ROOT_LOGIN_PATH _PATH_DEFPATH_ROOT
-#else
-# define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc"
-#endif
-
-/* The shell to run if none is given in the user's passwd entry.  */
-#define DEFAULT_SHELL "/bin/sh"
-
-/* The user to become if none is specified.  */
-#define DEFAULT_USER "root"
-
-char *crypt (char const *key, char const *salt);
-
-static void run_shell (char const *, char const *, char **, size_t)
-     ATTRIBUTE_NORETURN;
-
-/* If true, pass the '-f' option to the subshell.  */
-static bool fast_startup;
-
-/* If true, simulate a login instead of just starting a shell.  */
-static bool simulate_login;
-
-/* If true, change some environment vars to indicate the user su'd to.  */
-static bool change_environment;
-
-static struct option const longopts[] =3D
-{
-  {"command", required_argument, NULL, 'c'},
-  {"fast", no_argument, NULL, 'f'},
-  {"login", no_argument, NULL, 'l'},
-  {"preserve-environment", no_argument, NULL, 'p'},
-  {"shell", required_argument, NULL, 's'},
-  {GETOPT_HELP_OPTION_DECL},
-  {GETOPT_VERSION_OPTION_DECL},
-  {NULL, 0, NULL, 0}
-};
-
-/* Add NAME=3DVAL to the environment, checking for out of memory errors.  =
*/
-
-static void
-xsetenv (char const *name, char const *val)
-{
-  size_t namelen =3D strlen (name);
-  size_t vallen =3D strlen (val);
-  char *string =3D xmalloc (namelen + 1 + vallen + 1);
-  strcpy (string, name);
-  string[namelen] =3D '=3D';
-  strcpy (string + namelen + 1, val);
-  if (putenv (string) !=3D 0)
-    xalloc_die ();
-}
-
-#if defined SYSLOG_SUCCESS || defined SYSLOG_FAILURE
-/* Log the fact that someone has run su to the user given by PW;
-   if SUCCESSFUL is true, they gave the correct password, etc.  */
-
-static void
-log_su (struct passwd const *pw, bool successful)
-{
-  const char *new_user, *old_user, *tty;
-
-# ifndef SYSLOG_NON_ROOT
-  if (pw->pw_uid)
-    return;
-# endif
-  new_user =3D pw->pw_name;
-  /* The utmp entry (via getlogin) is probably the best way to identify
-     the user, especially if someone su's from a su-shell.  */
-  old_user =3D getlogin ();
-  if (!old_user)
-    {
-      /* getlogin can fail -- usually due to lack of utmp entry.
-         Resort to getpwuid.  */
-      errno =3D 0;
-      uid_t ruid =3D getuid ();
-      uid_t NO_UID =3D -1;
-      struct passwd *pwd =3D (ruid =3D=3D NO_UID && errno ? NULL : getpwui=
d (ruid));
-      old_user =3D (pwd ? pwd->pw_name : "");
-    }
-  tty =3D ttyname (STDERR_FILENO);
-  if (!tty)
-    tty =3D "none";
-  /* 4.2BSD openlog doesn't have the third parameter.  */
-  openlog (last_component (program_name), 0
-# ifdef LOG_AUTH
-           , LOG_AUTH
-# endif
-           );
-  syslog (LOG_NOTICE,
-# ifdef SYSLOG_NON_ROOT
-          "%s(to %s) %s on %s",
-# else
-          "%s%s on %s",
-# endif
-          successful ? "" : "FAILED SU ",
-# ifdef SYSLOG_NON_ROOT
-          new_user,
-# endif
-          old_user, tty);
-  closelog ();
-}
-#endif
-
-/* Ask the user for a password.
-   Return true if the user gives the correct password for entry PW,
-   false if not.  Return true without asking for a password if run by UID 0
-   or if PW has an empty password.  */
-
-static bool
-correct_password (const struct passwd *pw)
-{
-  char *unencrypted, *encrypted, *correct;
-#if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
-  /* Shadow passwd stuff for SVR3 and maybe other systems.  */
-  struct spwd *sp =3D getspnam (pw->pw_name);
-
-  endspent ();
-  if (sp)
-    correct =3D sp->sp_pwdp;
-  else
-#endif
-    correct =3D pw->pw_passwd;
-
-  if (getuid () =3D=3D 0 || !correct || correct[0] =3D=3D '\0')
-    return true;
-
-  unencrypted =3D getpass (_("Password:"));
-  if (!unencrypted)
-    {
-      error (0, 0, _("getpass: cannot open /dev/tty"));
-      return false;
-    }
-  encrypted =3D crypt (unencrypted, correct);
-  memset (unencrypted, 0, strlen (unencrypted));
-  return STREQ (encrypted, correct);
-}
-
-/* Update 'environ' for the new shell based on PW, with SHELL being
-   the value for the SHELL environment variable.  */
-
-static void
-modify_environment (const struct passwd *pw, const char *shell)
-{
-  if (simulate_login)
-    {
-      /* Leave TERM unchanged.  Set HOME, SHELL, USER, LOGNAME, PATH.
-         Unset all other environment variables.  */
-      char const *term =3D getenv ("TERM");
-      if (term)
-        term =3D xstrdup (term);
-      environ =3D xmalloc ((6 + !!term) * sizeof (char *));
-      environ[0] =3D NULL;
-      if (term)
-        xsetenv ("TERM", term);
-      xsetenv ("HOME", pw->pw_dir);
-      xsetenv ("SHELL", shell);
-      xsetenv ("USER", pw->pw_name);
-      xsetenv ("LOGNAME", pw->pw_name);
-      xsetenv ("PATH", (pw->pw_uid
-                        ? DEFAULT_LOGIN_PATH
-                        : DEFAULT_ROOT_LOGIN_PATH));
-    }
-  else
-    {
-      /* Set HOME, SHELL, and if not becoming a super-user,
-         USER and LOGNAME.  */
-      if (change_environment)
-        {
-          xsetenv ("HOME", pw->pw_dir);
-          xsetenv ("SHELL", shell);
-          if (pw->pw_uid)
-            {
-              xsetenv ("USER", pw->pw_name);
-              xsetenv ("LOGNAME", pw->pw_name);
-            }
-        }
-    }
-}
-
-/* Become the user and group(s) specified by PW.  */
-
-static void
-change_identity (const struct passwd *pw)
-{
-#ifdef HAVE_INITGROUPS
-  errno =3D 0;
-  if (initgroups (pw->pw_name, pw->pw_gid) =3D=3D -1)
-    error (EXIT_CANCELED, errno, _("cannot set groups"));
-  endgrent ();
-#endif
-  if (setgid (pw->pw_gid))
-    error (EXIT_CANCELED, errno, _("cannot set group id"));
-  if (setuid (pw->pw_uid))
-    error (EXIT_CANCELED, errno, _("cannot set user id"));
-}
-
-/* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
-   If COMMAND is nonzero, pass it to the shell with the -c option.
-   Pass ADDITIONAL_ARGS to the shell as more arguments; there
-   are N_ADDITIONAL_ARGS extra arguments.  */
-
-static void
-run_shell (char const *shell, char const *command, char **additional_args,
-           size_t n_additional_args)
-{
-  size_t n_args =3D 1 + fast_startup + 2 * !!command + n_additional_args +=
 1;
-  char const **args =3D xnmalloc (n_args, sizeof *args);
-  size_t argno =3D 1;
-
-  if (simulate_login)
-    {
-      char *arg0;
-      char *shell_basename;
-
-      shell_basename =3D last_component (shell);
-      arg0 =3D xmalloc (strlen (shell_basename) + 2);
-      arg0[0] =3D '-';
-      strcpy (arg0 + 1, shell_basename);
-      args[0] =3D arg0;
-    }
-  else
-    args[0] =3D last_component (shell);
-  if (fast_startup)
-    args[argno++] =3D "-f";
-  if (command)
-    {
-      args[argno++] =3D "-c";
-      args[argno++] =3D command;
-    }
-  memcpy (args + argno, additional_args, n_additional_args * sizeof *args);
-  args[argno + n_additional_args] =3D NULL;
-  execv (shell, (char **) args);
-
-  {
-    int exit_status =3D (errno =3D=3D ENOENT ? EXIT_ENOENT : EXIT_CANNOT_I=
NVOKE);
-    error (0, errno, "%s", shell);
-    exit (exit_status);
-  }
-}
-
-/* Return true if SHELL is a restricted shell (one not returned by
-   getusershell), else false, meaning it is a standard shell.  */
-
-static bool
-restricted_shell (const char *shell)
-{
-  char *line;
-
-  setusershell ();
-  while ((line =3D getusershell ()) !=3D NULL)
-    {
-      if (*line !=3D '#' && STREQ (line, shell))
-        {
-          endusershell ();
-          return false;
-        }
-    }
-  endusershell ();
-  return true;
-}
-
-void
-usage (int status)
-{
-  if (status !=3D EXIT_SUCCESS)
-    emit_try_help ();
-  else
-    {
-      printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_na=
me);
-      fputs (_("\
-Change the effective user id and group id to that of USER.\n\
-\n\
-  -, -l, --login               make the shell a login shell\n\
-  -c, --command=3DCOMMAND        pass a single COMMAND to the shell with -=
c\n\
-  -f, --fast                   pass -f to the shell (for csh or tcsh)\n\
-  -m, --preserve-environment   do not reset environment variables\n\
-  -p                           same as -m\n\
-  -s, --shell=3DSHELL            run SHELL if /etc/shells allows it\n\
-"), stdout);
-      fputs (HELP_OPTION_DESCRIPTION, stdout);
-      fputs (VERSION_OPTION_DESCRIPTION, stdout);
-      fputs (_("\
-\n\
-A mere - implies -l.   If USER not given, assume root.\n\
-"), stdout);
-      emit_ancillary_info ();
-    }
-  exit (status);
-}
-
-int
-main (int argc, char **argv)
-{
-  int optc;
-  const char *new_user =3D DEFAULT_USER;
-  char *command =3D NULL;
-  char *shell =3D NULL;
-  struct passwd *pw;
-  struct passwd pw_copy;
-
-  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);
-
-  fast_startup =3D false;
-  simulate_login =3D false;
-  change_environment =3D true;
-
-  while ((optc =3D getopt_long (argc, argv, "c:flmps:", longopts, NULL)) !=
=3D -1)
-    {
-      switch (optc)
-        {
-        case 'c':
-          command =3D optarg;
-          break;
-
-        case 'f':
-          fast_startup =3D true;
-          break;
-
-        case 'l':
-          simulate_login =3D true;
-          break;
-
-        case 'm':
-        case 'p':
-          change_environment =3D false;
-          break;
-
-        case 's':
-          shell =3D optarg;
-          break;
-
-        case_GETOPT_HELP_CHAR;
-
-        case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
-
-        default:
-          usage (EXIT_CANCELED);
-        }
-    }
-
-  if (optind < argc && STREQ (argv[optind], "-"))
-    {
-      simulate_login =3D true;
-      ++optind;
-    }
-  if (optind < argc)
-    new_user =3D argv[optind++];
-
-  pw =3D getpwnam (new_user);
-  if (! (pw && pw->pw_name && pw->pw_name[0] && pw->pw_dir && pw->pw_dir[0]
-         && pw->pw_passwd))
-    error (EXIT_CANCELED, 0, _("user %s does not exist"), new_user);
-
-  /* Make a copy of the password information and point pw at the local
-     copy instead.  Otherwise, some systems (e.g. GNU/Linux) would clobber
-     the static data through the getlogin call from log_su.
-     Also, make sure pw->pw_shell is a nonempty string.
-     It may be NULL when NEW_USER is a username that is retrieved via NIS =
(YP),
-     but that doesn't have a default shell listed.  */
-  pw_copy =3D *pw;
-  pw =3D &pw_copy;
-  pw->pw_name =3D xstrdup (pw->pw_name);
-  pw->pw_passwd =3D xstrdup (pw->pw_passwd);
-  pw->pw_dir =3D xstrdup (pw->pw_dir);
-  pw->pw_shell =3D xstrdup (pw->pw_shell && pw->pw_shell[0]
-                          ? pw->pw_shell
-                          : DEFAULT_SHELL);
-  endpwent ();
-
-  if (!correct_password (pw))
-    {
-#ifdef SYSLOG_FAILURE
-      log_su (pw, false);
-#endif
-      error (EXIT_CANCELED, 0, _("incorrect password"));
-    }
-#ifdef SYSLOG_SUCCESS
-  else
-    {
-      log_su (pw, true);
-    }
-#endif
-
-  if (!shell && !change_environment)
-    shell =3D getenv ("SHELL");
-  if (shell && getuid () !=3D 0 && restricted_shell (pw->pw_shell))
-    {
-      /* The user being su'd to has a nonstandard shell, and so is
-         probably a uucp account or has restricted access.  Don't
-         compromise the account by allowing access with a standard
-         shell.  */
-      error (0, 0, _("using restricted shell %s"), pw->pw_shell);
-      shell =3D NULL;
-    }
-  shell =3D xstrdup (shell ? shell : pw->pw_shell);
-  modify_environment (pw, shell);
-
-  change_identity (pw);
-  if (simulate_login && chdir (pw->pw_dir) !=3D 0)
-    error (0, errno, _("warning: cannot change directory to %s"), pw->pw_d=
ir);
-
-  /* error() flushes stderr, but does not check for write failure.
-     Normally, we would catch this via our atexit() hook of
-     close_stdout, but execv() gets in the way.  If stderr
-     encountered a write failure, there is no need to try calling
-     error() again.  */
-  if (ferror (stderr))
-    exit (EXIT_CANCELED);
-
-  run_shell (shell, command, argv + optind, MAX (0, argc - optind));
-}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0bafc5f..d8bc930 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -280,7 +280,6 @@ TESTS =3D						\
   misc/stty-invalid				\
   misc/stty-pairs				\
   misc/stty-row-col				\
-  misc/su-fail					\
   misc/sum					\
   misc/sum-sysv					\
   misc/tac					\
diff --git a/tests/misc/help-version b/tests/misc/help-version
index 7416062..e19f5b1 100755
--- a/tests/misc/help-version
+++ b/tests/misc/help-version
@@ -208,7 +208,6 @@ nohup_setup () { args=3D--version; }
 printf_setup () { args=3Dfoo; }
 seq_setup () { args=3D10; }
 sleep_setup () { args=3D0; }
-su_setup () { args=3D--version; }
 stdbuf_setup () { args=3D"-oL true"; }
 timeout_setup () { args=3D--version; }

diff --git a/tests/misc/invalid-opt b/tests/misc/invalid-opt
index 8eae3c2..8f7024c 100755
--- a/tests/misc/invalid-opt
+++ b/tests/misc/invalid-opt
@@ -36,7 +36,6 @@ my %exit_status =3D
     nohup =3D> 125,
     sort =3D> 2,
     stdbuf =3D> 125,
-    su =3D> 125,
     test =3D> 0,
     timeout =3D> 125,
     true =3D> 0,
diff --git a/tests/misc/su-fail b/tests/misc/su-fail
deleted file mode 100755
index c2e0475..0000000
--- a/tests/misc/su-fail
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-# Test su failure cases
-
-# Copyright (C) 2009-2012 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.}/init.sh"; path_prepend_ ../src
-print_ver_ su
-
-require_built_ su
-
-# Very little that we can test without a root password
-su --- / true # unknown option
-test $? =3D 125 || fail=3D1
-su no_such_user
-test $? =3D 125 || fail=3D1
-
-Exit $fail
--
1.7.10.2.605.gbefc5ed


From MAILER-DAEMON Tue May 29 11:36:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZOTb-0008M9-LT
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 11:36:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37949)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZOTU-0008KM-Kn
	for coreutils@gnu.org; Tue, 29 May 2012 11:36:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZOTS-0001VY-4z
	for coreutils@gnu.org; Tue, 29 May 2012 11:36:44 -0400
Received: from mx.meyering.net ([88.168.87.75]:60818)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZOTR-0001S2-RZ
	for coreutils@gnu.org; Tue, 29 May 2012 11:36:42 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 332E46009A
	for <coreutils@gnu.org>; Tue, 29 May 2012 17:36:39 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: fix typos in test comments and old ChangeLog files
Date: Tue, 29 May 2012 17:36:39 +0200
Message-ID: <87d35nvw1k.fsf@rho.meyering.net>
Lines: 70
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:36:50 -0000

FYI,

>From 88e133c4c57efb82b6cc7b33f5c7d0be66146541 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 29 May 2012 17:36:10 +0200
Subject: [PATCH] maint: fix typos in test comments and old ChangeLog files

Culprits identified and fixed automatically using these commands:
git ls-files | misspellings -f - |grep -v '^ERROR:' |perl -pe \
's/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/sed -i '\''${2}s!$3!$4!'\'' $1/'\
|bash
using http://github.com/lyda/misspell-check
* old/fileutils/ChangeLog: Fix typos.
* old/textutils/ChangeLog: Likewise.
* tests/misc/truncate-fail-diag: Likewise.
---
 old/fileutils/ChangeLog       | 2 +-
 old/textutils/ChangeLog       | 4 ++--
 tests/misc/truncate-fail-diag | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/old/fileutils/ChangeLog b/old/fileutils/ChangeLog
index cf37a62..0bad716 100644
--- a/old/fileutils/ChangeLog
+++ b/old/fileutils/ChangeLog
@@ -4420,7 +4420,7 @@

 2000-02-26  Jim Meyering  <meyering@lucent.com>

-	Tranform the generated src/Makefile.in file so it falls back on
+	Transform the generated src/Makefile.in file so it falls back on
 	using /bin/rm when necessary.  The old rule didn't always work.
 	This is necessary only on certain losing systems, and because this
 	package builds an `rm' executable and some people put `.' too
diff --git a/old/textutils/ChangeLog b/old/textutils/ChangeLog
index 36f58ff..82d65b7 100644
--- a/old/textutils/ChangeLog
+++ b/old/textutils/ChangeLog
@@ -5496,7 +5496,7 @@ Thu Jul  4 07:24:54 1996  Jim Meyering  <meyering@na-net.ornl.gov>

 Wed Jul  3 23:21:09 1996  Jim Meyering  <meyering@na-net.ornl.gov>

-	* src/md5sum.c (split_3): Correct test for 35-byte line to accomodate
+	* src/md5sum.c (split_3): Correct test for 35-byte line to accommodate
 	fact that leading blanks may be stripped.

 Tue Jul  2 21:51:40 1996  Jim Meyering  <meyering@na-net.ornl.gov>
@@ -8550,7 +8550,7 @@ Tue Jul 17 12:36:11 EDT 1990  Jay Fenlason (hack@ai.mit.edu)
 	* pr.c  Deleted excess whitespace from ends of lines.
 		Modified to work with current version of getopt, which
 		returns 1 instead of 0 for non-options.
-		Reversed the meaning of the -f option, to be compatable
+		Reversed the meaning of the -f option, to be compatible
 		with real pr.

 Sun Jul  8 00:39:31 1990  David J. MacKenzie  (djm at apple-gunkies)
diff --git a/tests/misc/truncate-fail-diag b/tests/misc/truncate-fail-diag
index f9cdabf..994ee0b 100755
--- a/tests/misc/truncate-fail-diag
+++ b/tests/misc/truncate-fail-diag
@@ -1,6 +1,6 @@
 #!/bin/sh
 # make sure truncate gives reasonable diagnostics
-# Note open() checks for trailing '/' before checking for existance
+# Note open() checks for trailing '/' before checking for existence
 # open (".", O_CREAT & (O_WRONLY | O_RDWR), ...) -> EISDIR
 # open ("missing/", O_CREAT & (O_WRONLY | O_RDWR), ...) -> EISDIR
 # open ("missing/file", O_CREAT & (O_WRONLY | O_RDWR), ...) -> ENOENT
--
1.7.10.2.605.gbefc5ed


From MAILER-DAEMON Tue May 29 11:38:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZOVZ-0000HV-7w
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 11:38:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43462)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bwalton@cquest.utoronto.ca>) id 1SZOMw-0005Xj-EY
	for coreutils@gnu.org; Tue, 29 May 2012 11:30:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bwalton@cquest.utoronto.ca>) id 1SZOMq-0006By-7N
	for coreutils@gnu.org; Tue, 29 May 2012 11:29:57 -0400
Received: from garcia.cquest.utoronto.ca ([192.82.128.9]:48850)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bwalton@cquest.utoronto.ca>) id 1SZOMq-0005yI-3U
	for coreutils@gnu.org; Tue, 29 May 2012 11:29:52 -0400
Received: from pinkfloyd.chass.utoronto.ca ([128.100.160.254]:44522 ident=93)
	by garcia.cquest.utoronto.ca with esmtp (Exim 4.63)
	(envelope-from <bwalton@cquest.utoronto.ca>)
	id 1SZOMK-0005rI-7M; Tue, 29 May 2012 11:29:20 -0400
Received: from bwalton by pinkfloyd.chass.utoronto.ca with local (Exim 4.72)
	(envelope-from <bwalton@cquest.utoronto.ca>)
	id 1SZOMK-0005w5-5e; Tue, 29 May 2012 11:29:20 -0400
Content-Type: text/plain; charset=UTF-8
Subject: Re: [PATCH] su: remove program (util-linux is now the best source for
	it)
From: Ben Walton <bwalton@artsci.utoronto.ca>
To: Jim Meyering <jim@meyering.net>
In-reply-to: <87ipffvwyu.fsf@rho.meyering.net>
References: <87ipffvwyu.fsf@rho.meyering.net>
Date: Tue, 29 May 2012 11:29:20 -0400
Message-Id: <1338305273-sup-8024@pinkfloyd.chass.utoronto.ca>
User-Agent: Sup/git
Content-Transfer-Encoding: 8bit
Sender: Ben Walton <bwalton@cquest.utoronto.ca>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 192.82.128.9
X-Mailman-Approved-At: Tue, 29 May 2012 11:38:52 -0400
Cc: coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:30:04 -0000

Excerpts from Jim Meyering's message of Tue May 29 11:16:41 -0400 2012:

Hi Jim,

> Ben, can you use the "su" from util-linux, now?

I'll give it a whirl to see if it can meet our needs.

Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302



From MAILER-DAEMON Tue May 29 13:37:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZQMW-0006nx-Kf
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 13:37:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50569)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SZQMU-0006n0-7O
	for coreutils@gnu.org; Tue, 29 May 2012 13:37:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SZQMO-0005Ty-Rd
	for coreutils@gnu.org; Tue, 29 May 2012 13:37:37 -0400
Received: from moutng.kundenserver.de ([212.227.17.8]:50978)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SZQMO-0005Sn-I8
	for coreutils@gnu.org; Tue, 29 May 2012 13:37:32 -0400
Received: from [192.168.2.108] (p4FF75327.dip.t-dialin.net [79.247.83.39])
	by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis)
	id 0MDgic-1SoK4J3x9y-00HZBC; Tue, 29 May 2012 19:37:26 +0200
Message-ID: <4FC50955.9040509@bernhard-voelker.de>
Date: Tue, 29 May 2012 19:37:25 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120421 Thunderbird/12.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] su: remove program (util-linux is now the best source
	for it)
References: <87ipffvwyu.fsf@rho.meyering.net>
In-Reply-To: <87ipffvwyu.fsf@rho.meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:m4ED5YC5PqfsOdd8iCHMy22dc4O7+u5RctLUgLaxbOs
	SngF1PzKwu7oVCWByvpMylGmB6ki+x2ezMLEraOm67cwxTmZXb
	KPKlXvvZfRaWJkm61lj7xDza+Y6+i+5EDtT0ObIvLHcBYFi2ov
	BohjG5grPwhbXVpac4y+a2zWx/9L1NewbhUuMwWCsJ/wUuICOq
	OVhR2pX2twE8ykEgILClZsx4NutQd2A4RtvwckBXkLBp9D6l88
	Rs2LLvi1TUWLTZ5e+XLEjFymE/n4c5gqeCJfun7GqNVQ+qOsWs
	PQA0njAKXDEjIBjwmPcoiBzZzut/UhlsTvrSrrQbcBjt/UYyYA
	gPpQWi2qWm0z0DpP3mpVtx1qMpTx3poNLM8RKWTYz
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.17.8
Cc: coreutils@gnu.org, bwalton@artsci.utoronto.ca
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 17:37:39 -0000

On 05/29/2012 05:16 PM, Jim Meyering wrote:
> Here's a patch to remove almost all su-related artifacts from coreutils.

I had a quick look on the results of
	git ls-files | xargs grep -w su

This seems to be the only one missing:

diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg
index 3c1c63d..a5e4090 100755
--- a/scripts/git-hooks/commit-msg
+++ b/scripts/git-hooks/commit-msg
@@ -19,7 +19,7 @@ my @valid = qw(
     mv nice nl nohup nproc od paste pathchk pinky pr printenv printf
     ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
     sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty
-    su sum sync tac tail tee test timeout touch tr true truncate tsort
+    sum sync tac tail tee test timeout touch tr true truncate tsort
     tty uname unexpand uniq unlink uptime users vdir wc who whoami yes

     copy gnulib tests maint doc build scripts


Have a nice day,
Berny


From MAILER-DAEMON Tue May 29 14:12:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZQuP-0006we-7t
	for mharc-coreutils@gnu.org; Tue, 29 May 2012 14:12:41 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35397)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZQuI-0006vf-R1
	for coreutils@gnu.org; Tue, 29 May 2012 14:12:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZQuD-00047P-LB
	for coreutils@gnu.org; Tue, 29 May 2012 14:12:34 -0400
Received: from mx.meyering.net ([88.168.87.75]:33005)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SZQuD-000471-Dw
	for coreutils@gnu.org; Tue, 29 May 2012 14:12:29 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 630BA6061E;
	Tue, 29 May 2012 20:12:26 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: Re: [PATCH] su: remove program (util-linux is now the best source for
	it)
In-Reply-To: <4FC50955.9040509@bernhard-voelker.de> (Bernhard Voelker's
	message of "Tue, 29 May 2012 19:37:25 +0200")
References: <87ipffvwyu.fsf@rho.meyering.net>
	<4FC50955.9040509@bernhard-voelker.de>
Date: Tue, 29 May 2012 20:12:26 +0200
Message-ID: <87396ix3ed.fsf@rho.meyering.net>
Lines: 34
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: 88.168.87.75
Cc: coreutils@gnu.org, bwalton@artsci.utoronto.ca
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 18:12:40 -0000

Bernhard Voelker wrote:
> On 05/29/2012 05:16 PM, Jim Meyering wrote:
>> Here's a patch to remove almost all su-related artifacts from coreutils.
>
> I had a quick look on the results of
> 	git ls-files | xargs grep -w su
>
> This seems to be the only one missing:
>
> diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg
> index 3c1c63d..a5e4090 100755
> --- a/scripts/git-hooks/commit-msg
> +++ b/scripts/git-hooks/commit-msg
> @@ -19,7 +19,7 @@ my @valid = qw(
>      mv nice nl nohup nproc od paste pathchk pinky pr printenv printf
>      ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
>      sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty
> -    su sum sync tac tail tee test timeout touch tr true truncate tsort
> +    sum sync tac tail tee test timeout touch tr true truncate tsort
>      tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
>
>      copy gnulib tests maint doc build scripts

Hi Berny,

Actually, I deliberately left that one out.
Otherwise, the commit hook would prohibit this very commit,
since its summary line starts with "su:".
Of course, now that I think about it, I can override that
test with git-commit's --no-verify option.

So I'll squash that in.

Thanks!


From MAILER-DAEMON Wed May 30 09:53:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZjKn-0000Vc-Uh
	for mharc-coreutils@gnu.org; Wed, 30 May 2012 09:53:09 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41363)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1SZjKg-0000PT-IA
	for coreutils@gnu.org; Wed, 30 May 2012 09:53:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1SZjKa-0002gD-75
	for coreutils@gnu.org; Wed, 30 May 2012 09:53:02 -0400
Received: from mx1.redhat.com ([209.132.183.28]:24283)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>)
	id 1SZjKG-0001iU-At; Wed, 30 May 2012 09:52:46 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4UDp92q016528
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 30 May 2012 09:51:09 -0400
Received: from x2 (ovpn-116-57.ams2.redhat.com [10.36.116.57])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q4UDowDI030881; Wed, 30 May 2012 09:50:58 -0400
Date: Wed, 30 May 2012 15:50:57 +0200
From: Karel Zak <kzak@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Message-ID: <20120530135057.GF374@x2.net.home>
References: <4FBE3059.3030806@suse.de> <201205241239.23442.vapier@gentoo.org>
	<20120525085359.GA3781@x2.net.home>
	<201205251348.30812.vapier@gentoo.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201205251348.30812.vapier@gentoo.org>
User-Agent: Mutt/1.5.21 (2011-07-01)
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 13:53:09 -0000

On Fri, May 25, 2012 at 01:48:29PM -0400, Mike Frysinger wrote:
> On Friday 25 May 2012 04:53:59 Karel Zak wrote:
> >  pidof
> >     - from sysvinit; not sure, probably into procps-ng
> 
> with the new project, this is probably possible
> 
> >  su
> >     - will be merged from coreutils into util-linux (2.22 ?)
> > 
> >  login
> >     - already merged Suse version into original login from utils-linux.
> >       The result is PAM-only login(1) with /etc/login.defs support.
> 
> requiring pam is a problem.  i won't be able to convert over to util-linux for 
> utils that are pam-only.

Why? More details, please :-)

IMHO is better to use PAM everywhere than duplicate non-PAM code and
assume that the code is correct and well tested. PAM is abstraction,
the final configuration don't have to be complicated.

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


From MAILER-DAEMON Wed May 30 11:30:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SZkrD-0002Ns-Rc
	for mharc-coreutils@gnu.org; Wed, 30 May 2012 11:30:43 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33896)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1SZkr5-0002Lu-Ur
	for coreutils@gnu.org; Wed, 30 May 2012 11:30:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1SZkr1-0007xs-8S
	for coreutils@gnu.org; Wed, 30 May 2012 11:30:35 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:47000)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>)
	id 1SZkr1-0007xb-2M; Wed, 30 May 2012 11:30:31 -0400
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 54BEA1B4001;
	Wed, 30 May 2012 15:30:28 +0000 (UTC)
From: Mike Frysinger <vapier@gentoo.org>
Organization: wh0rd.org
To: Karel Zak <kzak@redhat.com>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Date: Wed, 30 May 2012 11:30:26 -0400
User-Agent: KMail/1.13.7 (Linux/3.4.0; KDE/4.6.5; x86_64; ; )
References: <4FBE3059.3030806@suse.de> <201205251348.30812.vapier@gentoo.org>
	<20120530135057.GF374@x2.net.home>
In-Reply-To: <20120530135057.GF374@x2.net.home>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1419437.I7JYhUagrq";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201205301130.28042.vapier@gentoo.org>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 140.211.166.183
Cc: hurd-devel@gnu.org, Ludwig Nussel <ludwig.nussel@suse.de>,
	coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 15:30:41 -0000

--nextPart1419437.I7JYhUagrq
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Wednesday 30 May 2012 09:50:57 Karel Zak wrote:
> On Fri, May 25, 2012 at 01:48:29PM -0400, Mike Frysinger wrote:
> > On Friday 25 May 2012 04:53:59 Karel Zak wrote:
> > >  login
> > > =20
> > >     - already merged Suse version into original login from utils-linu=
x.
> > >    =20
> > >       The result is PAM-only login(1) with /etc/login.defs support.
> >=20
> > requiring pam is a problem.  i won't be able to convert over to
> > util-linux for utils that are pam-only.
>=20
> Why? More details, please :-)
>=20
> IMHO is better to use PAM everywhere than duplicate non-PAM code and
> assume that the code is correct and well tested. PAM is abstraction,
> the final configuration don't have to be complicated.

PAM is a complete waste of space on embedded devices and controlled systems=
=2E =20
i'm not saying it isn't useful in many setups (perhaps even the majority),=
=20
just that it is entirely unnecessary in a not insignificant number of other=
=20
setups.
=2Dmike

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJPxj0TAAoJEEFjO5/oN/WBYK4P/2Cfo/JhsJBs1k71Z3PATPNm
PW+3tCqF7ySHiVGfzs51FlfojdAo1NzFTIs/0WA4G3/xtXtJyACRf5D4j68Qhf01
ABenMEP9vrw01fMXAk6viczfy3hosDlPM4EcU4hMv8uYEF7pHC8Dp2OXPw9GRdG+
bcRnnpWGgFG4FiU7ixwIPF5b6+FRpjtpKhba8B8oervd6M76kudEMT9A+/AzOK4q
FscIlvscFo9KcEapaT5J5wsAzwKoVfPQ+Z1W9j1YD311dRA3QxSdr9EraS598M8N
l2/yqNJuVcjLZRZdQH6lfqszaXf1EsAQ2yYgaEvV5ieMhck1AfHS2NPOG/YXSQYI
JW8L4gjKVhktaawvspaACJ8kJbX2hcHE2Xijl8Dy3Kf5L2V6eaN2s7ONWoDKfE1z
PJQWRbdGI9frzMuIUS26Y8XKTE9Qn7PsNm/YvWgogKpIgGWPdn1O83ZDOx42DynI
aNyYvvWvQL19QBBSy2coAmX4CNNAkyIB0e0D/7msnDI4K5Vo+5OiDj5Xj/m6UaZd
P/szjWkAwm5VyDFfEg8BRp+mFiK/uduf06iukGIWoO/rMTrUK8/ouOp6eqtNg7rh
z/nSh1M/hLIFsQvlpxUtj0IT0W4p1imIYOrvrowSXgg3KnItQsHRmKcxq9z8ajtr
dY2F6g8jPrr+FVcrFfGM
=M6gY
-----END PGP SIGNATURE-----

--nextPart1419437.I7JYhUagrq--


From MAILER-DAEMON Thu May 31 04:12:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sa0Un-0003Bn-W0
	for mharc-coreutils@gnu.org; Thu, 31 May 2012 04:12:37 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54007)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ludwig.nussel@suse.de>) id 1Sa0Ug-0003B1-MK
	for coreutils@gnu.org; Thu, 31 May 2012 04:12:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ludwig.nussel@suse.de>) id 1Sa0Ua-0005xy-FE
	for coreutils@gnu.org; Thu, 31 May 2012 04:12:30 -0400
Received: from cantor2.suse.de ([195.135.220.15]:35354 helo=mx2.suse.de)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ludwig.nussel@suse.de>)
	id 1Sa0Ua-0005wD-97; Thu, 31 May 2012 04:12:24 -0400
Received: from relay1.suse.de (unknown [195.135.220.254])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 4D1DA9B119;
	Thu, 31 May 2012 10:12:21 +0200 (CEST)
Message-ID: <4FC727E1.7010808@suse.de>
Date: Thu, 31 May 2012 10:12:17 +0200
From: Ludwig Nussel <ludwig.nussel@suse.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:12.0) Gecko/20120421 Thunderbird/12.0
MIME-Version: 1.0
To: Mike Frysinger <vapier@gentoo.org>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
References: <4FBE3059.3030806@suse.de> <201205251348.30812.vapier@gentoo.org>
	<20120530135057.GF374@x2.net.home>
	<201205301130.28042.vapier@gentoo.org>
In-Reply-To: <201205301130.28042.vapier@gentoo.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.135.220.15
Cc: hurd-devel@gnu.org, Karel Zak <kzak@redhat.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 08:12:36 -0000

Mike Frysinger wrote:
> On Wednesday 30 May 2012 09:50:57 Karel Zak wrote:
>> [...]
>> IMHO is better to use PAM everywhere than duplicate non-PAM code and
>> assume that the code is correct and well tested. PAM is abstraction,
>> the final configuration don't have to be complicated.
>=20
> PAM is a complete waste of space on embedded devices and controlled sys=
tems. =20
> i'm not saying it isn't useful in many setups (perhaps even the majorit=
y),=20
> just that it is entirely unnecessary in a not insignificant number of o=
ther=20
> setups.

You could still use the PAM API and only implement the features
necessary for shadow support. Ie PAM without pluggable modules :-) That
way ugly ifdefs and code duplication could be avoided.

cu
Ludwig

--=20
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rf=
fer, HRB 16746 (AG N=FCrnberg)=20


From MAILER-DAEMON Thu May 31 08:18:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sa4Ks-0006Oj-Ax
	for mharc-coreutils@gnu.org; Thu, 31 May 2012 08:18:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56216)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1Sa4Kl-0006Nv-NV
	for coreutils@gnu.org; Thu, 31 May 2012 08:18:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kzak@redhat.com>) id 1Sa4Kf-0004QJ-9o
	for coreutils@gnu.org; Thu, 31 May 2012 08:18:31 -0400
Received: from mx1.redhat.com ([209.132.183.28]:13251)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzak@redhat.com>)
	id 1Sa4Kf-0004Pq-1g; Thu, 31 May 2012 08:18:25 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4VCIMxA031239
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 31 May 2012 08:18:22 -0400
Received: from x2 (ovpn-116-57.ams2.redhat.com [10.36.116.57])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q4VCILKu008462; Thu, 31 May 2012 08:18:21 -0400
Date: Thu, 31 May 2012 14:18:20 +0200
From: Karel Zak <kzak@redhat.com>
To: Ludwig Nussel <ludwig.nussel@suse.de>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Message-ID: <20120531121820.GA4752@x2.net.home>
References: <4FBE3059.3030806@suse.de> <201205251348.30812.vapier@gentoo.org>
	<20120530135057.GF374@x2.net.home>
	<201205301130.28042.vapier@gentoo.org> <4FC727E1.7010808@suse.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4FC727E1.7010808@suse.de>
User-Agent: Mutt/1.5.21 (2011-07-01)
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: hurd-devel@gnu.org, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 12:18:37 -0000

On Thu, May 31, 2012 at 10:12:17AM +0200, Ludwig Nussel wrote:
> Mike Frysinger wrote:
> > On Wednesday 30 May 2012 09:50:57 Karel Zak wrote:
> >> [...]
> >> IMHO is better to use PAM everywhere than duplicate non-PAM code and
> >> assume that the code is correct and well tested. PAM is abstraction,
> >> the final configuration don't have to be complicated.
> > 
> > PAM is a complete waste of space on embedded devices and controlled systems.  
> > i'm not saying it isn't useful in many setups (perhaps even the majority), 
> > just that it is entirely unnecessary in a not insignificant number of other 
> > setups.
> 
> You could still use the PAM API and only implement the features
> necessary for shadow support. Ie PAM without pluggable modules :-) That
> way ugly ifdefs and code duplication could be avoided.

 Linux_PAM supports --enable-static-modules, not sure how usable is
 it, but it seems like a better way than duplicate any security
 sensitive code.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


From MAILER-DAEMON Thu May 31 12:17:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sa846-0006kx-Ux
	for mharc-coreutils@gnu.org; Thu, 31 May 2012 12:17:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54482)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1Sa843-0006ko-He
	for coreutils@gnu.org; Thu, 31 May 2012 12:17:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1Sa83y-0008Oo-Rp
	for coreutils@gnu.org; Thu, 31 May 2012 12:17:31 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:37171)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>)
	id 1Sa83y-0008OM-Le; Thu, 31 May 2012 12:17:26 -0400
Received: from vapier.localnet (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 8D1CE1B403B;
	Thu, 31 May 2012 16:17:23 +0000 (UTC)
From: Mike Frysinger <vapier@gentoo.org>
Organization: wh0rd.org
To: Ludwig Nussel <ludwig.nussel@suse.de>
Subject: Re: removing "su" from coreutils [Re: Fwd: [PULL] su
Date: Thu, 31 May 2012 12:17:21 -0400
User-Agent: KMail/1.13.7 (Linux/3.4.0; KDE/4.6.5; x86_64; ; )
References: <4FBE3059.3030806@suse.de> <201205301130.28042.vapier@gentoo.org>
	<4FC727E1.7010808@suse.de>
In-Reply-To: <4FC727E1.7010808@suse.de>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart5262509.ofMufL02NF";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201205311217.23248.vapier@gentoo.org>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 140.211.166.183
Cc: hurd-devel@gnu.org, Karel Zak <kzak@redhat.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
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 May 2012 16:17:33 -0000

--nextPart5262509.ofMufL02NF
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Thursday 31 May 2012 04:12:17 Ludwig Nussel wrote:
> Mike Frysinger wrote:
> > On Wednesday 30 May 2012 09:50:57 Karel Zak wrote:
> >> [...]
> >> IMHO is better to use PAM everywhere than duplicate non-PAM code and
> >> assume that the code is correct and well tested. PAM is abstraction,
> >> the final configuration don't have to be complicated.
> >=20
> > PAM is a complete waste of space on embedded devices and controlled
> > systems. i'm not saying it isn't useful in many setups (perhaps even the
> > majority), just that it is entirely unnecessary in a not insignificant
> > number of other setups.
>=20
> You could still use the PAM API and only implement the features
> necessary for shadow support. Ie PAM without pluggable modules :-) That
> way ugly ifdefs and code duplication could be avoided.

in other words, Gentoo has no choice but to stick to shadow's implementatio=
ns=20
for the foreseeable future.  oh well.
=2Dmike

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQIcBAABAgAGBQJPx5mTAAoJEEFjO5/oN/WB3JoQAJ6osyqHDFp948Hv9D900C3v
oR1b0oz1GK9F+0ctB0in4uVLkgysgdW7yRUToco3sxXVMEJFW4HI8Rv89wAnWhVp
/V8sjVYRgdIUpD4cLA3vXrbsEnNDQupCMG2XtMwki3jS0DVPiGz/A9hBkXUuM5as
aoi/UG7F2r5O3oXZ5is4VQEnMKdaWx94JUjtbAK8K52IGxO3u6JuejXQwCAJN44o
obwgYy6iIDxih/Skezssysq+6BdiwXclZVmBcJTmGigNREXuu8oDSS2f+lrpBdCn
QrW7YT0U2T2sRm0rP7QKDRgKu/OGoBuKY3MH1872JeKK3yVE6c+7nzjHKUHprs/X
sYTWjtsdxY34hqb9ZVcevcVcJEhZIZXIrQZdQ2xsRuLr0cO394StKPt6xZdPbZAm
TFOw8YXaiFU/OgdMVfzB489y/QwJ1hOsjTiEBrKzUfNzMlWZJHPDP1VUM9c+5mIx
BkXNYEHhU4UryJ0IiBLUK2x3CGH02xCP8ZxdnI4DCh/EjaniL7n0D0ByP+q9+TWo
qbHDyvLUluebcyurbmH+GtcNeIfrOfQcANib/AHRmLXbCRPdEyBAlS3iDloVYMs8
rE1upRClOmVqi3oVfbGQhgsrAVAAlybFaT+aTXh28uVTaaaZ0Ql3vBZBagwTrW2g
436SlA50nBNlnSo2KRWM
=KrB9
-----END PGP SIGNATURE-----

--nextPart5262509.ofMufL02NF--


