mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
secret: Fix error for private secrets
When trying to get the value of a private secret, the code used 'operation denied' error. That error is specified as a error for read-only connections trying to perform denied operation. The following error seems more accurate. To compare the difference: - BEFORE error: operation secret is private forbidden for read only access - AFTER error: Invalid secret: secret is private
This commit is contained in:
parent
2f678bb10f
commit
54106114a4
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* secret_driver.c: local driver for secret manipulation API
|
* secret_driver.c: local driver for secret manipulation API
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 Red Hat, Inc.
|
* Copyright (C) 2009-2012 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -990,7 +990,7 @@ secretGetValue(virSecretPtr obj, size_t *value_size, unsigned int flags,
|
|||||||
|
|
||||||
if ((internalFlags & VIR_SECRET_GET_VALUE_INTERNAL_CALL) == 0 &&
|
if ((internalFlags & VIR_SECRET_GET_VALUE_INTERNAL_CALL) == 0 &&
|
||||||
secret->def->private) {
|
secret->def->private) {
|
||||||
virReportError(VIR_ERR_OPERATION_DENIED, "%s",
|
virReportError(VIR_ERR_INVALID_SECRET, "%s",
|
||||||
_("secret is private"));
|
_("secret is private"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user