mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +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;
|
||||
|
||||
|
||||
for (entries = users; *entries; entries++) {
|
||||
for (entries = users; entries && *entries; entries++) {
|
||||
char *entry = *entries;
|
||||
/*
|
||||
If string begins with a % this indicates a linux group.
|
||||
|
Loading…
Reference in New Issue
Block a user