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

Previous Next

Package: coreutils;

Reported by: Peter Bray <pdb_ml <at> yahoo.com.au>

Date: Wed, 15 Jul 2015 11:08:02 UTC

Severity: normal

Merged with 30253

Full log


Message #13 received at control <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Alexander Pyhalov <alp <at> rsu.ru>, 30253 <at> debbugs.gnu.org
Subject: Re: bug#30253: Fix for bug 21062 coreutils-8.24 - cp(1) check
 failures on tmpfs filesystem (Solaris 10 / Solaris 11)
Date: Sat, 27 Jan 2018 16:59:01 -0800
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.




This bug report was last modified 6 years and 242 days ago.

Previous Next


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