From: Marco van Wieringen Date: Sat, 26 Dec 2009 10:22:26 +0000 (+0100) Subject: Added some handling of EPERM and EOPNOTSUPP which seem to be returned when you try to X-Git-Tag: Release-5.0.0~119^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ccb15cdffedef8460c616e1857102bc23ae1300c;p=bacula%2Fbacula Added some handling of EPERM and EOPNOTSUPP which seem to be returned when you try to retrieve the system extended attributes a non root user. --- diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index ae25def26b..2611c7a626 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -676,6 +676,10 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) /* * First get the length of the available list with extended attributes. + * If we get EPERM on system namespace, don't return error. + * This is expected for normal users trying to archive the system + * namespace on FreeBSD 6.2 and later. On NetBSD 3.1 and later, + * they've decided to return EOPNOTSUPP instead. */ xattr_list_len = extattr_list_link(jcr->last_fname, attrnamespace, NULL, 0); if (xattr_list_len < 0) { @@ -683,6 +687,18 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) case ENOENT: retval = bxattr_exit_ok; goto bail_out; +#if defined(EOPNOTSUPP) + case EOPNOTSUPP: +#endif + case EPERM: + if (attrnamespace == EXTATTR_NAMESPACE_SYSTEM) { + actuallyfree(current_attrnamespace); + current_attrnamespace = NULL; + continue; + } + /* + * FALLTHROUGH + */ default: Mmsg2(jcr->errmsg, _("extattr_list_link error on file \"%s\": ERR=%s\n"), jcr->last_fname, be.bstrerror());