Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
77daf2187b
2 değiştirilmiş dosya ile 1 ekleme ve 5 silme
  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 \
                          strnlen strerror strsignal \
                          scandir alphasort unsetenv])
-AC_CHECK_FUNCS([strtoul isascii bcopy memcpy lchown setsid getdtablesize \
+AC_CHECK_FUNCS([strtoul isascii bcopy memcpy setsid getdtablesize \
                 posix_fadvise])
 
 DPKG_MMAP

+ 0 - 4
lib/compat/compat.h

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