mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] drop lchmod
@ 2017-01-04 21:23 Julien Ramseier
  2017-01-04 21:35 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Ramseier @ 2017-01-04 21:23 UTC (permalink / raw)
  To: musl

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 <sys/stat.h>
-#include <fcntl.h>
-
-int lchmod(const char *path, mode_t mode)
-{
-   return fchmodat(AT_FDCWD, path, mode, AT_SYMLINK_NOFOLLOW);
-}



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drop lchmod
  2017-01-04 21:23 [PATCH] drop lchmod Julien Ramseier
@ 2017-01-04 21:35 ` Rich Felker
  2017-01-05  0:39   ` A. Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2017-01-04 21:35 UTC (permalink / raw)
  To: musl

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 <sys/stat.h>
> -#include <fcntl.h>
> -
> -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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drop lchmod
  2017-01-04 21:35 ` Rich Felker
@ 2017-01-05  0:39   ` A. Wilcox
  2017-01-05 11:23     ` Julien Ramseier
  0 siblings, 1 reply; 4+ messages in thread
From: A. Wilcox @ 2017-01-05  0:39 UTC (permalink / raw)
  To: musl

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 04/01/17 15:35, Rich Felker wrote:

> libarchive needs to be fixed to respect the errno value.

https://github.com/libarchive/libarchive/commit/65fe103

We had to ship this patch in Adélie for the v3.1.x branch, but 3.2+
integrates it, and it works fine on musl without patching here.

Julien, can you reproduce any sort of failure with libarchive-3.2 or
newer?  Or is this in another package?  Perhaps more information would
be useful.  At any rate, there is no reason to drop this function.

- --arw


- -- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
http://adelielinux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJYbZWsAAoJEMspy1GSK50UFtUP/3lvELJsq140Ilt+m6q0jBxv
yCdDtMlobtIGiF34AjYJw0OiABWU0lz+UE6WAV+yIgwHnvbiHmiGMAv72ZbbuFkP
MWzrqzQFyVwJMzjLz/cf+qvZlnrIdDq7GhK8i2e42iyx0HWMC59I7NuEFmAIUjzx
QT6n8/OIO36wNG1om6E0qiLQZFuJ+m2lk8hWTHHQTqxQwbKX1ybsRN+ZfbMpe9+P
NuIInTHuchtvyxZQU6fqHYciDIU2140go93HHGNiprfw8OO8wqpOIWGwJ7XypR7B
QLB5WvkquL3y34GF0TX976+l9qjAyDYuZ72p8XMaI+Q9ExZ5okq0CKIz3L7LD9aN
9ZPvHZwo33Zc6QJ0wIR95JedoLowD4FKhzCJYwR0mKxR8dBGDaDkh35exC5bDDCQ
DrPIKoh6dQKvEDZkKbpfjyY7INZtw36uD9J083VTxLPk2aNg22g04CFmxbOGSkgF
Pl8gCMNCVj9sKm8mG7TY4eYJf6Bbycg6hL9rwDPryfA6Rx4D3+oCIj8yKVc981PQ
5Fjyfb5ROGfu7JtoYWfrOG76xJh2PgqTs1d7KmAuaBKyinZ56ZQ25xBnEGV+RXbA
xkDG7AB5a6flNZTUFXK69KSAQiwzuGR1hDfOdQTc6DlZwCYkgxgeCQR6okmKHA/6
nkdWdV64DcDhKBYVym1C
=K5su
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drop lchmod
  2017-01-05  0:39   ` A. Wilcox
@ 2017-01-05 11:23     ` Julien Ramseier
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Ramseier @ 2017-01-05 11:23 UTC (permalink / raw)
  To: musl


> Le 5 janv. 2017 à 01:39, A. Wilcox <awilfox@adelielinux.org> a écrit :
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> On 04/01/17 15:35, Rich Felker wrote:
> 
>> libarchive needs to be fixed to respect the errno value.
> 
> https://github.com/libarchive/libarchive/commit/65fe103
> 
> We had to ship this patch in Adélie for the v3.1.x branch, but 3.2+
> integrates it, and it works fine on musl without patching here.
> 
> Julien, can you reproduce any sort of failure with libarchive-3.2 or
> newer?  Or is this in another package?  Perhaps more information would
> be useful.  At any rate, there is no reason to drop this function.
> 

Indeed I was using an older version and had not noticed this was fixed.

I keep forgetting about ABI breakages (since I don't care about them
in my use case) and send stupid patches...

- J



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-05 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04 21:23 [PATCH] drop lchmod Julien Ramseier
2017-01-04 21:35 ` Rich Felker
2017-01-05  0:39   ` A. Wilcox
2017-01-05 11:23     ` Julien Ramseier

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).