aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-tunables.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-tunables.c')
-rw-r--r--elf/dl-tunables.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 8d69140..39feecd 100644
--- a/elf/dl-tunables.c
+++ b/elf/dl-tunables.c
@@ -30,7 +30,9 @@
#define TUNABLES_INTERNAL 1
#include "dl-tunables.h"
-#define GLIBC_TUNABLES "GLIBC_TUNABLES"
+#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
+# define GLIBC_TUNABLES "GLIBC_TUNABLES"
+#endif
/* Compare environment or tunable names, bounded by the name hardcoded in
glibc. */
@@ -48,6 +50,7 @@ is_name (const char *orig, const char *envname)
return false;
}
+#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
static char *
tunables_strdup (const char *in)
{
@@ -70,6 +73,7 @@ tunables_strdup (const char *in)
return out;
}
+#endif
static char **
get_next_env (char **envp, char **name, size_t *namelen, char **val)
@@ -244,6 +248,7 @@ tunable_initialize (tunable_t *cur, const char *strval)
}
}
+#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
static void
parse_tunables (char *tunestr)
{
@@ -309,6 +314,7 @@ parse_tunables (char *tunestr)
return;
}
}
+#endif
static size_t
min_strlen (const char *s)
@@ -329,6 +335,7 @@ disable_tunable (tunable_id_t id, char **envp)
if (env_alias != NULL)
tunables_unsetenv (envp, tunable_list[id].env_alias);
+#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
char *tunable = getenv (GLIBC_TUNABLES);
const char *cmp = tunable_list[id].name;
const size_t len = min_strlen (cmp);
@@ -345,6 +352,7 @@ disable_tunable (tunable_id_t id, char **envp)
}
tunable++;
}
+#endif
}
/* Disable the glibc.malloc.check tunable in SETUID/SETGID programs unless
@@ -375,6 +383,7 @@ __tunables_init (char **envp)
while ((envp = get_next_env (envp, &envname, &len, &envval)) != NULL)
{
+#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
if (is_name (GLIBC_TUNABLES, envname))
{
char *val = tunables_strdup (envval);
@@ -382,6 +391,7 @@ __tunables_init (char **envp)
parse_tunables (val);
continue;
}
+#endif
for (int i = 0; i < sizeof (tunable_list) / sizeof (tunable_t); i++)
{