acl_free(acl_text);
return len;
}
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("acl_to_text error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "acl_to_text error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
acl_free(acl);
#ifndef HAVE_OSF1_OS /* BACL_ENOTSUP not defined for OSF1 */
} else if (errno == BACL_ENOTSUP) {
*/
#ifndef HAVE_FREEBSD_OS
if (acl_valid(acl) != 0) {
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("ac_valid error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "acl_valid error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
acl_free(acl);
return -1;
}
#endif
- if (acl_set_file(jcr->last_fname, ostype, acl) != 0) {
+ /*
+ * Restore the ACLs, but don't complain about links which really should
+ * not have attributes, and the file it is linked to may not yet be restored.
+ */
+ if (acl_set_file(jcr->last_fname, ostype, acl) != 0 && jcr->last_type != FT_LNK) {
berrno be;
Jmsg2(jcr, M_ERROR, 0, _("acl_set_file error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.strerror());
actuallyfree(acl_text);
return len;
}
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("acltostr error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "acltostr error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
+ return -1;
}
return -1;
}
n = strtoacl(jcr->acl_text, 0, NACLENTRIES, acls, ACL_FILEOWNER, ACL_FILEGROUP);
if (n <= 0) {
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("strtoacl error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "strtoacl error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
return -1;
}
if (strtoacl(jcr->acl_text, n, NACLENTRIES, acls, ACL_FILEOWNER, ACL_FILEGROUP) != n) {
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("strtoacl error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "strtoacl error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
return -1;
}
- if (setacl(jcr->last_fname, n, acls) != 0) {
+ /*
+ * Restore the ACLs, but don't complain about links which really should
+ * not have attributes, and the file it is linked to may not yet be restored.
+ */
+ if (setacl(jcr->last_fname, n, acls) != 0 && jcr->last_type != FT_LNK) {
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("setacl error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "setacl error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
return -1;
}
return 0;
free(acls);
return len;
}
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("acltotext error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "acltotext error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
}
free(acls);
return -1;
acls = aclfromtext(jcr->acl_text, &n);
if (!acls) {
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("aclfromtext error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "aclfromtext error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
return -1;
}
- if (acl(jcr->last_fname, SETACL, n, acls) == -1) {
+ /*
+ * Restore the ACLs, but don't complain about links which really should
+ * not have attributes, and the file it is linked to may not yet be restored.
+ */
+ if (acl(jcr->last_fname, SETACL, n, acls) == -1 && jcr->last_type != FT_LNK) {
+ berrno be;
+ Jmsg2(jcr, M_ERROR, 0, _("acl(SETACL) error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.strerror());
+ Dmsg3(100, "acl(SETACL) error acl=%s file=%s ERR=%s\n",
+ jcr->acl_text, jcr->last_fname, be.strerror());
actuallyfree(acls);
return -1;
}