From e9166d27bf3fa80b7c85b07dad0f9add21579728 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 7 Feb 2011 18:15:57 +0100 Subject: [PATCH] Check if resource name is valid in acl_access_ok() --- bacula/src/dird/ua_acl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bacula/src/dird/ua_acl.c b/bacula/src/dird/ua_acl.c index 4834d5b814..1a386fd75b 100644 --- a/bacula/src/dird/ua_acl.c +++ b/bacula/src/dird/ua_acl.c @@ -49,6 +49,11 @@ bool acl_access_ok(UAContext *ua, int acl, const char *item) /* This version expects the length of the item which we must check. */ bool acl_access_ok(UAContext *ua, int acl, const char *item, int len) { + /* The resource name contains nasty characters */ + if (acl != Where_ACL && !is_name_valid(item, NULL)) { + Dmsg1(1400, "Access denied for item=%s\n", item); + return false; + } /* If no console resource => default console and all is permitted */ if (!ua->cons) { -- 2.39.5