mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Rename "security context" to "selinux context"
There are various methods named "virXXXXSecurityContext", which are specific to SELinux. Rename them all to "virXXXXSELinuxContext". They will still raise errors at runtime if SELinux is not compiled in Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
8f7a1ac810
commit
b1d753fe40
@ -862,7 +862,7 @@ virNetServerClientGetFD;
|
||||
virNetServerClientGetIdentity;
|
||||
virNetServerClientGetPrivateData;
|
||||
virNetServerClientGetReadonly;
|
||||
virNetServerClientGetSecurityContext;
|
||||
virNetServerClientGetSELinuxContext;
|
||||
virNetServerClientGetUNIXIdentity;
|
||||
virNetServerClientImmediateClose;
|
||||
virNetServerClientInit;
|
||||
@ -933,7 +933,7 @@ virNetSocketClose;
|
||||
virNetSocketDupFD;
|
||||
virNetSocketGetFD;
|
||||
virNetSocketGetPort;
|
||||
virNetSocketGetSecurityContext;
|
||||
virNetSocketGetSELinuxContext;
|
||||
virNetSocketGetUNIXIdentity;
|
||||
virNetSocketHasCachedData;
|
||||
virNetSocketHasPassFD;
|
||||
|
@ -701,7 +701,7 @@ virNetServerClientCreateIdentity(virNetServerClientPtr client)
|
||||
#endif
|
||||
|
||||
if (client->sock &&
|
||||
virNetSocketGetSecurityContext(client->sock, &seccontext) < 0)
|
||||
virNetSocketGetSELinuxContext(client->sock, &seccontext) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(ret = virIdentityNew()))
|
||||
@ -736,7 +736,7 @@ virNetServerClientCreateIdentity(virNetServerClientPtr client)
|
||||
goto error;
|
||||
if (seccontext &&
|
||||
virIdentitySetAttr(ret,
|
||||
VIR_IDENTITY_ATTR_SECURITY_CONTEXT,
|
||||
VIR_IDENTITY_ATTR_SELINUX_CONTEXT,
|
||||
seccontext) < 0)
|
||||
goto error;
|
||||
|
||||
@ -771,14 +771,14 @@ virIdentityPtr virNetServerClientGetIdentity(virNetServerClientPtr client)
|
||||
}
|
||||
|
||||
|
||||
int virNetServerClientGetSecurityContext(virNetServerClientPtr client,
|
||||
char **context)
|
||||
int virNetServerClientGetSELinuxContext(virNetServerClientPtr client,
|
||||
char **context)
|
||||
{
|
||||
int ret = 0;
|
||||
*context = NULL;
|
||||
virObjectLock(client);
|
||||
if (client->sock)
|
||||
ret = virNetSocketGetSecurityContext(client->sock, context);
|
||||
ret = virNetSocketGetSELinuxContext(client->sock, context);
|
||||
virObjectUnlock(client);
|
||||
return ret;
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ bool virNetServerClientIsLocal(virNetServerClientPtr client);
|
||||
int virNetServerClientGetUNIXIdentity(virNetServerClientPtr client,
|
||||
uid_t *uid, gid_t *gid, pid_t *pid);
|
||||
|
||||
int virNetServerClientGetSecurityContext(virNetServerClientPtr client,
|
||||
char **context);
|
||||
int virNetServerClientGetSELinuxContext(virNetServerClientPtr client,
|
||||
char **context);
|
||||
|
||||
virIdentityPtr virNetServerClientGetIdentity(virNetServerClientPtr client);
|
||||
|
||||
|
@ -1161,8 +1161,8 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock ATTRIBUTE_UNUSED,
|
||||
#endif
|
||||
|
||||
#ifdef WITH_SELINUX
|
||||
int virNetSocketGetSecurityContext(virNetSocketPtr sock,
|
||||
char **context)
|
||||
int virNetSocketGetSELinuxContext(virNetSocketPtr sock,
|
||||
char **context)
|
||||
{
|
||||
security_context_t seccon = NULL;
|
||||
int ret = -1;
|
||||
@ -1192,8 +1192,8 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
int virNetSocketGetSecurityContext(virNetSocketPtr sock ATTRIBUTE_UNUSED,
|
||||
char **context)
|
||||
int virNetSocketGetSELinuxContext(virNetSocketPtr sock ATTRIBUTE_UNUSED,
|
||||
char **context)
|
||||
{
|
||||
*context = NULL;
|
||||
return 0;
|
||||
|
@ -114,8 +114,8 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
|
||||
uid_t *uid,
|
||||
gid_t *gid,
|
||||
pid_t *pid);
|
||||
int virNetSocketGetSecurityContext(virNetSocketPtr sock,
|
||||
char **context);
|
||||
int virNetSocketGetSELinuxContext(virNetSocketPtr sock,
|
||||
char **context);
|
||||
|
||||
int virNetSocketSetBlocking(virNetSocketPtr sock,
|
||||
bool blocking);
|
||||
|
@ -173,7 +173,7 @@ virIdentityPtr virIdentityGetSystem(void)
|
||||
goto error;
|
||||
if (seccontext &&
|
||||
virIdentitySetAttr(ret,
|
||||
VIR_IDENTITY_ATTR_SECURITY_CONTEXT,
|
||||
VIR_IDENTITY_ATTR_SELINUX_CONTEXT,
|
||||
seccontext) < 0)
|
||||
goto error;
|
||||
|
||||
|
@ -33,7 +33,7 @@ typedef enum {
|
||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_ID,
|
||||
VIR_IDENTITY_ATTR_SASL_USER_NAME,
|
||||
VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME,
|
||||
VIR_IDENTITY_ATTR_SECURITY_CONTEXT,
|
||||
VIR_IDENTITY_ATTR_SELINUX_CONTEXT,
|
||||
|
||||
VIR_IDENTITY_ATTR_LAST,
|
||||
} virIdentityAttrType;
|
||||
|
Loading…
Reference in New Issue
Block a user