GNU bug report logs - #30253
solaris: cp(1) check failures on tmpfs filesystem (Solaris 10 / Solaris 11)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Reported by: Alexander Pyhalov <alp@HIDDEN>; merged with #21062; dated Thu, 25 Jan 2018 22:35:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'solaris: cp(1) check failures on tmpfs filesystem (Solaris 10 / Solaris 11)' from 'Fix for bug 21062 coreutils-8.24 - cp(1) check failures on tmpfs filesystem (Solaris 10 / Solaris 11)' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 30253 <at> debbugs.gnu.org:


Received: (at 30253) by debbugs.gnu.org; 28 Jan 2018 01:51:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 20:51:28 2018
Received: from localhost ([127.0.0.1]:45626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efc80-0001w9-6X
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 20:51:28 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1efc7x-0001vu-Jf
 for 30253 <at> debbugs.gnu.org; Sat, 27 Jan 2018 20:51:26 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 179F9161615;
 Sat, 27 Jan 2018 17:51:19 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id gG_7g-uHmkcB; Sat, 27 Jan 2018 17:51:18 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 619FA161616;
 Sat, 27 Jan 2018 17:51:18 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id cqlc3D9mSHuQ; Sat, 27 Jan 2018 17:51:18 -0800 (PST)
Received: from [192.168.1.9] (unknown [47.154.30.119])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 382CA161615;
 Sat, 27 Jan 2018 17:51:18 -0800 (PST)
Subject: Re: bug#30253: Fix for bug 21062 coreutils-8.24 - cp(1) check
 failures on tmpfs filesystem (Solaris 10 / Solaris 11)
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@HIDDEN>,
 Alexander Pyhalov <alp@HIDDEN>, 30253 <at> debbugs.gnu.org
References: <2d67f5804f65f20a7ba2099e3eb60153@HIDDEN>
 <c8e71354-6c19-bf3c-d1e4-0b38be883df3@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <7b05ab5a-3dc2-ebd4-e10a-88816b361576@HIDDEN>
Date: Sat, 27 Jan 2018 17:51:17 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.5.0
MIME-Version: 1.0
In-Reply-To: <c8e71354-6c19-bf3c-d1e4-0b38be883df3@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 30253
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

P=C3=A1draig Brady wrote:
> On the face of it, setting errno=3D0 when returning 0 seems correct,

I would say just the opposite. Typically, functions that return 0 on succ=
ess and=20
-1 (setting errno) on failure, are allowed to set errno to whatever they =
like on=20
success. So it should not fix any bugs to set errno to 0 here. My guess i=
s that=20
the bugs are in the callers, not here in the callees.




Information forwarded to bug-coreutils@HIDDEN:
bug#30253; Package coreutils. Full text available.
Forcibly Merged 21062 30253. Request was from Pádraig Brady <P@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 30253 <at> debbugs.gnu.org:


Received: (at 30253) by debbugs.gnu.org; 28 Jan 2018 00:59:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 19:59:06 2018
Received: from localhost ([127.0.0.1]:45615 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efbJJ-0007IM-Qd
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 19:59:06 -0500
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58660)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <P@HIDDEN>)
 id 1efbJI-0007IC-8X; Sat, 27 Jan 2018 19:59:04 -0500
Received: from localhost.localdomain (unknown [76.21.115.186])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 0D7779BD8;
 Sun, 28 Jan 2018 00:59:02 +0000 (GMT)
Subject: Re: bug#30253: Fix for bug 21062 coreutils-8.24 - cp(1) check
 failures on tmpfs filesystem (Solaris 10 / Solaris 11)
To: Alexander Pyhalov <alp@HIDDEN>, 30253 <at> debbugs.gnu.org
References: <2d67f5804f65f20a7ba2099e3eb60153@HIDDEN>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@HIDDEN>
Message-ID: <c8e71354-6c19-bf3c-d1e4-0b38be883df3@HIDDEN>
Date: Sat, 27 Jan 2018 16:59:01 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <2d67f5804f65f20a7ba2099e3eb60153@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30253
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

forcemerge 21062 30253
stop

