[Fakeroot-commits] [SCM] fakeroot branch, upstream, updated. 4f9c384058aa846ac603572619770234ea916079
Clint Adams
clint at debian.org
Sat Jun 2 18:24:31 UTC 2012
The following commit has been merged in the upstream branch:
commit 9b4affdf6939b94cb7544b571733e45687246c05
Author: Kyle J. McKay <mackyle at gmail.com>
Date: Mon May 14 11:47:29 2012 -0700
Fix getattrlist failures on Darwin
diff --git a/libfakeroot.c b/libfakeroot.c
index 2683e8f..438f018 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -1627,14 +1627,14 @@ getattrlist(const char *path, void *attrList, void *attrBuf,
return r;
}
if (options & FSOPT_NOFOLLOW) {
- r=lstat(path, &st);
+ r=WRAP_LSTAT(path, &st);
} else {
- r=stat(path, &st);
+ r=WRAP_STAT(path, &st);
}
if (r) {
return r;
}
- patchattr(attrList, attrBuf, st.st_uid, st.st_gid);
+ patchattr(attrList, attrBuf, st.st_uid, st.st_gid, st.st_mode);
return 0;
}
@@ -1662,11 +1662,11 @@ fgetattrlist(int fd, void *attrList, void *attrBuf,
if (r) {
return r;
}
- r=fstat(fd, &st);
+ r=WRAP_FSTAT(fd, &st);
if (r) {
return r;
}
- patchattr(attrList, attrBuf, st.st_uid, st.st_gid);
+ patchattr(attrList, attrBuf, st.st_uid, st.st_gid, st.st_mode);
return 0;
}
diff --git a/libfakeroot_unix2003.c b/libfakeroot_unix2003.c
index 762d198..95fb4de 100644
--- a/libfakeroot_unix2003.c
+++ b/libfakeroot_unix2003.c
@@ -224,14 +224,14 @@ getattrlist$UNIX2003(const char *path, void *attrList, void *attrBuf,
return r;
}
if (options & FSOPT_NOFOLLOW) {
- r=lstat(path, &st);
+ r=WRAP_LSTAT(path, &st);
} else {
- r=stat(path, &st);
+ r=WRAP_STAT(path, &st);
}
if (r) {
return r;
}
- patchattr(attrList, attrBuf, st.st_uid, st.st_gid);
+ patchattr(attrList, attrBuf, st.st_uid, st.st_gid, st.st_mode);
return 0;
}
diff --git a/patchattr.h b/patchattr.h
index e77fe15..d394e69 100644
--- a/patchattr.h
+++ b/patchattr.h
@@ -33,7 +33,7 @@ extern int fakeroot_debug;
#endif /* LIBFAKEROOT_DEBUGGING */
static void
-patchattr(void *attrList, void *attrBuf, uid_t uid, gid_t gid)
+patchattr(void *attrList, void *attrBuf, uid_t uid, gid_t gid, mode_t mode)
{
/* Attributes, in the order in which they are returned (which is the same as
the order they are described in the man page).
@@ -116,6 +116,14 @@ patchattr(void *attrList, void *attrBuf, uid_t uid, gid_t gid)
#endif /* LIBFAKEROOT_DEBUGGING */
*(gid_t *)b = gid;
}
+ if (attrs[i].value == ATTR_CMN_ACCESSMASK) {
+#ifdef LIBFAKEROOT_DEBUGGING
+ if (fakeroot_debug) {
+ fprintf(stderr, "patchattr mode 0%o\n", *(mode_t *)b);
+ }
+#endif /* LIBFAKEROOT_DEBUGGING */
+ *(mode_t *)b = mode;
+ }
b += (attrs[i].size + 3) & ~3;
}
}
--
fakeroot
More information about the Fakeroot-commits
mailing list