}
+/* This version expects the length of the item which we must check. */
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;
}
}
}
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;
}
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;
}
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;