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;
|
virSecurityManagerRestoreHostdevLabel;
|
||||||
virSecurityManagerRestoreSavedStateLabel;
|
virSecurityManagerRestoreSavedStateLabel;
|
||||||
virSecurityManagerSetAllLabel;
|
virSecurityManagerSetAllLabel;
|
||||||
virSecurityManagerSetFDLabel;
|
virSecurityManagerSetImageFDLabel;
|
||||||
virSecurityManagerSetImageLabel;
|
virSecurityManagerSetImageLabel;
|
||||||
virSecurityManagerSetHostdevLabel;
|
virSecurityManagerSetHostdevLabel;
|
||||||
virSecurityManagerSetProcessLabel;
|
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
|
* 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
|
* grant SELinux access, we can do it on fd and avoid cleanup
|
||||||
* later, as well as skip futzing with cgroup. */
|
* later, as well as skip futzing with cgroup. */
|
||||||
if (virSecurityManagerSetFDLabel(driver->securityManager, vm,
|
if (virSecurityManagerSetImageFDLabel(driver->securityManager, vm,
|
||||||
compressor ? pipeFD[1] : fd) < 0)
|
compressor ? pipeFD[1] : fd) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
bypassSecurityDriver = true;
|
bypassSecurityDriver = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2641,7 +2641,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (S_ISFIFO(stdin_sb.st_mode) &&
|
if (S_ISFIFO(stdin_sb.st_mode) &&
|
||||||
virSecurityManagerSetFDLabel(driver->securityManager, vm, stdin_fd) < 0)
|
virSecurityManagerSetImageFDLabel(driver->securityManager, vm, stdin_fd) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,9 +759,9 @@ AppArmorRestoreSavedStateLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
AppArmorSetFDLabel(virSecurityManagerPtr mgr,
|
AppArmorSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd)
|
int fd)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
char *proc = NULL;
|
char *proc = NULL;
|
||||||
@ -820,5 +820,5 @@ virSecurityDriver virAppArmorSecurityDriver = {
|
|||||||
AppArmorSetSavedStateLabel,
|
AppArmorSetSavedStateLabel,
|
||||||
AppArmorRestoreSavedStateLabel,
|
AppArmorRestoreSavedStateLabel,
|
||||||
|
|
||||||
AppArmorSetFDLabel,
|
AppArmorSetImageFDLabel,
|
||||||
};
|
};
|
||||||
|
@ -682,9 +682,9 @@ virSecurityDACClearSocketLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virSecurityDACSetFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
virSecurityDACSetImageFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||||
virDomainObjPtr vm ATTRIBUTE_UNUSED,
|
virDomainObjPtr vm ATTRIBUTE_UNUSED,
|
||||||
int fd ATTRIBUTE_UNUSED)
|
int fd ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -725,5 +725,5 @@ virSecurityDriver virSecurityDriverDAC = {
|
|||||||
virSecurityDACSetSavedStateLabel,
|
virSecurityDACSetSavedStateLabel,
|
||||||
virSecurityDACRestoreSavedStateLabel,
|
virSecurityDACRestoreSavedStateLabel,
|
||||||
|
|
||||||
virSecurityDACSetFDLabel,
|
virSecurityDACSetImageFDLabel,
|
||||||
};
|
};
|
||||||
|
@ -79,9 +79,9 @@ typedef int (*virSecurityDomainSetProcessLabel) (virSecurityManagerPtr mgr,
|
|||||||
virDomainObjPtr vm);
|
virDomainObjPtr vm);
|
||||||
typedef int (*virSecurityDomainSecurityVerify) (virSecurityManagerPtr mgr,
|
typedef int (*virSecurityDomainSecurityVerify) (virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr def);
|
virDomainDefPtr def);
|
||||||
typedef int (*virSecurityDomainSetFDLabel) (virSecurityManagerPtr mgr,
|
typedef int (*virSecurityDomainSetImageFDLabel) (virSecurityManagerPtr mgr,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd);
|
int fd);
|
||||||
|
|
||||||
struct _virSecurityDriver {
|
struct _virSecurityDriver {
|
||||||
size_t privateDataLen;
|
size_t privateDataLen;
|
||||||
@ -117,7 +117,7 @@ struct _virSecurityDriver {
|
|||||||
virSecurityDomainSetSavedStateLabel domainSetSavedStateLabel;
|
virSecurityDomainSetSavedStateLabel domainSetSavedStateLabel;
|
||||||
virSecurityDomainRestoreSavedStateLabel domainRestoreSavedStateLabel;
|
virSecurityDomainRestoreSavedStateLabel domainRestoreSavedStateLabel;
|
||||||
|
|
||||||
virSecurityDomainSetFDLabel domainSetSecurityFDLabel;
|
virSecurityDomainSetImageFDLabel domainSetSecurityImageFDLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
virSecurityDriverPtr virSecurityDriverLookup(const char *name);
|
virSecurityDriverPtr virSecurityDriverLookup(const char *name);
|
||||||
|
@ -326,12 +326,12 @@ int virSecurityManagerVerify(virSecurityManagerPtr mgr,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int virSecurityManagerSetFDLabel(virSecurityManagerPtr mgr,
|
int virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd)
|
int fd)
|
||||||
{
|
{
|
||||||
if (mgr->drv->domainSetSecurityFDLabel)
|
if (mgr->drv->domainSetSecurityImageFDLabel)
|
||||||
return mgr->drv->domainSetSecurityFDLabel(mgr, vm, fd);
|
return mgr->drv->domainSetSecurityImageFDLabel(mgr, vm, fd);
|
||||||
|
|
||||||
virSecurityReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
virSecurityReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -91,8 +91,8 @@ int virSecurityManagerSetProcessLabel(virSecurityManagerPtr mgr,
|
|||||||
virDomainObjPtr vm);
|
virDomainObjPtr vm);
|
||||||
int virSecurityManagerVerify(virSecurityManagerPtr mgr,
|
int virSecurityManagerVerify(virSecurityManagerPtr mgr,
|
||||||
virDomainDefPtr def);
|
virDomainDefPtr def);
|
||||||
int virSecurityManagerSetFDLabel(virSecurityManagerPtr mgr,
|
int virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd);
|
int fd);
|
||||||
|
|
||||||
#endif /* VIR_SECURITY_MANAGER_H__ */
|
#endif /* VIR_SECURITY_MANAGER_H__ */
|
||||||
|
@ -1209,9 +1209,9 @@ SELinuxSetSecurityAllLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SELinuxSetFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
SELinuxSetImageFDLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd)
|
int fd)
|
||||||
{
|
{
|
||||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||||
|
|
||||||
@ -1255,5 +1255,5 @@ virSecurityDriver virSecurityDriverSELinux = {
|
|||||||
SELinuxSetSavedStateLabel,
|
SELinuxSetSavedStateLabel,
|
||||||
SELinuxRestoreSavedStateLabel,
|
SELinuxRestoreSavedStateLabel,
|
||||||
|
|
||||||
SELinuxSetFDLabel,
|
SELinuxSetImageFDLabel,
|
||||||
};
|
};
|
||||||
|
@ -370,16 +370,16 @@ virSecurityStackClearSocketLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virSecurityStackSetFDLabel(virSecurityManagerPtr mgr,
|
virSecurityStackSetImageFDLabel(virSecurityManagerPtr mgr,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd)
|
int fd)
|
||||||
{
|
{
|
||||||
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (virSecurityManagerSetFDLabel(priv->secondary, vm, fd) < 0)
|
if (virSecurityManagerSetImageFDLabel(priv->secondary, vm, fd) < 0)
|
||||||
rc = -1;
|
rc = -1;
|
||||||
if (virSecurityManagerSetFDLabel(priv->primary, vm, fd) < 0)
|
if (virSecurityManagerSetImageFDLabel(priv->primary, vm, fd) < 0)
|
||||||
rc = -1;
|
rc = -1;
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@ -420,5 +420,5 @@ virSecurityDriver virSecurityDriverStack = {
|
|||||||
virSecurityStackSetSavedStateLabel,
|
virSecurityStackSetSavedStateLabel,
|
||||||
virSecurityStackRestoreSavedStateLabel,
|
virSecurityStackRestoreSavedStateLabel,
|
||||||
|
|
||||||
virSecurityStackSetFDLabel,
|
virSecurityStackSetImageFDLabel,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user