X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1c3344a105f656a45f6b46e1710c3fc4ab862a9a..764782662d8049bf835cad0e643be6ee6ed7280c:/acls.c diff --git a/acls.c b/acls.c index e73eec3d..7bc09fcd 100644 --- a/acls.c +++ b/acls.c @@ -6,9 +6,8 @@ * Copyright (C) 2006 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -510,7 +509,7 @@ static int get_rsync_acl(const char *fname, rsync_acl *racl, if (!ok) { return -1; } - } else if (errno == ENOTSUP || errno == ENOSYS) { + } else if (no_acl_syscall_error(errno)) { /* ACLs are not supported, so pretend we have a basic ACL. */ if (type == SMB_ACL_TYPE_ACCESS) rsync_acl_fake_perms(racl, mode); @@ -631,7 +630,6 @@ static void send_rsync_acl(rsync_acl *racl, SMB_ACL_TYPE_T type, * This also frees the ACL data. */ void send_acl(statx *sxp, int f) { - if (!sxp->acc_acl) { sxp->acc_acl = create_racl(); rsync_acl_fake_perms(sxp->acc_acl, sxp->st.st_mode); @@ -719,7 +717,7 @@ static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f) if (ndx < 0 || (size_t)ndx > racl_list->count) { rprintf(FERROR, "recv_acl_index: %s ACL index %d > %d\n", - str_acl_type(type), ndx, racl_list->count); + str_acl_type(type), ndx, (int)racl_list->count); exit_cleanup(RERR_STREAMIO); } @@ -1044,7 +1042,9 @@ int default_perms_for_dir(const char *dir) if (sacl == NULL) { /* Couldn't get an ACL. Darn. */ switch (errno) { +#ifdef ENOTSUP case ENOTSUP: +#endif case ENOSYS: /* No ACLs are available. */ break;