From: Eric Bollengier Date: Mon, 7 Feb 2011 17:15:57 +0000 (+0100) Subject: Check if resource name is valid in acl_access_ok() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=21c02544334d4461705e4c01b454a56ed5308819;p=bacula%2Fbacula Check if resource name is valid in acl_access_ok() --- 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) {