From: Marco van Wieringen Date: Thu, 15 Sep 2011 20:39:18 +0000 (+0200) Subject: As it seems Linux doesn't comply to its own manpages. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=982965ab9731f9c03056bc884e7913ba59a1e7b7;p=bacula%2Fbacula As it seems Linux doesn't comply to its own manpages. It seems that xattr functions return EOPNOTSUPP as errno and not ENOTSUP as they are supposed todo. As both errno are POSIX anyway we allow both. EOPNOTSUPP is only valid as error on sockets but hey who cares about standard like POSIX. --- diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index cfe2c64be3..ed2f5766fc 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -755,6 +755,12 @@ static bacl_exit_code generic_set_acl_on_os(JCR *jcr, bacl_type acltype) switch (errno) { case ENOENT: return bacl_exit_ok; +#if defined(BACL_ENOTSUP) + case BACL_ENOTSUP: + Mmsg1(jcr->errmsg, _("acl_delete_def_file error on file \"%s\": filesystem doesn't support ACLs\n"), + jcr->last_fname); + return bacl_exit_ok; +#endif default: Mmsg2(jcr->errmsg, _("acl_delete_def_file error on file \"%s\": ERR=%s\n"), jcr->last_fname, be.bstrerror()); @@ -797,6 +803,15 @@ static bacl_exit_code generic_set_acl_on_os(JCR *jcr, bacl_type acltype) case ENOENT: acl_free(acl); return bacl_exit_ok; +#if defined(BACL_ENOTSUP) + case BACL_ENOTSUP: + Mmsg1(jcr->errmsg, _("acl_set_file error on file \"%s\": filesystem doesn't support ACLs\n"), + jcr->last_fname); + Dmsg2(100, "acl_set_file error acl=%s file=%s filesystem doesn't support ACLs\n", + jcr->acl_data->content, jcr->last_fname); + acl_free(acl); + return bacl_exit_ok; +#endif default: Mmsg2(jcr->errmsg, _("acl_set_file error on file \"%s\": ERR=%s\n"), jcr->last_fname, be.bstrerror()); diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index 5af66a3277..160674d81f 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -967,6 +967,7 @@ static bxattr_exit_code generic_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) switch (errno) { case ENOENT: case ENOTSUP: + case EOPNOTSUPP: return bxattr_exit_ok; default: Mmsg2(jcr->errmsg, _("llistxattr error on file \"%s\": ERR=%s\n"), @@ -997,6 +998,7 @@ static bxattr_exit_code generic_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) switch (errno) { case ENOENT: case ENOTSUP: + case EOPNOTSUPP: retval = bxattr_exit_ok; goto bail_out; default: @@ -1078,6 +1080,7 @@ static bxattr_exit_code generic_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) switch (errno) { case ENOENT: case ENOTSUP: + case EOPNOTSUPP: retval = bxattr_exit_ok; goto bail_out; default: @@ -1105,6 +1108,7 @@ static bxattr_exit_code generic_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt) switch (errno) { case ENOENT: case ENOTSUP: + case EOPNOTSUPP: retval = bxattr_exit_ok; goto bail_out; default: @@ -1205,6 +1209,7 @@ static bxattr_exit_code generic_xattr_parse_streams(JCR *jcr, int stream) switch (errno) { case ENOENT: case ENOTSUP: + case EOPNOTSUPP: goto bail_out; default: Mmsg2(jcr->errmsg, _("lsetxattr error on file \"%s\": ERR=%s\n"),