mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +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
|
# security/security_manager.h
|
||||||
virSecurityManagerCheckAllLabel;
|
virSecurityManagerCheckAllLabel;
|
||||||
virSecurityManagerClearSocketLabel;
|
virSecurityManagerClearSocketLabel;
|
||||||
virSecurityManagerDomainSetDirLabel;
|
virSecurityManagerDomainSetPathLabel;
|
||||||
virSecurityManagerGenLabel;
|
virSecurityManagerGenLabel;
|
||||||
virSecurityManagerGetBaseLabel;
|
virSecurityManagerGetBaseLabel;
|
||||||
virSecurityManagerGetDOI;
|
virSecurityManagerGetDOI;
|
||||||
|
@ -527,8 +527,8 @@ qemuDomainWriteMasterKeyFile(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
|
if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
|
||||||
vm->def, path) < 0)
|
vm->def, path) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -4486,8 +4486,8 @@ qemuProcessMakeDir(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
|
if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
|
||||||
vm->def, path) < 0)
|
vm->def, path) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -1542,9 +1542,9 @@ virSecurityDACGetBaseLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virSecurityDACDomainSetDirLabel(virSecurityManagerPtr mgr,
|
virSecurityDACDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr def,
|
virDomainDefPtr def,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||||
virSecurityLabelDefPtr seclabel;
|
virSecurityLabelDefPtr seclabel;
|
||||||
@ -1607,5 +1607,5 @@ virSecurityDriver virSecurityDriverDAC = {
|
|||||||
|
|
||||||
.getBaseLabel = virSecurityDACGetBaseLabel,
|
.getBaseLabel = virSecurityDACGetBaseLabel,
|
||||||
|
|
||||||
.domainSetDirLabel = virSecurityDACDomainSetDirLabel,
|
.domainSetPathLabel = virSecurityDACDomainSetPathLabel,
|
||||||
};
|
};
|
||||||
|
@ -118,9 +118,9 @@ typedef int (*virSecurityDomainSetImageLabel) (virSecurityManagerPtr mgr,
|
|||||||
typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManagerPtr mgr,
|
typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr def,
|
virDomainDefPtr def,
|
||||||
virStorageSourcePtr src);
|
virStorageSourcePtr src);
|
||||||
typedef int (*virSecurityDomainSetDirLabel) (virSecurityManagerPtr mgr,
|
typedef int (*virSecurityDomainSetPathLabel) (virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr def,
|
virDomainDefPtr def,
|
||||||
const char *path);
|
const char *path);
|
||||||
|
|
||||||
|
|
||||||
struct _virSecurityDriver {
|
struct _virSecurityDriver {
|
||||||
@ -172,7 +172,7 @@ struct _virSecurityDriver {
|
|||||||
|
|
||||||
virSecurityDriverGetBaseLabel getBaseLabel;
|
virSecurityDriverGetBaseLabel getBaseLabel;
|
||||||
|
|
||||||
virSecurityDomainSetDirLabel domainSetDirLabel;
|
virSecurityDomainSetPathLabel domainSetPathLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
virSecurityDriverPtr virSecurityDriverLookup(const char *name,
|
virSecurityDriverPtr virSecurityDriverLookup(const char *name,
|
||||||
|
@ -987,14 +987,14 @@ virSecurityManagerSetHugepages(virSecurityManagerPtr mgr,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virSecurityManagerDomainSetDirLabel(virSecurityManagerPtr mgr,
|
virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr vm,
|
virDomainDefPtr vm,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
if (mgr->drv->domainSetDirLabel) {
|
if (mgr->drv->domainSetPathLabel) {
|
||||||
int ret;
|
int ret;
|
||||||
virObjectLock(mgr);
|
virObjectLock(mgr);
|
||||||
ret = mgr->drv->domainSetDirLabel(mgr, vm, path);
|
ret = mgr->drv->domainSetPathLabel(mgr, vm, path);
|
||||||
virObjectUnlock(mgr);
|
virObjectUnlock(mgr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -160,8 +160,8 @@ int virSecurityManagerRestoreImageLabel(virSecurityManagerPtr mgr,
|
|||||||
virDomainDefPtr vm,
|
virDomainDefPtr vm,
|
||||||
virStorageSourcePtr src);
|
virStorageSourcePtr src);
|
||||||
|
|
||||||
int virSecurityManagerDomainSetDirLabel(virSecurityManagerPtr mgr,
|
int virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr vm,
|
virDomainDefPtr vm,
|
||||||
const char *path);
|
const char *path);
|
||||||
|
|
||||||
#endif /* VIR_SECURITY_MANAGER_H__ */
|
#endif /* VIR_SECURITY_MANAGER_H__ */
|
||||||
|
@ -2594,9 +2594,9 @@ virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virSecuritySELinuxDomainSetDirLabel(virSecurityManagerPtr mgr,
|
virSecuritySELinuxDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr def,
|
virDomainDefPtr def,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
virSecurityLabelDefPtr seclabel;
|
virSecurityLabelDefPtr seclabel;
|
||||||
|
|
||||||
@ -2652,5 +2652,5 @@ virSecurityDriver virSecurityDriverSELinux = {
|
|||||||
.domainGetSecurityMountOptions = virSecuritySELinuxGetSecurityMountOptions,
|
.domainGetSecurityMountOptions = virSecuritySELinuxGetSecurityMountOptions,
|
||||||
.getBaseLabel = virSecuritySELinuxGetBaseLabel,
|
.getBaseLabel = virSecuritySELinuxGetBaseLabel,
|
||||||
|
|
||||||
.domainSetDirLabel = virSecuritySELinuxDomainSetDirLabel,
|
.domainSetPathLabel = virSecuritySELinuxDomainSetPathLabel,
|
||||||
};
|
};
|
||||||
|
@ -600,17 +600,17 @@ virSecurityStackRestoreImageLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virSecurityStackDomainSetDirLabel(virSecurityManagerPtr mgr,
|
virSecurityStackDomainSetPathLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr vm,
|
virDomainDefPtr vm,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||||
virSecurityStackItemPtr item = priv->itemsHead;
|
virSecurityStackItemPtr item = priv->itemsHead;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
for (; item; item = item->next) {
|
for (; item; item = item->next) {
|
||||||
if (virSecurityManagerDomainSetDirLabel(item->securityManager,
|
if (virSecurityManagerDomainSetPathLabel(item->securityManager,
|
||||||
vm, path) < 0)
|
vm, path) < 0)
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,5 +667,5 @@ virSecurityDriver virSecurityDriverStack = {
|
|||||||
|
|
||||||
.getBaseLabel = virSecurityStackGetBaseLabel,
|
.getBaseLabel = virSecurityStackGetBaseLabel,
|
||||||
|
|
||||||
.domainSetDirLabel = virSecurityStackDomainSetDirLabel,
|
.domainSetPathLabel = virSecurityStackDomainSetPathLabel,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user