mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
Rename virSecurityManagerSetFDLabel method
The virSecurityManagerSetFDLabel method is used to label file descriptors associated with disk images. There will shortly be a need to label other file descriptors in a different way. So the current name is ambiguous. Rename the method to virSecurityManagerSetImageFDLabel to clarify its purpose * src/libvirt_private.syms, src/qemu/qemu_migration.c, src/qemu/qemu_process.c, src/security/security_apparmor.c, src/security/security_dac.c, src/security/security_driver.h, src/security/security_manager.c, src/security/security_manager.h, src/security/security_selinux.c, src/security/security_stack.c: s/FDLabel/ImageFDLabel/
This commit is contained in:
parent
f0739fc579
commit
4438c63e71
@ -848,7 +848,7 @@ virSecurityManagerRestoreAllLabel;
|
||||
virSecurityManagerRestoreHostdevLabel;
|
||||
virSecurityManagerRestoreSavedStateLabel;
|
||||
virSecurityManagerSetAllLabel;
|
||||
virSecurityManagerSetFDLabel;
|
||||
virSecurityManagerSetImageFDLabel;
|
||||
virSecurityManagerSetImageLabel;
|
||||
virSecurityManagerSetHostdevLabel;
|
||||
virSecurityManagerSetProcessLabel;
|
||||
|
@ -2688,8 +2688,8 @@ qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
|
||||
* doesn't have to open() the file, so while we still have to
|
||||
* grant SELinux access, we can do it on fd and avoid cleanup
|
||||
* later, as well as skip futzing with cgroup. */
|
||||
if (virSecurityManagerSetFDLabel(driver->securityManager, vm,
|
||||
compressor ? pipeFD[1] : fd) < 0)
|
||||
if (virSecurityManagerSetImageFDLabel(driver->securityManager, vm,
|
||||
compressor ? pipeFD[1] : fd) < 0)
|
||||
goto cleanup;
|
||||
bypassSecurityDriver = true;
|
||||
} else {
|
||||
|
@ -2641,7 +2641,7 @@ int qemuProcessStart(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
if (S_ISFIFO(stdin_sb.st_mode) &&
|
||||
virSecurityManagerSetFDLabel(driver->securityManager, vm, stdin_fd) < 0)
|
||||
virSecurityManagerSetImageFDLabel(driver->securityManager, vm, stdin_fd) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -759,9 +759,9 @@ AppArmorRestoreSavedStateLabel(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
AppArmorSetFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
AppArmorSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
{
|
||||
int rc = -1;
|
||||
char *proc = NULL;
|
||||
@ -820,5 +820,5 @@ virSecurityDriver virAppArmorSecurityDriver = {
|
||||
AppArmorSetSavedStateLabel,
|
||||
AppArmorRestoreSavedStateLabel,
|
||||
|
||||
AppArmorSetFDLabel,
|
||||
AppArmorSetImageFDLabel,
|
||||
};
|
||||
|
@ -682,9 +682,9 @@ virSecurityDACClearSocketLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
static int
|
||||
virSecurityDACSetFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||
virDomainObjPtr vm ATTRIBUTE_UNUSED,
|
||||
int fd ATTRIBUTE_UNUSED)
|
||||
virSecurityDACSetImageFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||
virDomainObjPtr vm ATTRIBUTE_UNUSED,
|
||||
int fd ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -725,5 +725,5 @@ virSecurityDriver virSecurityDriverDAC = {
|
||||
virSecurityDACSetSavedStateLabel,
|
||||
virSecurityDACRestoreSavedStateLabel,
|
||||
|
||||
virSecurityDACSetFDLabel,
|
||||
virSecurityDACSetImageFDLabel,
|
||||
};
|
||||
|
@ -79,9 +79,9 @@ typedef int (*virSecurityDomainSetProcessLabel) (virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm);
|
||||
typedef int (*virSecurityDomainSecurityVerify) (virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def);
|
||||
typedef int (*virSecurityDomainSetFDLabel) (virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd);
|
||||
typedef int (*virSecurityDomainSetImageFDLabel) (virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd);
|
||||
|
||||
struct _virSecurityDriver {
|
||||
size_t privateDataLen;
|
||||
@ -117,7 +117,7 @@ struct _virSecurityDriver {
|
||||
virSecurityDomainSetSavedStateLabel domainSetSavedStateLabel;
|
||||
virSecurityDomainRestoreSavedStateLabel domainRestoreSavedStateLabel;
|
||||
|
||||
virSecurityDomainSetFDLabel domainSetSecurityFDLabel;
|
||||
virSecurityDomainSetImageFDLabel domainSetSecurityImageFDLabel;
|
||||
};
|
||||
|
||||
virSecurityDriverPtr virSecurityDriverLookup(const char *name);
|
||||
|
@ -326,12 +326,12 @@ int virSecurityManagerVerify(virSecurityManagerPtr mgr,
|
||||
return -1;
|
||||
}
|
||||
|
||||
int virSecurityManagerSetFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
int virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
{
|
||||
if (mgr->drv->domainSetSecurityFDLabel)
|
||||
return mgr->drv->domainSetSecurityFDLabel(mgr, vm, fd);
|
||||
if (mgr->drv->domainSetSecurityImageFDLabel)
|
||||
return mgr->drv->domainSetSecurityImageFDLabel(mgr, vm, fd);
|
||||
|
||||
virSecurityReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
return -1;
|
||||
|
@ -91,8 +91,8 @@ int virSecurityManagerSetProcessLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm);
|
||||
int virSecurityManagerVerify(virSecurityManagerPtr mgr,
|
||||
virDomainDefPtr def);
|
||||
int virSecurityManagerSetFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd);
|
||||
int virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd);
|
||||
|
||||
#endif /* VIR_SECURITY_MANAGER_H__ */
|
||||
|
@ -1209,9 +1209,9 @@ SELinuxSetSecurityAllLabel(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
SELinuxSetFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
SELinuxSetImageFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
{
|
||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||
|
||||
@ -1255,5 +1255,5 @@ virSecurityDriver virSecurityDriverSELinux = {
|
||||
SELinuxSetSavedStateLabel,
|
||||
SELinuxRestoreSavedStateLabel,
|
||||
|
||||
SELinuxSetFDLabel,
|
||||
SELinuxSetImageFDLabel,
|
||||
};
|
||||
|
@ -370,16 +370,16 @@ virSecurityStackClearSocketLabel(virSecurityManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
virSecurityStackSetFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
virSecurityStackSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm,
|
||||
int fd)
|
||||
{
|
||||
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||
int rc = 0;
|
||||
|
||||
if (virSecurityManagerSetFDLabel(priv->secondary, vm, fd) < 0)
|
||||
if (virSecurityManagerSetImageFDLabel(priv->secondary, vm, fd) < 0)
|
||||
rc = -1;
|
||||
if (virSecurityManagerSetFDLabel(priv->primary, vm, fd) < 0)
|
||||
if (virSecurityManagerSetImageFDLabel(priv->primary, vm, fd) < 0)
|
||||
rc = -1;
|
||||
|
||||
return rc;
|
||||
@ -420,5 +420,5 @@ virSecurityDriver virSecurityDriverStack = {
|
||||
virSecurityStackSetSavedStateLabel,
|
||||
virSecurityStackRestoreSavedStateLabel,
|
||||
|
||||
virSecurityStackSetFDLabel,
|
||||
virSecurityStackSetImageFDLabel,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user