tree-wide: make personality codepaths unconditional

Now that we have the infra to make personality handling unconitional remove the ifndefs everywhere. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 7389642a
......@@ -48,10 +48,6 @@
#include "terminal.h"
#include "utils.h"
#if HAVE_SYS_PERSONALITY_H
#include <sys/personality.h>
#endif
lxc_log_define(attach, lxc);
/* Define default options if no options are supplied by the user. */
......@@ -1147,7 +1143,6 @@ __noreturn static void do_attach(struct attach_payload *ap)
}
/* Now perform additional attachments. */
#if HAVE_SYS_PERSONALITY_H
if (options->attach_flags & LXC_ATTACH_SET_PERSONALITY) {
long new_personality;
......@@ -1164,7 +1159,6 @@ __noreturn static void do_attach(struct attach_payload *ap)
TRACE("Set new personality");
}
}
#endif
if (options->attach_flags & LXC_ATTACH_DROP_CAPABILITIES) {
ret = drop_capabilities(ctx);
......
......@@ -80,10 +80,6 @@
#include <sys/capability.h>
#endif
#if HAVE_SYS_PERSONALITY_H
#include <sys/personality.h>
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#endif
......@@ -1732,11 +1728,10 @@ static int lxc_setup_devpts_child(struct lxc_handler *handler)
return 0;
}
static int setup_personality(int persona)
static int setup_personality(signed long persona)
{
int ret;
#if HAVE_SYS_PERSONALITY_H
if (persona == -1)
return 0;
......@@ -1744,8 +1739,7 @@ static int setup_personality(int persona)
if (ret < 0)
return log_error_errno(-1, errno, "Failed to set personality to \"0x%x\"", persona);
INFO("Set personality to \"0x%x\"", persona);
#endif
INFO("Set personality to \"0lx%lx\"", persona);
return 0;
}
......
......@@ -38,10 +38,6 @@
#include "storage/storage.h"
#include "utils.h"
#if HAVE_SYS_PERSONALITY_H
#include <sys/personality.h>
#endif
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#endif
......@@ -2927,7 +2923,6 @@ void lxc_config_define_free(struct lxc_list *defines)
signed long lxc_config_parse_arch(const char *arch)
{
#if HAVE_SYS_PERSONALITY_H
static struct per_name {
char *name;
unsigned long per;
......@@ -2964,7 +2959,6 @@ signed long lxc_config_parse_arch(const char *arch)
for (int i = 0; i < len; i++)
if (strequal(pername[i].name, arch))
return pername[i].per;
#endif
return LXC_ARCH_UNCHANGED;
}
......@@ -3447,7 +3441,6 @@ static int get_config_personality(const char *key, char *retv, int inlen,
else
memset(retv, 0, inlen);
#if HAVE_SYS_PERSONALITY_H
int len = 0;
switch (c->personality) {
......@@ -3460,7 +3453,6 @@ static int get_config_personality(const char *key, char *retv, int inlen,
default:
break;
}
#endif
return fulllen;
}
......
......@@ -31,6 +31,10 @@
#include <linux/openat2.h>
#endif
#if HAVE_SYS_PERSONALITY_H
#include <sys/personality.h>
#endif
typedef int32_t key_serial_t;
#if !HAVE_KEYCTL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment