Skip to content

Commit 3428455

Browse files
kevmwberrange
authored andcommitted
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 <[email protected]> Signed-off-by: Daniel P. Berrangé <[email protected]>
1 parent 8e26ae7 commit 3428455

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

authz/pamacct.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ qauthz_pam_prop_get_service(Object *obj,
8484
static void
8585
qauthz_pam_complete(UserCreatable *uc, Error **errp)
8686
{
87+
QAuthZPAM *pauthz = QAUTHZ_PAM(uc);
88+
89+
if (!pauthz->service) {
90+
error_setg(errp, "The 'service' property must be set");
91+
return;
92+
}
8793
}
8894

8995

0 commit comments

Comments
 (0)