diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2012-09-18 12:01:46 +0200 |
---|---|---|
committer | Martin Kletzander <mkletzan@redhat.com> | 2012-09-18 16:41:20 +0200 |
commit | 54106114a4b2b0261fedc9235e986656d61d80ef (patch) | |
tree | 460e8a52291767096ddff85edb6fd9d618357483 | |
parent | virNetDevBandwidthClear: Improve error handling (diff) | |
download | libvirt-54106114a4b2b0261fedc9235e986656d61d80ef.tar.gz libvirt-54106114a4b2b0261fedc9235e986656d61d80ef.tar.bz2 libvirt-54106114a4b2b0261fedc9235e986656d61d80ef.zip |
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
-rw-r--r-- | src/secret/secret_driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 2ad66dd3e..67c7323b1 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -1,7 +1,7 @@ /* * 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 * 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 && secret->def->private) { - virReportError(VIR_ERR_OPERATION_DENIED, "%s", + virReportError(VIR_ERR_INVALID_SECRET, "%s", _("secret is private")); goto cleanup; } |