aboutsummaryrefslogtreecommitdiff
path: root/authz/simple.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-11-18 13:42:42 +0000
committerPeter Maydell <peter.maydell@linaro.org>2020-11-18 13:42:42 +0000
commitb696f2c6ba8c92ffb5eca49b88a5c7276d0a3e1e (patch)
tree900a9ec3287e23ade7d1826e4cc7253dbfd10e9b /authz/simple.c
parent269ff671c593379378c5cf5ea3bddd7909dd3333 (diff)
parentc2aa8a3d7e5ce57fa3df310c9b7ca48fcbf9d4ad (diff)
downloadqemu-b696f2c6ba8c92ffb5eca49b88a5c7276d0a3e1e.zip
qemu-b696f2c6ba8c92ffb5eca49b88a5c7276d0a3e1e.tar.gz
qemu-b696f2c6ba8c92ffb5eca49b88a5c7276d0a3e1e.tar.bz2
Merge remote-tracking branch 'remotes/berrange-gitlab/tags/misc-fixes-pull-request' into staging
Misc error reporting and checking fixes to authorization objects # gpg: Signature made Wed 18 Nov 2020 12:48:53 GMT # gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full] # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full] # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange-gitlab/tags/misc-fixes-pull-request: authz-simple: Check that 'identity' property is set authz-pam: Check that 'service' property is set authz-list-file: Improve an error message authz-list-file: Fix file read error handling Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'authz/simple.c')
-rw-r--r--authz/simple.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/authz/simple.c b/authz/simple.c
index 18db035..0597dcd 100644
--- a/authz/simple.c
+++ b/authz/simple.c
@@ -66,10 +66,24 @@ qauthz_simple_finalize(Object *obj)
static void
+qauthz_simple_complete(UserCreatable *uc, Error **errp)
+{
+ QAuthZSimple *sauthz = QAUTHZ_SIMPLE(uc);
+
+ if (!sauthz->identity) {
+ error_setg(errp, "The 'identity' property must be set");
+ return;
+ }
+}
+
+
+static void
qauthz_simple_class_init(ObjectClass *oc, void *data)
{
QAuthZClass *authz = QAUTHZ_CLASS(oc);
+ UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
+ ucc->complete = qauthz_simple_complete;
authz->is_allowed = qauthz_simple_is_allowed;
object_class_property_add_str(oc, "identity",