On 25/01/18 14:34, Alexander Pyhalov wrote:
> Hello.
> 
> I have a fix for 'bug 21062 coreutils-8.24 - cp(1) check failures on 
> tmpfs filesystem (Solaris 10 / Solaris 11)'.
> 
> The issue is that when on tmpfs we use acl(), trying to set ACL, it sets 
> errno to ENOSYS (ACLs not supported).
> set_acls still returns 0, but it spoils errno. When we do "cp -a", later 
> this ENOSYS appears in set_acls() results.
> (I still don't quite understand, why return code is not 0).
> The easiest fix here is to resetting errno to 0 when we are not going to 
> return non-zero result immediately
> 
> https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/sysutils/coreutils/patches/set-permission.c.patch

Thanks a lot for looking at this.
I also partially analyzed the issue at:
https://lists.gnu.org/archive/html/coreutils/2016-11/msg00095.html
with Andreas' response at:
https://lists.gnu.org/archive/html/coreutils/2016-12/msg00002.html

Your fix suggests there is an issue in the ret and errno handling.
This code is very hard to analyze without stepping through
and looking at the state.
On the face of it, setting errno=0 when returning 0 seems correct,
though looking at the code suggests that errno is never inspected unless ret!=0,
hence this might be masking a case where there is actually a failure and
some other error code is not being set.  Your resetting of errno to 0
may just be masking this failure to set an errno?

cheers,
Pádraig.




Information forwarded to bug-coreutils@HIDDEN:
bug#30253; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Jan 2018 22:34:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 25 17:34:54 2018
Received: from localhost ([127.0.0.1]:42940 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eeq6g-0003o3-2Q
	for submit <at> debbugs.gnu.org; Thu, 25 Jan 2018 17:34:54 -0500
Received: from eggs.gnu.org ([208.118.235.92]:37465)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alp@HIDDEN>) id 1eeq6e-0003np-EA
 for submit <at> debbugs.gnu.org; Thu, 25 Jan 2018 17:34:53 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alp@HIDDEN>) id 1eeq6Y-000467-Aj
 for submit <at> debbugs.gnu.org; Thu, 25 Jan 2018 17:34:47 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:59563)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <alp@HIDDEN>) id 1eeq6Y-000463-72
 for submit <at> debbugs.gnu.org; Thu, 25 Jan 2018 17:34:46 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56668)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <alp@HIDDEN>)
 id 1eeq6X-0005Rm-12
 for bug-coreutils@HIDDEN; Thu, 25 Jan 2018 17:34:46 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alp@HIDDEN>) id 1eeq6T-00042v-TV
 for bug-coreutils@HIDDEN; Thu, 25 Jan 2018 17:34:45 -0500
Received: from mail.r61.net ([195.208.245.238]:54857)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <alp@HIDDEN>) id 1eeq6T-0003u1-Df
 for bug-coreutils@HIDDEN; Thu, 25 Jan 2018 17:34:41 -0500
Received: from webmail.sfedu.ru (roundcube.r61.net [195.208.245.237])
 (Authenticated sender: alp@HIDDEN)
 by mail.r61.net (MTA) with ESMTPA id CE2EC620537
 for <bug-coreutils@HIDDEN>; Fri, 26 Jan 2018 01:34:29 +0300 (MSK)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rsu.ru; s=email;
 t=1516919670; bh=VUA3vHKRQ/DpeYNEklPz4Z6OTYT3+z8iq8DIyOTqWC0=;
 h=Date:From:To:Subject:From;
 b=Qu5Qui6YdRAAt2LYoVxed24fmxSHwdkJRbrFrvj1F/qpsaZZSX0+2UaZzz8ncKrNm
 oV2GueM3mym4kK/3PfKYG0Ife1SN5iQOe6OSUMcMvZ3xnmWqgXDehZ2bcnO3nRfak4
 ml+8K+GmL0e1OFVvfjReK0jrRHosluPFNqzkddYw=
Received: from 176x212x32x36.dynamic.chelny.ertelecom.ru ([176.212.32.36])
 by webmail.sfedu.ru
 with HTTP (HTTP/1.1 POST); Fri, 26 Jan 2018 01:34:29 +0300
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="=_34763552608cfedd61f7340243f9b909"
Date: Fri, 26 Jan 2018 01:34:29 +0300
From: Alexander Pyhalov <alp@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: Fix for bug 21062 coreutils-8.24 - cp(1) check failures on tmpfs
 filesystem (Solaris 10 / Solaris 11)
Message-ID: <2d67f5804f65f20a7ba2099e3eb60153@HIDDEN>
X-Sender: alp@HIDDEN
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--=_34763552608cfedd61f7340243f9b909
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII;
 format=flowed

