From c6e0b0b5b0b7922cdf0dce2af671e0c7e500df95 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 29 Dec 2020 11:37:34 -0300 Subject: stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ #26341] [BZ #24970] It sync with gnulib version ae9fb3d66. The testcase for BZ#23741 (stdlib/test-bz22786.c) is adjusted to check also for ENOMEM. The patch fixes multiple realpath issues: - Portability fixes for errno clobbering on free (BZ#10635). The function does not call free directly anymore, although it might be done through scratch_buffer_free. The free errno clobbering is being tracked by BZ#17924. - Pointer arithmetic overflows in realpath (BZ#26592). - Realpath cyclically call __alloca(path_max) to consume too much stack space (BZ#26341). - Realpath mishandles EOVERFLOW; stat not needed anyway (BZ#24970). The check is done through faccessat now. Checked on x86_64-linux-gnu and i686-linux-gnu. --- sysdeps/unix/sysv/linux/faccessat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/faccessat.c') diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c index ccf559ccf8..13160d3249 100644 --- a/sysdeps/unix/sysv/linux/faccessat.c +++ b/sysdeps/unix/sysv/linux/faccessat.c @@ -24,7 +24,7 @@ int -faccessat (int fd, const char *file, int mode, int flag) +__faccessat (int fd, const char *file, int mode, int flag) { int ret = INLINE_SYSCALL_CALL (faccessat2, fd, file, mode, flag); #if __ASSUME_FACCESSAT2 @@ -73,3 +73,4 @@ faccessat (int fd, const char *file, int mode, int flag) return INLINE_SYSCALL_ERROR_RETURN_VALUE (EACCES); #endif /* !__ASSUME_FACCESSAT2 */ } +weak_alias (__faccessat, faccessat) -- cgit 1.4.1