mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
conf: Revert changes to add new secret type "passphrase"
Revert the remainder of commit id 'c84380106'
This commit is contained in:
parent
a6bab5c343
commit
dae3b96560
@ -224,10 +224,6 @@
|
||||
<td>secret_usage_target</td>
|
||||
<td>Name of the associated iSCSI target, if any</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>secret_usage_name</td>
|
||||
<td>Name of be associated passphrase secret, if any</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -36,7 +36,6 @@
|
||||
<ref name='usagevolume'/>
|
||||
<ref name='usageceph'/>
|
||||
<ref name='usageiscsi'/>
|
||||
<ref name='usagepassphrase'/>
|
||||
<!-- More choices later -->
|
||||
</choice>
|
||||
</element>
|
||||
@ -72,13 +71,4 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='usagepassphrase'>
|
||||
<attribute name='type'>
|
||||
<value>passphrase</value>
|
||||
</attribute>
|
||||
<element name='name'>
|
||||
<ref name='genericName'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
</grammar>
|
||||
|
@ -43,7 +43,6 @@ typedef enum {
|
||||
VIR_SECRET_USAGE_TYPE_VOLUME = 1,
|
||||
VIR_SECRET_USAGE_TYPE_CEPH = 2,
|
||||
VIR_SECRET_USAGE_TYPE_ISCSI = 3,
|
||||
VIR_SECRET_USAGE_TYPE_PASSPHRASE = 4,
|
||||
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_SECRET_USAGE_TYPE_LAST
|
||||
|
@ -338,19 +338,6 @@ virAccessDriverPolkitCheckSecret(virAccessManagerPtr manager,
|
||||
virAccessPermSecretTypeToString(perm),
|
||||
attrs);
|
||||
} break;
|
||||
case VIR_SECRET_USAGE_TYPE_PASSPHRASE: {
|
||||
const char *attrs[] = {
|
||||
"connect_driver", driverName,
|
||||
"secret_uuid", uuidstr,
|
||||
"secret_usage_name", secret->usage.name,
|
||||
NULL,
|
||||
};
|
||||
|
||||
return virAccessDriverPolkitCheck(manager,
|
||||
"secret",
|
||||
virAccessPermSecretTypeToString(perm),
|
||||
attrs);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "viralloc.h"
|
||||
#include "secret_conf.h"
|
||||
#include "virsecretobj.h"
|
||||
#include "virstring.h"
|
||||
#include "virerror.h"
|
||||
#include "virxml.h"
|
||||
#include "viruuid.h"
|
||||
@ -39,7 +38,7 @@
|
||||
VIR_LOG_INIT("conf.secret_conf");
|
||||
|
||||
VIR_ENUM_IMPL(virSecretUsage, VIR_SECRET_USAGE_TYPE_LAST,
|
||||
"none", "volume", "ceph", "iscsi", "passphrase")
|
||||
"none", "volume", "ceph", "iscsi")
|
||||
|
||||
const char *
|
||||
virSecretUsageIDForDef(virSecretDefPtr def)
|
||||
@ -57,9 +56,6 @@ virSecretUsageIDForDef(virSecretDefPtr def)
|
||||
case VIR_SECRET_USAGE_TYPE_ISCSI:
|
||||
return def->usage.target;
|
||||
|
||||
case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
|
||||
return def->usage.name;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@ -89,10 +85,6 @@ virSecretDefFree(virSecretDefPtr def)
|
||||
VIR_FREE(def->usage.target);
|
||||
break;
|
||||
|
||||
case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
|
||||
VIR_FREE(def->usage.name);
|
||||
break;
|
||||
|
||||
default:
|
||||
VIR_ERROR(_("unexpected secret usage type %d"), def->usage_type);
|
||||
break;
|
||||
@ -153,14 +145,6 @@ virSecretDefParseUsage(xmlXPathContextPtr ctxt,
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
|
||||
if (!(def->usage.name = virXPathString("string(./usage/name)", ctxt))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("passphrase usage specified, but name is missing"));
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected secret usage type %d"),
|
||||
@ -313,10 +297,6 @@ virSecretDefFormatUsage(virBufferPtr buf,
|
||||
virBufferEscapeString(buf, "<target>%s</target>\n", def->usage.target);
|
||||
break;
|
||||
|
||||
case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
|
||||
virBufferEscapeString(buf, "<name>%s</name>\n", def->usage.name);
|
||||
break;
|
||||
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected secret usage type %d"),
|
||||
|
@ -40,7 +40,6 @@ struct _virSecretDef {
|
||||
char *volume; /* May be NULL */
|
||||
char *ceph;
|
||||
char *target;
|
||||
char *name;
|
||||
} usage;
|
||||
};
|
||||
|
||||
|
@ -237,11 +237,6 @@ virSecretObjSearchName(const void *payload,
|
||||
if (STREQ(secret->def->usage.target, data->usageID))
|
||||
found = 1;
|
||||
break;
|
||||
|
||||
case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
|
||||
if (STREQ(secret->def->usage.name, data->usageID))
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
@ -1,7 +0,0 @@
|
||||
<secret ephemeral='no' private='no'>
|
||||
<uuid>f52a81b2-424e-490c-823d-6bd4235bc572</uuid>
|
||||
<description>Sample Passphrase Secret</description>
|
||||
<usage type='passphrase'>
|
||||
<name>mumblyfratz</name>
|
||||
</usage>
|
||||
</secret>
|
@ -80,7 +80,6 @@ mymain(void)
|
||||
DO_TEST("usage-volume");
|
||||
DO_TEST("usage-ceph");
|
||||
DO_TEST("usage-iscsi");
|
||||
DO_TEST("usage-passphrase");
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user