From 708f0bf0076c4285fa5a4beb57d10854659d5da0 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Thu, 16 Dec 2010 19:48:11 +0100 Subject: [PATCH] Add missing switch values although the code works this is cleaner. Give better error when trying to restore a particular type of acl on a filesystem without support for those types of acls. --- bacula/src/filed/acl.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 4a5547b0dc..36491891d4 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -881,6 +881,8 @@ static bacl_exit_code freebsd_build_acl_streams(JCR *jcr, FF_PKT *ff_pkt) jcr->last_fname, be.bstrerror()); return bacl_exit_error; } + case 0: + break; default: acltype = BACL_TYPE_NFS4; break; @@ -904,6 +906,8 @@ static bacl_exit_code freebsd_build_acl_streams(JCR *jcr, FF_PKT *ff_pkt) jcr->last_fname, be.bstrerror()); return bacl_exit_error; } + case 0: + break; default: acltype = BACL_TYPE_ACCESS; break; @@ -973,6 +977,7 @@ static bacl_exit_code freebsd_build_acl_streams(JCR *jcr, FF_PKT *ff_pkt) static bacl_exit_code freebsd_parse_acl_streams(JCR *jcr, int stream) { int acl_enabled = 0; + char *acl_type_name; berrno be; /** @@ -984,21 +989,20 @@ static bacl_exit_code freebsd_parse_acl_streams(JCR *jcr, int stream) case STREAM_UNIX_DEFAULT_ACL: case STREAM_ACL_FREEBSD_DEFAULT_ACL: acl_enabled = pathconf(jcr->last_fname, _PC_ACL_EXTENDED); + acl_type_name = "POSIX"; break; case STREAM_ACL_FREEBSD_NFS4_ACL: #if defined(_PC_ACL_NFS4) acl_enabled = pathconf(jcr->last_fname, _PC_ACL_NFS4); #endif + acl_type_name = "NFS4"; break; default: + acl_type_name = "unknown"; break; } switch (acl_enabled) { - case 0: - Mmsg1(jcr->errmsg, _("Trying to restore acl on file \"%s\" on filesystem without acl support\n"), - jcr->last_fname); - return bacl_exit_error; case -1: switch (errno) { case ENOENT: @@ -1010,6 +1014,12 @@ static bacl_exit_code freebsd_parse_acl_streams(JCR *jcr, int stream) jcr->acl_data->content, jcr->last_fname, be.bstrerror()); return bacl_exit_error; } + case 0: + Mmsg1(jcr->errmsg, _("Trying to restore acl on file \"%s\" on filesystem without %s acl support\n"), + jcr->last_fname, acl_type_name); + return bacl_exit_error; + default: + break; } /** -- 2.39.5