ソースを参照

build: Do not fallback to use chown instead of lchown if not available

When creating symlinks on extraction, dpkg needs to set its owner, if
we fallback to use chown in place of lchown we might get to a situation
where the dereferenced symlink does not yet exist, which would cause an
unwanted error.

On some older and buggy systems, chown does not actually dereference
symlinks, so it could be safely used although it would need to be
detected at runtime, as the kernel could be switched under our feet,
but given that lchown is already specified by UNIX98, there's not much
sense in not assuming it's present and working at this point in time.
Guillem Jover 16 年 前
コミット
77daf2187b
共有2 個のファイルを変更した1 個の追加5 個の削除を含む
  1. 1 1
      configure.ac
  2. 0 4
      lib/compat/compat.h

+ 1 - 1
configure.ac

@@ -124,7 +124,7 @@ DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
                          strnlen strerror strsignal \
                          strnlen strerror strsignal \
                          scandir alphasort unsetenv])
                          scandir alphasort unsetenv])
-AC_CHECK_FUNCS([strtoul isascii bcopy memcpy lchown setsid getdtablesize \
+AC_CHECK_FUNCS([strtoul isascii bcopy memcpy setsid getdtablesize \
                 posix_fadvise])
                 posix_fadvise])
 
 
 DPKG_MMAP
 DPKG_MMAP

+ 0 - 4
lib/compat/compat.h

@@ -42,10 +42,6 @@ extern "C" {
 #define strtoul strtol
 #define strtoul strtol
 #endif
 #endif
 
 
-#ifndef HAVE_LCHOWN
-#define lchown chown
-#endif
-
 #ifndef HAVE_VA_COPY
 #ifndef HAVE_VA_COPY
 #include <string.h>
 #include <string.h>
 #define va_copy(dest, src) memcpy(&(dest), &(src), sizeof(va_list))
 #define va_copy(dest, src) memcpy(&(dest), &(src), sizeof(va_list))