mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-27 11:54:53 +08:00
0d0eeaa6cb
When using ip vrf and SELinux is enabled, make sure to set the exec file context before calling cmd_exec. This ensures that the command is executed with the right context, falling back to the ifconfig_t context when needed. Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
38 lines
537 B
C
38 lines
537 B
C
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include "selinux.h"
|
|
|
|
/* Stubs for SELinux functions */
|
|
int is_selinux_enabled(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
void freecon(char *context)
|
|
{
|
|
free(context);
|
|
}
|
|
|
|
int getpidcon(pid_t pid, char **context)
|
|
{
|
|
*context = NULL;
|
|
return -1;
|
|
}
|
|
|
|
int getfilecon(const char *path, char **context)
|
|
{
|
|
*context = NULL;
|
|
return -1;
|
|
}
|
|
|
|
int security_get_initial_context(const char *name, char **context)
|
|
{
|
|
*context = NULL;
|
|
return -1;
|
|
}
|
|
|
|
int setexecfilecon(const char *filename, const char *fallback_type)
|
|
{
|
|
return -1;
|
|
}
|