From: Kern Sibbald Date: Wed, 22 Dec 2004 20:43:47 +0000 (+0000) Subject: Apply Preben's ACL patches X-Git-Tag: Release-1.38.0~688 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=659c12dc99b31d6e65c610230b341d48876be1c1;p=bacula%2Fbacula Apply Preben's ACL patches git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1776 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_acl.c b/bacula/src/dird/ua_acl.c index ce70394075..2cd63618bc 100644 --- a/bacula/src/dird/ua_acl.c +++ b/bacula/src/dird/ua_acl.c @@ -39,6 +39,7 @@ bool acl_access_ok(UAContext *ua, int acl, char *item) } +/* This version expects the length of the item which we must check. */ bool acl_access_ok(UAContext *ua, int acl, char *item, int len) { @@ -60,8 +61,8 @@ bool acl_access_ok(UAContext *ua, int acl, char *item, int len) /* Search list for item */ for (int i=0; isize(); i++) { - if (strncasecmp(item, (char *)list->get(i), len) == 0) { - Dmsg3(400, "Found %s in %d %s\n", item, acl, (char *)list->get(i)); + if (strcasecmp(item, (char *)list->get(i)) == 0) { + Dmsg3(400, "Found %s in %d %s\n", item, acl, (char *)list->get(i)); return true; } } diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 94dfb2d937..f9e61a47bd 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -331,7 +331,7 @@ int run_cmd(UAContext *ua, const char *cmd) } if (!pool) { return 0; - } else if (!acl_access_ok(ua, Pool_ACL, store->hdr.name)) { + } else if (!acl_access_ok(ua, Pool_ACL, pool->hdr.name)) { bsendmsg(ua, _("No authorization. Pool \"%s\".\n"), pool->hdr.name); return 0; @@ -351,7 +351,7 @@ int run_cmd(UAContext *ua, const char *cmd) } if (!client) { return 0; - } else if (!acl_access_ok(ua, Client_ACL, store->hdr.name)) { + } else if (!acl_access_ok(ua, Client_ACL, client->hdr.name)) { bsendmsg(ua, _("No authorization. Client \"%s\".\n"), client->hdr.name); return 0; @@ -369,7 +369,7 @@ int run_cmd(UAContext *ua, const char *cmd) } if (!fileset) { return 0; - } else if (!acl_access_ok(ua, FileSet_ACL, store->hdr.name)) { + } else if (!acl_access_ok(ua, FileSet_ACL, fileset->hdr.name)) { bsendmsg(ua, _("No authorization. FileSet \"%s\".\n"), fileset->hdr.name); return 0;