return ostype;
}
+#if !defined(HAVE_DARWIN_OS)
/*
* See if an acl is a trivial one (e.g. just the stat bits encoded as acl.)
* There is no need to store those acls as we already store the stat bits too.
*/
-#if defined(HAVE_DARWIN_OS)
-static bool acl_is_trivial(acl_t acl)
-{
- /*
- * acl is trivial if it is empty.
- */
-// return (acl_entries(acl) == 0);
- return true; /* Allow to compile -- KES */
-}
-#else /* FreeBSD, IRIX, OSF1, Linux */
static bool acl_is_trivial(acl_t acl)
{
/*
}
#endif
+#if !defined(HAVE_DARWIN_OS)
/*
* Make sure this is not just a trivial ACL.
*/
- if ((acltype == BACL_TYPE_ACCESS ||
- acltype == BACL_TYPE_EXTENDED) &&
- acl_is_trivial(acl)) {
+ if (acltype == BACL_TYPE_ACCESS && acl_is_trivial(acl)) {
/*
* The ACLs simply reflect the (already known) standard permissions
* So we don't send an ACL stream to the SD.
acl_free(acl);
return 0;
}
+#endif
if ((acl_text = acl_to_text(acl, NULL)) != NULL) {
len = pm_strcpy(jcr->acl_data, acl_text);
*/
if ((len = generic_get_acl_from_os(jcr, BACL_TYPE_ACCESS)) < 0)
return false;
-#endif
if (len > 0) {
if (!send_acl_stream(jcr, STREAM_ACL_DARWIN_ACCESS_ACL_T, len))
return false;
}
+#endif
return true;
}
#include "filed.h"
#include "xattr.h"
-/* Klude to fix Darwin build -- KES */
-#ifdef HAVE_DARWIN_OS
-#undef HAVE_XATTR
-#endif
-
-
/*
* List of supported OSs.
*/
#include <sys/xattr.h>
#endif
-#if defined(HAVE_GETXATTR) && !defined(HAVE_LGETXATTR)
-#define lgetxattr getxattr
-#endif
-#if defined(HAVE_SETXATTR) && !defined(HAVE_LSETXATTR)
-#define lsetxattr setxattr
-#endif
-#if defined(HAVE_LISTXATTR) && !defined(HAVE_LLISTXATTR)
-#define llistxattr listxattr
+/*
+ * OSX doesn't have llistxattr, lgetxattr and lsetxattr but has
+ * listxattr, getxattr and setxattr with an extra options argument
+ * which mimics the l variants of the functions when we specify
+ * XATTR_NOFOLLOW as the options value.
+ */
+#if defined(HAVE_DARWIN_OS)
+ #define llistxattr(path, list, size) listxattr((path), (list), (size), XATTR_NOFOLLOW)
+ #define lgetxattr(path, name, value, size) getxattr((path), (name), (value), (size), XATTR_NOFOLLOW)
+ #define lsetxattr(path, name, value, size, flags) setxattr((path), (name), (value), (size), (flags), XATTR_NOFOLLOW)
+#else
+ /*
+ * Fallback to the non l-functions when those are not available.
+ */
+ #if defined(HAVE_GETXATTR) && !defined(HAVE_LGETXATTR)
+ #define lgetxattr getxattr
+ #endif
+ #if defined(HAVE_SETXATTR) && !defined(HAVE_LSETXATTR)
+ #define lsetxattr setxattr
+ #endif
+ #if defined(HAVE_LISTXATTR) && !defined(HAVE_LLISTXATTR)
+ #define llistxattr listxattr
+ #endif
#endif
/*
*/
#undef VERSION
-#define VERSION "2.5.21"
-#define BDATE "26 November 2008"
-#define LSMDATE "26Nov08"
+#define VERSION "2.5.22"
+#define BDATE "01 December 2008"
+#define LSMDATE "01Dec08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */