diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-21 17:19:38 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-21 17:20:43 +0200 |
commit | 7c7c063b5cc9e842b56f7167556432b5ec5ddf2f (patch) | |
tree | 2bc296c100e9b45f7495931d38e9924237e3f658 | |
parent | 23ed280cdf05f2aff99136b6aa7ee8f368ce2707 (diff) | |
download | gnulib-7c7c063b5cc9e842b56f7167556432b5ec5ddf2f.tar.gz gnulib-7c7c063b5cc9e842b56f7167556432b5ec5ddf2f.tar.bz2 |
fchownat: Support clang -fsanitize=implicit-integer-sign-change better.
Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG,
gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Cast -1 to uid_t or git_t,
respectively.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | m4/fchownat.m4 | 6 |
2 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,12 @@ +2020-05-21 Bruno Haible <bruno@clisp.org> + + fchownat: Support clang -fsanitize=implicit-integer-sign-change better. + Reported by Tim Rühsen in + <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>. + * m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG, + gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Cast -1 to uid_t or git_t, + respectively. + 2020-05-18 Tim Rühsen <tim.ruehsenqgmx.de> getdelim: Avoid wrong configure results with gcc -fsanitize=address. diff --git a/m4/fchownat.m4 b/m4/fchownat.m4 index cd5c30170a..0a5d637030 100644 --- a/m4/fchownat.m4 +++ b/m4/fchownat.m4 @@ -1,4 +1,4 @@ -# fchownat.m4 serial 5 +# fchownat.m4 serial 6 dnl Copyright (C) 2004-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -64,7 +64,7 @@ AC_DEFUN([gl_FUNC_FCHOWNAT_DEREF_BUG], int main () { - return (fchownat (AT_FDCWD, "$gl_dangle", -1, getgid (), + return (fchownat (AT_FDCWD, "$gl_dangle", (uid_t)(-1), getgid (), AT_SYMLINK_NOFOLLOW) != 0 && errno == ENOENT); } @@ -98,7 +98,7 @@ AC_DEFUN([gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG], fd = open ("conftestdir", O_RDONLY); if (fd < 0) return 3; - ret = fchownat (fd, "", -1, -1, 0); + ret = fchownat (fd, "", (uid_t)(-1), (gid_t)(-1), 0); close (fd); rmdir ("conftestdir"); return ret == 0; |