mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
add default mapping of credentials to machine
In the auth config file, it is currently required to have an entry for each hostname to connect to, eg [auth-libvirt-prod1.example.com] credentials=prod This is inconvenient when there are large numbers of machines all with the same credentials. Add support for a default entry: [auth-default] credentials=prod
This commit is contained in:
parent
3a9d1f3701
commit
743db933ed
@ -121,6 +121,13 @@ int virAuthConfigLookup(virAuthConfigPtr auth,
|
|||||||
if (virAsprintf(&authgroup, "auth-%s-%s", service, hostname) < 0)
|
if (virAsprintf(&authgroup, "auth-%s-%s", service, hostname) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!virKeyFileHasGroup(auth->keyfile, authgroup)) {
|
||||||
|
VIR_FREE(authgroup);
|
||||||
|
if (virAsprintf(&authgroup, "auth-%s-%s", service, "default") < 0){
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!virKeyFileHasGroup(auth->keyfile, authgroup)) {
|
if (!virKeyFileHasGroup(auth->keyfile, authgroup)) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user