[Fakeroot-commits] [SCM] fakeroot branch, upstream, updated. 7688f1b398a9e71f239b1a7a6142a2d2d9f2beeb

Clint Adams clint at debian.org
Tue Aug 23 13:12:57 UTC 2011


The following commit has been merged in the upstream branch:
commit a9ce3ecbf3dc32e66a50380de01faa3b88ed0b07
Author: Kyle J. McKay <mackyle at gmail.com>
Date:   Tue May 31 02:08:51 2011 -0700

    Mac OS X 10.6 CarbonCore support

diff --git a/communicate.h b/communicate.h
index 2d784c5..947e807 100644
--- a/communicate.h
+++ b/communicate.h
@@ -54,6 +54,9 @@
 # ifndef MAC_OS_X_VERSION_10_5 1050
 #  define MAC_OS_X_VERSION_10_5 1050
 # endif
+# ifndef MAC_OS_X_VERSION_10_6 1060
+#  define MAC_OS_X_VERSION_10_6 1060
+# endif
 # if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 #  define HAVE_APPLE_STAT64 1
 # endif
diff --git a/libfakeroot.c b/libfakeroot.c
index e12f740..dc2020a 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -1356,6 +1356,25 @@ int dup2(int oldfd, int newfd)
 }
 #endif /* FAKEROOT_FAKENET */
 
+#ifdef __APPLE__
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
+
+static int check_fakeroot_disabled(void *retaddr){
+  Dl_info info;
+  const char *suffix;
+  if (fakeroot_disabled || !dladdr(retaddr, &info))
+    return fakeroot_disabled;
+  suffix = strrchr(info.dli_fname, '/');
+  if (suffix && strcmp(suffix, "/CarbonCore") == 0)
+    return 1;
+  return fakeroot_disabled;
+}
+
+#define fakeroot_disabled check_fakeroot_disabled(__builtin_return_address(0))
+
+#endif
+#endif /* __APPLE__ */
+
 uid_t getuid(void){
   if (fakeroot_disabled)
     return next_getuid();
@@ -1494,6 +1513,8 @@ int setgroups(SETGROUPS_SIZE_TYPE size, const gid_t *list){
     return 0;
 }
 
+#undef fakeroot_disabled
+
 int fakeroot_disable(int new)
 {
   int old = fakeroot_disabled;

-- 
fakeroot



More information about the Fakeroot-commits mailing list