static bacl_exit_code aix_build_acl_streams(JCR *jcr, FF_PKT *ff_pkt)
{
- berrno be;
mode_t mode;
acl_type_t type;
size_t aclsize, acltxtsize;
memset(&type, 0, sizeof(acl_type_t));
type.u64 = ACL_ANY;
if (aclx_get(jcr->last_fname, GET_ACLINFO_ONLY, &type, NULL, &aclsize, &mode) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bacl_exit_ok;
* Retrieve the ACL info.
*/
if (aclx_get(jcr->last_fname, 0, &type, aclbuf, &aclsize, &mode) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bacl_exit_ok;
uint32_t content_length)
{
int cnt;
- berrno be;
acl_type_t type;
size_t aclsize;
bacl_exit_code retval = bacl_exit_error;
aclbuf = check_pool_memory_size(aclbuf, content_length);
aclsize = content_length;
if (aclx_scanStr(content, aclbuf, &aclsize, type) < 0) {
+ berrno be;
+
switch (errno) {
case ENOSPC:
/*
default:
Mmsg2(jcr->errmsg,
_("aclx_scanStr error on file \"%s\": ERR=%s\n"),
- jcr->last_fname, be.bstrerror());
+ jcr->last_fname, be.bstrerror(errno));
Dmsg2(100, "aclx_scanStr error file=%s ERR=%s\n",
jcr->last_fname, be.bstrerror());
goto bail_out;
}
if (aclx_put(jcr->last_fname, SET_ACL, type, aclbuf, aclsize, 0) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bacl_exit_ok;
acl_t acl;
acl_type_t ostype;
char *acl_text;
- berrno be;
bacl_exit_code retval = bacl_exit_ok;
ostype = bac_to_os_acltype(acltype);
return bacl_exit_ok;
}
+ berrno be;
Mmsg2(jcr->errmsg,
_("acl_to_text error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
retval = bacl_exit_error;
goto bail_out;
} else {
+ berrno be;
+
/*
* Handle errors gracefully.
*/
{
acl_t acl;
acl_type_t ostype;
- berrno be;
/*
* If we get empty default ACLs, clear ACLs now
if (acl_delete_def_file(jcr->last_fname) == 0) {
return bacl_exit_ok;
}
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
acl = acl_from_text(content);
if (acl == NULL) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("acl_from_text error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
* As it does the right thing, given valid input, just ignore acl_valid().
*/
if (acl_valid(acl) != 0) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("acl_valid error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
* don't save acls of symlinks (which cannot have acls anyhow)
*/
if (acl_set_file(jcr->last_fname, ostype, acl) != 0 && jcr->last_type != FT_LNK) {
+ berrno be;
+
switch (errno) {
case ENOENT:
acl_free(acl);
{
int acl_enabled = 0;
bacl_type acltype = BACL_TYPE_NONE;
- berrno be;
#if defined(_PC_ACL_NFS4)
/*
*/
acl_enabled = pathconf(jcr->last_fname, _PC_ACL_NFS4);
switch (acl_enabled) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
jcr->last_fname, be.bstrerror());
return bacl_exit_error;
}
+ }
case 0:
break;
default:
*/
acl_enabled = pathconf(jcr->last_fname, _PC_ACL_EXTENDED);
switch (acl_enabled) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
jcr->last_fname, be.bstrerror());
return bacl_exit_error;
}
+ }
case 0:
break;
default:
{
int acl_enabled = 0;
const char *acl_type_name;
- berrno be;
/*
* First make sure the filesystem supports acls.
}
switch (acl_enabled) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
content, jcr->last_fname, be.bstrerror());
return bacl_exit_error;
}
+ }
case 0:
/*
* If the filesystem reports it doesn't support ACLs we clear the
int n;
struct acl_entry acls[NACLENTRIES];
char *acl_text;
- berrno be;
if ((n = getacl(jcr->last_fname, 0, acls)) < 0) {
+ berrno be;
+
switch (errno) {
#if defined(BACL_ENOTSUP)
case BACL_ENOTSUP:
return send_acl_stream(jcr, STREAM_ACL_HPUX_ACL_ENTRY);
}
+
+ berrno be;
Mmsg2(jcr->errmsg,
_("acltostr error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
{
int n, stat;
struct acl_entry acls[NACLENTRIES];
- berrno be;
n = strtoacl(content, 0, NACLENTRIES, acls, ACL_FILEOWNER, ACL_FILEGROUP);
if (n <= 0) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("strtoacl error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
return bacl_exit_error;
}
if (strtoacl(content, n, NACLENTRIES, acls, ACL_FILEOWNER, ACL_FILEGROUP) != n) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("strtoacl error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
* This is only true for the old acl streams as in the new implementation we
* don't save acls of symlinks (which cannot have acls anyhow)
*/
- if (setacl(jcr->last_fname, n, acls) != 0 &&
- jcr->last_type != FT_LNK) {
+ if (setacl(jcr->last_fname, n, acls) != 0 && jcr->last_type != FT_LNK) {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
acl_t *aclp;
char *acl_text;
bacl_exit_code stream_status = bacl_exit_error;
- berrno be;
/*
* See if filesystem supports acls.
pm_strcpy(jcr->acl_data->u.build->content, "");
jcr->acl_data->u.build->content_length = 0;
return bacl_exit_ok;
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
jcr->last_fname, be.bstrerror());
return bacl_exit_error;
}
+ }
default:
break;
}
* Get ACL info: don't bother allocating space if there is only a trivial ACL.
*/
if (acl_get(jcr->last_fname, ACL_NO_TRIVIAL, &aclp) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
{
acl_t *aclp;
int acl_enabled, error;
- berrno be;
switch (stream) {
case STREAM_UNIX_ACCESS_ACL:
_("Trying to restore acl on file \"%s\" on filesystem without acl support\n"),
jcr->last_fname);
return bacl_exit_error;
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
content, jcr->last_fname, be.bstrerror());
return bacl_exit_error;
}
+ }
default:
/*
* On a filesystem with ACL support make sure this particular ACL type can be restored.
int n;
aclent_t *acls;
char *acl_text;
- berrno be;
n = acl(jcr->last_fname, GETACLCNT, 0, NULL);
if (n < MIN_ACL_ENTRIES)
return send_acl_stream(jcr, STREAM_ACL_SOLARIS_ACLENT);
}
+ berrno be;
Mmsg2(jcr->errmsg,
_("acltotext error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
{
int n;
aclent_t *acls;
- berrno be;
acls = aclfromtext(content, &n);
if (!acls) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("aclfromtext error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
* 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;
+
switch (errno) {
case ENOENT:
actuallyfree(acls);
uint32_t content_length)
{
int ret;
- berrno be;
struct stat st;
unsigned int cnt;
*/
ret = lstat(jcr->last_fname, &st);
switch (ret) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bacl_exit_ok;
return bacl_exit_error;
}
break;
+ }
case 0:
break;
}
xattr_t *current_xattr = NULL;
alist *xattr_value_list = NULL;
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
/*
* First get the length of the available list with extended attributes.
*/
xattr_list_len = llistea(jcr->last_fname, NULL, 0);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
case EFORMAT:
return bxattr_exit_error;
}
break;
+ }
case 0:
return bxattr_exit_ok;
default:
*/
xattr_list_len = llistea(jcr->last_fname, xattr_list, xattr_list_len);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
case EFORMAT:
goto bail_out;
}
break;
+ }
default:
break;
}
*/
xattr_value_len = lgetea(jcr->last_fname, bp, NULL, 0);
switch (xattr_value_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
case EFORMAT:
goto bail_out;
}
break;
+ }
case 0:
current_xattr->value = NULL;
current_xattr->value_length = 0;
xattr_value_len = lgetea(jcr->last_fname, bp, current_xattr->value, xattr_value_len);
if (xattr_value_len < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
case EFORMAT:
{
xattr_t *current_xattr;
alist *xattr_value_list;
- berrno be;
xattr_value_list = New(alist(10, not_owned_by_alist));
current_xattr->name,
current_xattr->value,
current_xattr->value_length, 0) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
case EFORMAT:
uint32_t expected_serialize_len = 0;
bxattr_exit_code retval = bxattr_exit_error;
POOLMEM *xattrbuf = get_memory(ATTR_MAX_VALUELEN);
- berrno be;
for (cnt = 0; xattr_naming_spaces[cnt].name != NULL; cnt++) {
memset(&cursor, 0, sizeof(attrlist_cursor_t));
while (1) {
if (attr_list(jcr->last_fname, xattrbuf, ATTR_MAX_VALUELEN,
xattr_naming_spaces[cnt].flags, &cursor) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
*/
if (attr_get(jcr->last_fname, attrlist_ent->a_name, current_xattr->value,
&length, xattr_naming_spaces[cnt].flags) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
case ENOATTR:
default:
Mmsg2(jcr->errmsg,
_("attr_list error on file \"%s\": ERR=%s\n"),
- jcr->last_fname, be.bstrerror());
+ jcr->last_fname, be.bstrerror(errno));
Dmsg2(100, "attr_list error file=%s ERR=%s\n",
jcr->last_fname, be.bstrerror());
goto bail_out;
xattr_t *current_xattr;
alist *xattr_value_list;
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
xattr_value_list = New(alist(10, not_owned_by_alist));
bp = strchr(current_xattr->name, '.');
if (attr_set(jcr->last_fname, ++bp, current_xattr->value,
current_xattr->value_length, flags) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
default:
Mmsg2(jcr->errmsg,
_("attr_set error on file \"%s\": ERR=%s\n"),
- jcr->last_fname, be.bstrerror());
+ jcr->last_fname, be.bstrerror(errno));
Dmsg2(100, "attr_set error file=%s ERR=%s\n",
jcr->last_fname, be.bstrerror());
goto bail_out;
xattr_t *current_xattr = NULL;
alist *xattr_value_list = NULL;
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
/*
* First get the length of the available list with extended attributes.
*/
xattr_list_len = llistxattr(jcr->last_fname, NULL, 0);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bxattr_exit_ok;
return bxattr_exit_error;
}
break;
+ }
case 0:
return bxattr_exit_ok;
default:
*/
xattr_list_len = llistxattr(jcr->last_fname, xattr_list, xattr_list_len);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
goto bail_out;
}
break;
+ }
default:
break;
}
*/
xattr_value_len = lgetxattr(jcr->last_fname, bp, NULL, 0);
switch (xattr_value_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
goto bail_out;
}
break;
+ }
case 0:
current_xattr->value = NULL;
current_xattr->value_length = 0;
xattr_value_len = lgetxattr(jcr->last_fname, bp, current_xattr->value, xattr_value_len);
if (xattr_value_len < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
{
xattr_t *current_xattr;
alist *xattr_value_list;
- berrno be;
xattr_value_list = New(alist(10, not_owned_by_alist));
foreach_alist(current_xattr, xattr_value_list) {
if (lsetxattr(jcr->last_fname, current_xattr->name, current_xattr->value, current_xattr->value_length, 0) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
goto bail_out;
xattr_t *current_xattr = NULL;
alist *xattr_value_list = NULL;
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
/*
* Loop over all available xattr namespaces.
*/
xattr_list_len = extattr_list_link(jcr->last_fname, attrnamespace, NULL, 0);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
goto bail_out;
}
break;
+ }
case 0:
continue;
default:
xattr_list_len = extattr_list_link(jcr->last_fname, attrnamespace,
xattr_list, xattr_list_len);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
goto bail_out;
}
break;
+ }
default:
break;
}
xattr_value_len = extattr_get_link(jcr->last_fname, attrnamespace,
current_attrname, NULL, 0);
switch (xattr_value_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
goto bail_out;
}
break;
+ }
case 0:
current_xattr->value = NULL;
current_xattr->value_length = 0;
current_attrname, current_xattr->value,
xattr_value_len);
if (xattr_value_len < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
alist *xattr_value_list;
int current_attrnamespace, cnt;
char *attrnamespace, *attrname;
- berrno be;
xattr_value_list = New(alist(10, not_owned_by_alist));
cnt = extattr_set_link(jcr->last_fname, current_attrnamespace,
attrname, current_xattr->value, current_xattr->value_length);
if (cnt < 0 || cnt != (int)current_xattr->value_length) {
+ berrno be;
+
switch (errno) {
case ENOENT:
goto bail_out;
struct proplistname_args prop_args;
bxattr_exit_code retval = bxattr_exit_error;
POOLMEM *xattrbuf = get_pool_memory(PM_MESSAGE);
- berrno be;
xattrbuf_size = sizeof_pool_memory(xattrbuf);
xattrbuf_min_size = 0;
* See what xattr are available.
*/
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case EOPNOTSUPP:
/*
goto bail_out;
}
break;
+ }
case 0:
if (xattrbuf_min_size) {
/*
xattr_list_len = getproplist(jcr->last_fname, 1, &prop_args, xattrbuf_size,
xattrbuf, &xattrbuf_min_size);
switch (xattr_list_len) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
default:
Mmsg2(jcr->errmsg,
goto bail_out;
}
break;
+ }
case 0:
/*
* This should never happen as we sized the buffer according to the minimumsize
xattr_t *current_xattr;
alist *xattr_value_list;
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
xattr_value_list = New(alist(10, not_owned_by_alist));
*/
cnt = setproplist(jcr->last_fname, 1, xattrbuf_size, xattrbuf);
switch (cnt) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case EOPNOTSUPP:
/*
goto bail_out;
}
break;
+ }
default:
break;
}
#ifdef HAVE_EXTENDED_ACL
int flags;
acl_t *aclp = NULL;
- berrno be;
/*
* See if this attribute has an ACL
*/
if ((fd != -1 && facl_get(fd, ACL_NO_TRIVIAL, &aclp) != 0) ||
acl_get(attrname, ACL_NO_TRIVIAL, &aclp) != 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bxattr_exit_ok;
#else /* HAVE_EXTENDED_ACL */
int n;
aclent_t *acls = NULL;
- berrno be;
/*
* See if this attribute has an ACL
acls = (aclent_t *)malloc(n * sizeof(aclent_t));
if ((fd != -1 && facl(fd, GETACL, n, acls) != n) ||
acl(attrname, GETACL, n, acls) != n) {
+ berrno be;
+
switch (errno) {
case ENOENT:
free(acls);
*/
if (!acl_is_trivial(n, acls)) {
if ((*acl_text = acltotext(acls, n)) == NULL) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to get acl text on xattr %s on file \"%s\": ERR=%s\n"),
attrname, jcr->last_fname, be.bstrerror());
char attribs[MAXSTRING];
char buffer[XATTR_BUFSIZ];
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
bsnprintf(target_attrname, sizeof(target_attrname), "%s%s", xattr_namespace, attrname);
* Get the stats of the extended or extensible attribute.
*/
if (fstatat(fd, attrname, &st, AT_SYMLINK_NOFOLLOW) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
* Open the extended or extensible attribute file.
*/
if ((attrfd = openat(fd, attrname, O_RDONLY)) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
* Encode the stat struct into an ASCII representation.
*/
if (readlink(attrname, link_source, sizeof(link_source)) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
* The recursive call could change our working dir so change back to the wanted workdir.
*/
if (fchdir(fd) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
struct dirent *dp;
char current_xattr_namespace[PATH_MAX];
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
/*
* Determine what argument to use. Use attr_parent when set
* Open the file on which to save the xattrs read-only.
*/
if ((filefd = open(name, O_RDONLY | O_NONBLOCK)) < 0) {
+ berrno be;
+
switch (errno) {
case ENOENT:
retval = bxattr_exit_ok;
* Open the xattr naming space.
*/
if ((attrdirfd = openat(filefd, ".", O_RDONLY | O_XATTR)) < 0) {
+ berrno be;
+
switch (errno) {
case EINVAL:
/*
* attributes should be saved.
*/
if (fchdir(attrdirfd) < 0) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("Unable to chdir to xattr space on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
if ((fd = dup(attrdirfd)) == -1 ||
(dirp = fdopendir(fd)) == (DIR *)NULL) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("Unable to list the xattr space on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
#ifdef HAVE_EXTENDED_ACL
int error;
acl_t *aclp = NULL;
- berrno be;
if ((error = acl_fromtext(acl_text, &aclp)) != 0) {
Mmsg1(jcr->errmsg,
if ((fd != -1 && facl_set(fd, aclp) != 0) ||
acl_set(attrname, aclp) != 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to restore acl of xattr %s on file \"%s\": ERR=%s\n"),
attrname, jcr->last_fname, be.bstrerror());
#else /* HAVE_EXTENDED_ACL */
int n;
aclent_t *acls = NULL;
- berrno be;
acls = aclfromtext(acl_text, &n);
if (!acls) {
if ((fd != -1 && facl(fd, SETACL, n, acls) != 0) ||
acl(attrname, SETACL, n, acls) != 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to restore acl of xattr %s on file \"%s\": ERR=%s\n"),
attrname, jcr->last_fname, be.bstrerror());
struct stat st;
struct timeval times[2];
bxattr_exit_code retval = bxattr_exit_error;
- berrno be;
/*
* Parse the xattr stream. First the part that is the same for all xattrs.
* Open the file on which to restore the xattrs read-only.
*/
if ((filefd = open(jcr->last_fname, O_RDONLY | O_NONBLOCK)) < 0) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("Unable to open file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
* Open the xattr naming space and make it the current working dir.
*/
if ((attrdirfd = openat(filefd, ".", O_RDONLY | O_XATTR)) < 0) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("Unable to open xattr space on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
}
if (fchdir(attrdirfd) < 0) {
+ berrno be;
+
Mmsg2(jcr->errmsg,
_("Unable to chdir to xattr space on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
*bp = '\0';
if ((fd = open(target_attrname, O_RDONLY | O_NONBLOCK)) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to open xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
* Open the xattr naming space.
*/
if ((fd = openat(filefd, ".", O_RDONLY | O_XATTR)) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to open xattr space %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
* Make the xattr space our current workingdir.
*/
if (fchdir(attrdirfd) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to chdir to xattr space %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
*/
unlinkat(attrdirfd, target_attrname, 0);
if (mkfifo(target_attrname, st.st_mode) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to mkfifo xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
*/
unlinkat(attrdirfd, target_attrname, 0);
if (mknod(target_attrname, st.st_mode, st.st_rdev) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to mknod xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
if (!bstrcmp(target_attrname, ".")) {
unlinkat(attrdirfd, target_attrname, AT_REMOVEDIR);
if (mkdir(target_attrname, st.st_mode) < 0) {
+ berrno be;
+
Jmsg3(jcr, M_WARNING, 0, _("Unable to mkdir xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
Dmsg3(100, "Unable to mkdir xattr %s on file \"%s\": ERR=%s\n",
unlinkat(attrdirfd, target_attrname, 0);
if (link(linked_target, target_attrname) < 0) {
+ berrno be;
+
Mmsg4(jcr->errmsg,
_("Unable to link xattr %s to %s on file \"%s\": ERR=%s\n"),
target_attrname, linked_target, jcr->last_fname, be.bstrerror());
}
if ((attrfd = openat(attrdirfd, target_attrname, O_RDWR | O_CREAT | O_TRUNC, st.st_mode)) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to open xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
while (cnt > 0) {
cnt = write(attrfd, data, cnt);
if (cnt < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to restore data of xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
linked_target = bp;
if (symlink(linked_target, target_attrname) < 0) {
+ berrno be;
+
Mmsg4(jcr->errmsg,
_("Unable to symlink xattr %s to %s on file \"%s\": ERR=%s\n"),
target_attrname, linked_target, jcr->last_fname, be.bstrerror());
*/
if (!is_extensible) {
if (fchownat(attrdirfd, target_attrname, st.st_uid, st.st_gid, AT_SYMLINK_NOFOLLOW) < 0) {
+ berrno be;
+
switch (errno) {
case EINVAL:
/*
times[1].tv_usec = 0;
if (futimesat(attrdirfd, target_attrname, times) < 0) {
+ berrno be;
+
Mmsg3(jcr->errmsg,
_("Unable to restore filetimes of xattr %s on file \"%s\": ERR=%s\n"),
target_attrname, jcr->last_fname, be.bstrerror());
uint32_t content_length)
{
int ret;
- berrno be;
struct stat st;
unsigned int cnt;
*/
ret = lstat(jcr->last_fname, &st);
switch (ret) {
- case -1:
+ case -1: {
+ berrno be;
+
switch (errno) {
case ENOENT:
return bxattr_exit_ok;
return bxattr_exit_error;
}
break;
+ }
case 0:
break;
}