From fc3991a9aacfda2f60ab608d3e46b0952b643c96 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 22 Sep 2015 15:50:29 +0200 Subject: [PATCH] Fix compilation problem with AFS --- bacula/src/filed/acl.c | 4 ++-- bacula/src/findlib/fstype.c | 9 +++++++++ bacula/src/findlib/protos.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 916ee694d7..ef1ae801ed 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -2027,7 +2027,7 @@ bool backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) * AFS is a non OS specific filesystem so see if this path is on an AFS filesystem * Set the BACL_FLAG_SAVE_AFS flag if it is. If not set the BACL_FLAG_SAVE_NATIVE flag. */ - if (fstype_equals(jcr->last_fname, "afs")) { + if (fstype_cmp(ff_pkt, "afs")) { jcr->acl_ctx->flags |= BACL_FLAG_SAVE_AFS; } else { jcr->acl_ctx->flags |= BACL_FLAG_SAVE_NATIVE; @@ -2128,7 +2128,7 @@ bacl_rtn_code restore_acl_streams(JCR *jcr, int stream, * AFS is a non OS specific filesystem so see if this path is on an AFS filesystem * Set the BACL_FLAG_RESTORE_AFS flag if it is. If not set the BACL_FLAG_RETORE_NATIVE flag. */ - if (fstype_equals(jcr->last_fname, "afs")) { + if (fstype_cmp(ff_pkt, "afs")) { jcr->acl_ctx->flags |= BACL_FLAG_RESTORE_AFS; } else { jcr->acl_ctx->flags |= BACL_FLAG_RESTORE_NATIVE; diff --git a/bacula/src/findlib/fstype.c b/bacula/src/findlib/fstype.c index 5e92fb8ea5..55ac70a03f 100644 --- a/bacula/src/findlib/fstype.c +++ b/bacula/src/findlib/fstype.c @@ -86,6 +86,15 @@ void add_mtab_item(void *user_ctx, struct stat *st, const char *fstype, } } +/* Compare directly the FS from a fname with a string */ +bool fstype_cmp(FF_PKT *ff_pkt, const char fsname) +{ + char buf[256]; + if (fstype(ff_pkt, buf, sizeof(buf))) { + return (strcmp(buf, fsname) == 0); + } + return false; +} /* * These functions should be implemented for each OS diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h index 7291ee82d8..12514ada0d 100644 --- a/bacula/src/findlib/protos.h +++ b/bacula/src/findlib/protos.h @@ -81,7 +81,7 @@ bool path_list_add(JCR *jcr, uint32_t len, char *fname); /* from fstype.c */ bool fstype(FF_PKT *ff_pkt, char *fs, int fslen); -bool fstype_equals(const char *fname, const char *fstype_name); +bool fstype_cmp(FF_PKT *ff_pkt, const char *fstype_name); /* from drivetype.c */ bool drivetype(const char *fname, char *fs, int fslen); -- 2.39.2