]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply Preben's ACL patches
authorKern Sibbald <kern@sibbald.com>
Wed, 22 Dec 2004 20:43:47 +0000 (20:43 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 22 Dec 2004 20:43:47 +0000 (20:43 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1776 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_acl.c
bacula/src/dird/ua_run.c

index ce703940754c9b8e14b4993225c6f1f9b2ef79b6..2cd63618bcb4e8fbaac7e3540d70abb2dc8ff0cc 100644 (file)
@@ -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; i<list->size(); 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;
       }
    }
index 94dfb2d937016efe685a996be7dca2e58753edc0..f9e61a47bde0a6af6943a449a066d43abf3550fe 100644 (file)
@@ -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;