mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
tools: fix crash in virt-login-shell if config doesn't exist
If the 'allowed_users' config setting in virt-login-shell.conf does not exist, we dereference a NULL pointer resulting in a crash. We should check for this case and thus ensure the user is denied access gracefully. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
59a3b79506
commit
275bcbebab
@ -54,7 +54,7 @@ static int virLoginShellAllowedUser(virConfPtr conf,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
|
||||||
for (entries = users; *entries; entries++) {
|
for (entries = users; entries && *entries; entries++) {
|
||||||
char *entry = *entries;
|
char *entry = *entries;
|
||||||
/*
|
/*
|
||||||
If string begins with a % this indicates a linux group.
|
If string begins with a % this indicates a linux group.
|
||||||
|
Loading…
Reference in New Issue
Block a user