[Fakeroot-commits] [SCM] fakeroot branch, upstream, updated. 981b6df8069577f6a312adbbf4835872d9519a38

Clint Adams clint at debian.org
Tue Jan 3 02:57:37 UTC 2012


The following commit has been merged in the upstream branch:
commit 981b6df8069577f6a312adbbf4835872d9519a38
Author: Kyle J. McKay <mackyle at gmail.com>
Date:   Wed Dec 28 11:42:30 2011 -0800

    Darwin fixes for lchown$UNIX2003, setreuid$UNIX2003 and setregid$UNIX2003
    
    The implementations of those functions in libfakeroot_unix2003.c use
    routines from libfakeroot.c that were static and are now private extern
    instead when building on __APPLE__.

diff --git a/libfakeroot.c b/libfakeroot.c
index 4f8979e..0675efc 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -39,13 +39,21 @@
 */
 #define _DARWIN_NO_64_BIT_INODE
 
+/* The helper _unix2003 version of this file calls a few functions in this file
+   that are marked with static_nonapple so that needs to become private instead
+*/
+#define static_nonapple __attribute__((visibility("hidden")))
+
 #ifndef __LP64__
 /*
    This file is for 32-bit symbols which do not have the "$UNIX2003" version.
 */
 #define _NONSTD_SOURCE
 #endif
-#endif
+#else /* !__APPLE__ */
+/* static_nonapple needs to become static in this case */
+#define static_nonapple static
+#endif /* !__APPLE__ */
 
 #include "config.h"
 #include "communicate.h"
@@ -477,7 +485,7 @@ static int set_faked_egid(gid_t egid) {
   return 0;
 }
 
-static int set_faked_reuid(uid_t ruid, uid_t euid) {
+static_nonapple int set_faked_reuid(uid_t ruid, uid_t euid) {
   read_uids();
   if (ruid != (uid_t)-1 || euid != (uid_t)-1)
     faked_saved_uid = faked_effective_uid;
@@ -489,7 +497,7 @@ static int set_faked_reuid(uid_t ruid, uid_t euid) {
   return write_uids();
 }
 
-static int set_faked_regid(gid_t rgid, gid_t egid) {
+static_nonapple int set_faked_regid(gid_t rgid, gid_t egid) {
   read_gids();
   if (rgid != (gid_t)-1 || egid != (gid_t)-1)
     faked_saved_gid = faked_effective_gid;
@@ -546,7 +554,7 @@ static gid_t set_faked_fsgid(gid_t fsgid) {
 #endif
 
 
-static int dont_try_chown(){
+static_nonapple int dont_try_chown(){
   static int inited=0;
   static int donttry;
 
diff --git a/libfakeroot_unix2003.c b/libfakeroot_unix2003.c
index 43d7ea7..762d198 100644
--- a/libfakeroot_unix2003.c
+++ b/libfakeroot_unix2003.c
@@ -81,6 +81,8 @@
 extern int fakeroot_disabled;
 
 #ifdef LCHOWN_SUPPORT
+extern int dont_try_chown() __attribute__((visibility("hidden")));
+
 int lchown$UNIX2003(const char *path, uid_t owner, gid_t group){
   INT_STRUCT_STAT st;
   int r=0;
@@ -179,6 +181,8 @@ int fchmod$UNIX2003(int fd, mode_t mode){
   return r;
 }
 
+extern int set_faked_reuid(uid_t ruid, uid_t euid) __attribute__((visibility("hidden")));
+
 int setreuid$UNIX2003(SETREUID_ARG ruid, SETREUID_ARG euid){
 #ifdef LIBFAKEROOT_DEBUGGING
   if (fakeroot_debug) {
@@ -190,6 +194,8 @@ int setreuid$UNIX2003(SETREUID_ARG ruid, SETREUID_ARG euid){
   return set_faked_reuid(ruid, euid);
 }
 
+extern int set_faked_regid(gid_t rgid, gid_t egid) __attribute__((visibility("hidden")));
+
 int setregid$UNIX2003(SETREGID_ARG rgid, SETREGID_ARG egid){
 #ifdef LIBFAKEROOT_DEBUGGING
   if (fakeroot_debug) {

-- 
fakeroot



More information about the Fakeroot-commits mailing list