]> Savannah Git Hosting - gnulib.git/commitdiff
fchownat: Support clang -fsanitize=implicit-integer-sign-change better.
authorBruno Haible <bruno@clisp.org>
Thu, 21 May 2020 15:19:38 +0000 (17:19 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 21 May 2020 15:20:43 +0000 (17:20 +0200)
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.

ChangeLog
m4/fchownat.m4

index 2133ea5372ea9cec96a7c333902e19ebad44a5b8..b9048453e267ae542f8d1ac267c7802f6d34ee03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index cd5c30170af7e9a5f1b1fae8e016ea1185c17235..0a5d6370308cd1f9cfd7fcafc9e8530723500313 100644 (file)
@@ -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;