From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.0.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id CFFCF1F405 for ; Thu, 20 Dec 2018 10:35:43 +0000 (UTC) Received: from localhost ([::1]:36499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZvg4-0002qi-Eo for normalperson@yhbt.net; Thu, 20 Dec 2018 05:35:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZvfw-0002pO-Ql for bug-gnulib@gnu.org; Thu, 20 Dec 2018 05:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZvfr-0001Ra-Sb for bug-gnulib@gnu.org; Thu, 20 Dec 2018 05:35:32 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:35780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZvfr-0001Pl-KQ for bug-gnulib@gnu.org; Thu, 20 Dec 2018 05:35:27 -0500 Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id 7314A72CC53; Thu, 20 Dec 2018 13:35:24 +0300 (MSK) Received: by imap.altlinux.org (Postfix, from userid 620) id 644E44A4AEB; Thu, 20 Dec 2018 13:35:24 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by imap.altlinux.org (Postfix) with ESMTP id 5696B4A4A16; Thu, 20 Dec 2018 13:35:24 +0300 (MSK) Date: Thu, 20 Dec 2018 13:35:24 +0300 (MSK) From: Ivan Zakharyaschev To: Bruno Haible Subject: Re: [PATCH] test-lchown.h: "symlink ownership not supported" is indicated by EOPNOTSUPP In-Reply-To: <110379545.t3dY2iStkM@omega> Message-ID: References: <20181215124834.2007-1-imz@altlinux.org> <110379545.t3dY2iStkM@omega> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 194.107.17.57 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Bruno, On Thu, 20 Dec 2018, Bruno Haible wrote: > > Such convention concerning the meaning of EOPNOTSUPP was also stated > > in The Open Group Base Specifications Issue 6 > > IEEE Std 1003.1, 2004 Edition > > (http://pubs.opengroup.org/onlinepubs/009604599/functions/lchown.html); > > however, the EOPNOTSUPP case is removed in Issue 7, 2018 Edition > > (http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html). > > The fact that it has been removed from the later revision of the standard > means that implementations have now more freedom regarding the errno > value that they return in this case. My guess actually was that the standard now requires that there is no such kind of failure at all, and this operation has always to be implemented in conforming OSes. But I don't want to make this claim. > > And if ENOSYS is raised for a > > symlink, but not for a directory, this would be against the expected > > behavior and should make the test fail. > > You claim "should", but I don't want to make the test fail when it earlier > succeeded; and you have not tested this on the various platforms. As > pointed out above, various errno values should be acceptable. > > I've pushed this instead: I have no objections. Thank you! > 2018-12-19 Bruno Haible > > lchown tests: Be more permissive regarding errno values. > Reported by Ivan Zakharyaschev . > * tests/test-lchown.h (test_lchown): Recognize EOPNOTSUPP as an > alternative to ENOSYS. > * modules/lchown-tests (Depends-on): Add 'errno'. > * modules/fchownat-tests (Depends-on): Likewise. > > diff --git a/modules/fchownat-tests b/modules/fchownat-tests > index 81adf7f..e5fb783 100644 > --- a/modules/fchownat-tests > +++ b/modules/fchownat-tests > @@ -7,6 +7,7 @@ tests/signature.h > tests/macros.h > > Depends-on: > +errno > ignore-value > intprops > mgetgroups > diff --git a/modules/lchown-tests b/modules/lchown-tests > index c5bba89..42b9460 100644 > --- a/modules/lchown-tests > +++ b/modules/lchown-tests > @@ -6,6 +6,7 @@ tests/signature.h > tests/macros.h > > Depends-on: > +errno > ignore-value > intprops > mgetgroups > diff --git a/tests/test-lchown.h b/tests/test-lchown.h > index bc10a50..8bf79b1 100644 > --- a/tests/test-lchown.h > +++ b/tests/test-lchown.h > @@ -124,7 +124,7 @@ test_lchown (int (*func) (char const *, uid_t, gid_t), bool print) > return 77; > } > result = func (BASE "dir/link2", -1, -1); > - if (result == -1 && errno == ENOSYS) > + if (result == -1 && (errno == ENOSYS || errno == EOPNOTSUPP)) > { > ASSERT (unlink (BASE "dir/file") == 0); > ASSERT (unlink (BASE "dir/link2") == 0); >