Hello.

I have a fix for 'bug 21062 coreutils-8.24 - cp(1) check failures on 
tmpfs filesystem (Solaris 10 / Solaris 11)'.

The issue is that when on tmpfs we use acl(), trying to set ACL, it sets 
errno to ENOSYS (ACLs not supported).
set_acls still returns 0, but it spoils errno. When we do "cp -a", later 
this ENOSYS appears in set_acls() results.
(I still don't quite understand, why return code is not 0).
The easiest fix here is to resetting errno to 0 when we are not going to 
return non-zero result immediately

https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/sysutils/coreutils/patches/set-permission.c.patch

-- 
System Administrator of Southern Federal University Computer Center
--=_34763552608cfedd61f7340243f9b909
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=set-permission.c.patch
Content-Disposition: attachment;
 filename=set-permission.c.patch;
 size=1048

R05VIENvcmV1dGlscyBidWcgMjEwNjIgY29yZXV0aWxzLTguMjQgLSBjcCgxKSBjaGVjayBmYWls
dXJlcyBvbiB0bXBmcyBmaWxlc3lzdGVtIChTb2xhcmlzIDEwIC8gU29sYXJpcyAxMSkKCi8qIEF2
b2lkIHNwb2lsaW5nIGVycm5vIHdoZW4gd2UgYXJlIGdvaW5nIHRvIGlnbm9yZSBpdCBpbW1lZGlh
dGVseSBhbnl3YXkgKi8KCi0tLSBsaWIvc2V0LXBlcm1pc3Npb25zLmMufjF+CTIwMTctMDktMDEg
MTA6MTI6NDMuMDAwMDAwMDAwICswMDAwCisrKyBsaWIvc2V0LXBlcm1pc3Npb25zLmMJMjAxOC0w
MS0yNiAwMTowMzozMC4xNzU5MDAyMTcgKzAwMDAKQEAgLTIzMCw2ICsyMzAsNyBAQAogICAgICAg
ICB7CiAgICAgICAgICAgaWYgKGVycm5vID09IEVOT1NZUykKIAkgICAgeworCSAgICAgIGVycm5v
ID0gMDsKIAkgICAgICAqbXVzdF9jaG1vZCA9IHRydWU7CiAJICAgICAgcmV0dXJuIDA7CiAJICAg
IH0KQEAgLTI2NSw2ICsyNjYsNyBAQAogCWlmIChlcnJubyA9PSBFTk9TWVMgfHwgZXJybm8gPT0g
RU9QTk9UU1VQUCkKIAkgIHsKIAkgICAgKm11c3RfY2htb2QgPSB0cnVlOworCSAgICBlcnJubyA9
IDA7CiAJICAgIHJldHVybiAwOwogCSAgfQogCXJldHVybiAtMTsKQEAgLTYzNCw2ICs2MzYsNyBA
QAogCSAgaWYgKChlcnJubyA9PSBFTk9TWVMgfHwgZXJybm8gPT0gRU9QTk9UU1VQUCB8fCBlcnJu
byA9PSBFSU5WQUwpCiAJICAgICAgJiYgYWNsX25vbnRyaXZpYWwgKGN0eC0+Y291bnQsIGN0eC0+
ZW50cmllcykgPT0gMCkKIAkgICAgcmV0ID0gMDsKKwkgICAgZXJybm8gPSAwOwogCX0KICAgICAg
IGVsc2UKIAkqYWNsc19zZXQgPSB0cnVlOwpAQCAtNjUxLDYgKzY1NCw3IEBACiAJICBpZiAoKGVy
cm5vID09IEVOT1NZUyB8fCBlcnJubyA9PSBFSU5WQUwgfHwgZXJybm8gPT0gRU5PVFNVUCkKIAkg
ICAgICAmJiBhY2xfYWNlX25vbnRyaXZpYWwgKGN0eC0+YWNlX2NvdW50LCBjdHgtPmFjZV9lbnRy
aWVzKSA9PSAwKQogCSAgICByZXQgPSAwOworCSAgICBlcnJubyA9IDA7CiAJfQogICAgICAgZWxz
ZQogCSphY2xzX3NldCA9IHRydWU7Cg==
--=_34763552608cfedd61f7340243f9b909--




Acknowledgement sent to Alexander Pyhalov <alp@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#30253; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.