summaryrefslogtreecommitdiffstats
path: root/authz
diff options
context:
space:
mode:
authorKevin Wolf2020-11-17 17:30:44 +0100
committerDaniel P. Berrangé2020-11-18 11:51:35 +0100
commit3428455df9302b2b924e380cb90a77ca1ce5001e (patch)
treeee82f874bae66e84b9c908e738c718f1b9f77c86 /authz
parentauthz-list-file: Improve an error message (diff)
downloadqemu-3428455df9302b2b924e380cb90a77ca1ce5001e.tar.gz
qemu-3428455df9302b2b924e380cb90a77ca1ce5001e.tar.xz
qemu-3428455df9302b2b924e380cb90a77ca1ce5001e.zip
authz-pam: Check that 'service' property is set
If the 'service' property is not set, we'll call pam_start() with a NULL pointer for the service name. This fails and leaves a message like this in the syslog: qemu-storage-daemon[294015]: PAM pam_start: invalid argument: service == NULL Make specifying the property mandatory and catch the error already during the creation of the object. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'authz')
-rw-r--r--authz/pamacct.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/authz/pamacct.c b/authz/pamacct.c
index e67195f7be..c862d9ff39 100644
--- a/authz/pamacct.c
+++ b/authz/pamacct.c
@@ -84,6 +84,12 @@ qauthz_pam_prop_get_service(Object *obj,
static void
qauthz_pam_complete(UserCreatable *uc, Error **errp)
{
+ QAuthZPAM *pauthz = QAUTHZ_PAM(uc);
+
+ if (!pauthz->service) {
+ error_setg(errp, "The 'service' property must be set");
+ return;
+ }
}