Skip to content

Commit

Permalink
authz-pam: Check that 'service' property is set
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Daniel P. Berrangé <[email protected]>
  • Loading branch information
kevmw authored and berrange committed Nov 18, 2020
1 parent 8e26ae7 commit 3428455
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions authz/pamacct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}


Expand Down

0 comments on commit 3428455

Please sign in to comment.