From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10887 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] drop lchmod Date: Wed, 4 Jan 2017 16:35:52 -0500 Message-ID: <20170104213552.GR1555@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1483565777 17341 195.159.176.226 (4 Jan 2017 21:36:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2017 21:36:17 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10900-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 04 22:36:14 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cOtE1-0002jq-Hh for gllmg-musl@m.gmane.org; Wed, 04 Jan 2017 22:36:01 +0100 Original-Received: (qmail 1787 invoked by uid 550); 4 Jan 2017 21:36:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 1753 invoked from network); 4 Jan 2017 21:36:04 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10887 Archived-At: On Wed, Jan 04, 2017 at 10:23:55PM +0100, Julien Ramseier wrote: > lchmod is not POSIX and not supported on Linux. > Keeping it would probably do more harm than good: software checking > for its presence (i.e. libarchive) will use it and always fail. > > > diff --git a/include/sys/stat.h b/include/sys/stat.h > index 9d09662..0058338 100644 > --- a/include/sys/stat.h > +++ b/include/sys/stat.h > @@ -92,7 +92,6 @@ int futimens(int, const struct timespec [2]); > int utimensat(int, const char *, const struct timespec [2], int); > > #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) > -int lchmod(const char *, mode_t); > #define S_IREAD S_IRUSR > #define S_IWRITE S_IWUSR > #define S_IEXEC S_IXUSR > diff --git a/src/stat/lchmod.c b/src/stat/lchmod.c > deleted file mode 100644 > index f324ba7..0000000 > --- a/src/stat/lchmod.c > +++ /dev/null > @@ -1,8 +0,0 @@ > -#define _GNU_SOURCE > -#include > -#include > - > -int lchmod(const char *path, mode_t mode) > -{ > - return fchmodat(AT_FDCWD, path, mode, AT_SYMLINK_NOFOLLOW); > -} This can't be done because it's ABI. It will cause any program linked with a reference to lchmod to failto execute with missing symbol errors. libarchive needs to be fixed to respect the errno value. fchmodat with AT_FDCWD and the AT_SYMLINK_NOFOLLOW flag is semantically equivalent to lchmod and is required by POSIX, so software should be prepared to deal with systems where the error EOPNOTSUPP occurs. Rich