*
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
- * Copyright (C) 2006 Wayne Davison
+ * Copyright (C) 2006-2009 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static const char *str_acl_type(SMB_ACL_TYPE_T type)
{
- return type == SMB_ACL_TYPE_ACCESS ? "SMB_ACL_TYPE_ACCESS"
- : type == SMB_ACL_TYPE_DEFAULT ? "SMB_ACL_TYPE_DEFAULT"
- : "unknown SMB_ACL_TYPE_T";
+ switch (type) {
+ case SMB_ACL_TYPE_ACCESS:
+#ifdef HAVE_OSX_ACLS
+ return "ACL_TYPE_EXTENDED";
+#else
+ return "ACL_TYPE_ACCESS";
+#endif
+ case SMB_ACL_TYPE_DEFAULT:
+ return "ACL_TYPE_DEFAULT";
+ default:
+ break;
+ }
+ return "unknown ACL type!";
}
static int calc_sacl_entries(const rsync_acl *racl)
else {
if (racl->group_obj == racl->mask_obj)
racl->group_obj = NO_ENTRY;
- racl->mask_obj = NO_ENTRY;
+ if (racl->names.count != 0)
+ racl->mask_obj = NO_ENTRY;
}
racl->other_obj = NO_ENTRY;
}
for (ida = idal->idas; count--; ida++) {
uint32 xbits = ida->access << 2;
- char *name;
+ const char *name;
if (ida->access & NAME_IS_USER) {
xbits |= XFLAG_NAME_IS_USER;
name = add_uid(ida->id);
/* If we received a superfluous mask, throw it away. */
duo_item->racl.mask_obj = NO_ENTRY;
#else
- if (!duo_item->racl.names.count) {
- /* If we received a superfluous mask, throw it away. */
- if (duo_item->racl.mask_obj != NO_ENTRY) {
- /* Mask off the group perms with it first. */
- duo_item->racl.group_obj &= duo_item->racl.mask_obj | NO_ENTRY;
- duo_item->racl.mask_obj = NO_ENTRY;
- }
- } else if (duo_item->racl.mask_obj == NO_ENTRY) /* Must be non-empty with lists. */
+ if (duo_item->racl.names.count && duo_item->racl.mask_obj == NO_ENTRY) /* Must be non-empty with lists. */
duo_item->racl.mask_obj = (computed_mask_bits | duo_item->racl.group_obj) & ~NO_ENTRY;
#endif
#endif
if (sys_acl_set_file(fname, type, duo_item->sacl) < 0) {
rsyserr(FERROR_XFER, errno, "set_acl: sys_acl_set_file(%s, %s)",
- fname, str_acl_type(type));
+ fname, str_acl_type(type));
return -1;
}
if (type == SMB_ACL_TYPE_ACCESS)
/* Apply the permission-bit entries of the default ACL, if any. */
if (racl.user_obj != NO_ENTRY) {
perms = rsync_acl_get_perms(&racl);
- if (verbose > 2)
+ if (DEBUG_GTE(ACL, 1))
rprintf(FINFO, "got ACL-based default perms %o for directory %s\n", perms, dir);
}