mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
security: Rename DomainSetDirLabel to DomainSetPathLabel
It already labels abritrary paths, so it's just the naming that was wrong. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
dd1400280e
commit
32f3f0835e
@ -1055,7 +1055,7 @@ virSecurityDriverLookup;
|
||||
# security/security_manager.h
|
||||
virSecurityManagerCheckAllLabel;
|
||||
virSecurityManagerClearSocketLabel;
|
||||
virSecurityManagerDomainSetDirLabel;
|
||||
virSecurityManagerDomainSetPathLabel;
|
||||
virSecurityManagerGenLabel;
|
||||
virSecurityManagerGetBaseLabel;
|
||||
virSecurityManagerGetDOI;
|
||||
|
@ -527,8 +527,8 @@ qemuDomainWriteMasterKeyFile(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
|
||||
vm->def, path) < 0)
|
||||
if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
|
||||
vm->def, path) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
@ -4486,8 +4486,8 @@ qemuProcessMakeDir(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
|
||||
vm->def, path) < 0)
|
||||
if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
|
||||
vm->def, path) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
@ -1542,9 +1542,9 @@ virSecurityDACGetBaseLabel(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
virSecurityDACDomainSetDirLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
const char *path)
|
||||
virSecurityDACDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
const char *path)
|
||||
{
|
||||
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||
virSecurityLabelDefPtr seclabel;
|
||||
@ -1607,5 +1607,5 @@ virSecurityDriver virSecurityDriverDAC = {
|
||||
|
||||
.getBaseLabel = virSecurityDACGetBaseLabel,
|
||||
|
||||
.domainSetDirLabel = virSecurityDACDomainSetDirLabel,
|
||||
.domainSetPathLabel = virSecurityDACDomainSetPathLabel,
|
||||
};
|
||||
|
@ -118,9 +118,9 @@ typedef int (*virSecurityDomainSetImageLabel) (virSecurityManagerPtr mgr,
|
||||
typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
virStorageSourcePtr src);
|
||||
typedef int (*virSecurityDomainSetDirLabel) (virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
const char *path);
|
||||
typedef int (*virSecurityDomainSetPathLabel) (virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
const char *path);
|
||||
|
||||
|
||||
struct _virSecurityDriver {
|
||||
@ -172,7 +172,7 @@ struct _virSecurityDriver {
|
||||
|
||||
virSecurityDriverGetBaseLabel getBaseLabel;
|
||||
|
||||
virSecurityDomainSetDirLabel domainSetDirLabel;
|
||||
virSecurityDomainSetPathLabel domainSetPathLabel;
|
||||
};
|
||||
|
||||
virSecurityDriverPtr virSecurityDriverLookup(const char *name,
|
||||
|
@ -987,14 +987,14 @@ virSecurityManagerSetHugepages(virSecurityManagerPtr mgr,
|
||||
|
||||
|
||||
int
|
||||
virSecurityManagerDomainSetDirLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
const char *path)
|
||||
virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
const char *path)
|
||||
{
|
||||
if (mgr->drv->domainSetDirLabel) {
|
||||
if (mgr->drv->domainSetPathLabel) {
|
||||
int ret;
|
||||
virObjectLock(mgr);
|
||||
ret = mgr->drv->domainSetDirLabel(mgr, vm, path);
|
||||
ret = mgr->drv->domainSetPathLabel(mgr, vm, path);
|
||||
virObjectUnlock(mgr);
|
||||
return ret;
|
||||
}
|
||||
|
@ -160,8 +160,8 @@ int virSecurityManagerRestoreImageLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
virStorageSourcePtr src);
|
||||
|
||||
int virSecurityManagerDomainSetDirLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
const char *path);
|
||||
int virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
const char *path);
|
||||
|
||||
#endif /* VIR_SECURITY_MANAGER_H__ */
|
||||
|
@ -2594,9 +2594,9 @@ virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
virSecuritySELinuxDomainSetDirLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
const char *path)
|
||||
virSecuritySELinuxDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def,
|
||||
const char *path)
|
||||
{
|
||||
virSecurityLabelDefPtr seclabel;
|
||||
|
||||
@ -2652,5 +2652,5 @@ virSecurityDriver virSecurityDriverSELinux = {
|
||||
.domainGetSecurityMountOptions = virSecuritySELinuxGetSecurityMountOptions,
|
||||
.getBaseLabel = virSecuritySELinuxGetBaseLabel,
|
||||
|
||||
.domainSetDirLabel = virSecuritySELinuxDomainSetDirLabel,
|
||||
.domainSetPathLabel = virSecuritySELinuxDomainSetPathLabel,
|
||||
};
|
||||
|
@ -600,17 +600,17 @@ virSecurityStackRestoreImageLabel(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
virSecurityStackDomainSetDirLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
const char *path)
|
||||
virSecurityStackDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr vm,
|
||||
const char *path)
|
||||
{
|
||||
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||
virSecurityStackItemPtr item = priv->itemsHead;
|
||||
int rc = 0;
|
||||
|
||||
for (; item; item = item->next) {
|
||||
if (virSecurityManagerDomainSetDirLabel(item->securityManager,
|
||||
vm, path) < 0)
|
||||
if (virSecurityManagerDomainSetPathLabel(item->securityManager,
|
||||
vm, path) < 0)
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
@ -667,5 +667,5 @@ virSecurityDriver virSecurityDriverStack = {
|
||||
|
||||
.getBaseLabel = virSecurityStackGetBaseLabel,
|
||||
|
||||
.domainSetDirLabel = virSecurityStackDomainSetDirLabel,
|
||||
.domainSetPathLabel = virSecurityStackDomainSetPathLabel,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user