diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-tunables.c | 24 | ||||
-rw-r--r-- | elf/dl-tunables.h | 17 |
2 files changed, 21 insertions, 20 deletions
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index b3c1392ce4..44c160cac5 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -33,22 +33,6 @@ # define GLIBC_TUNABLES "GLIBC_TUNABLES" #endif -/* Compare environment or tunable names, bounded by the name hardcoded in - glibc. */ -static bool -is_name (const char *orig, const char *envname) -{ - for (;*orig != '\0' && *envname != '\0'; envname++, orig++) - if (*orig != *envname) - break; - - /* The ENVNAME is immediately followed by a value. */ - if (*orig == '\0' && *envname == '=') - return true; - else - return false; -} - #if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring static char * tunables_strdup (const char *in) @@ -235,7 +219,7 @@ parse_tunables (char *tunestr, char *valstring) { tunable_t *cur = &tunable_list[i]; - if (is_name (cur->name, name)) + if (tunable_is_name (cur->name, name)) { /* If we are in a secure context (AT_SECURE) then ignore the tunable unless it is explicitly marked as secure. Tunable values take @@ -318,7 +302,7 @@ __tunables_init (char **envp) &prev_envp)) != NULL) { #if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring - if (is_name (GLIBC_TUNABLES, envname)) + if (tunable_is_name (GLIBC_TUNABLES, envname)) { char *new_env = tunables_strdup (envname); if (new_env != NULL) @@ -341,7 +325,7 @@ __tunables_init (char **envp) const char *name = cur->env_alias; /* We have a match. Initialize and move on to the next line. */ - if (is_name (name, envname)) + if (tunable_is_name (name, envname)) { /* For AT_SECURE binaries, we need to check the security settings of the tunable and decide whether we read the value and also whether @@ -356,7 +340,7 @@ __tunables_init (char **envp) while (*ep != NULL) { - if (is_name (name, *ep)) + if (tunable_is_name (name, *ep)) { char **dp = ep; diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h index 6c49dcbf47..c92882acba 100644 --- a/elf/dl-tunables.h +++ b/elf/dl-tunables.h @@ -111,5 +111,22 @@ rtld_hidden_proto (__tunable_get_val) # define TUNABLES_FRONTEND_valstring 1 /* The default value for TUNABLES_FRONTEND. */ # define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring + +/* Compare two name strings, bounded by the name hardcoded in glibc. */ +static inline bool +__always_inline +tunable_is_name (const char *orig, const char *envname) +{ + for (;*orig != '\0' && *envname != '\0'; envname++, orig++) + if (*orig != *envname) + break; + + /* The ENVNAME is immediately followed by a value. */ + if (*orig == '\0' && *envname == '=') + return true; + else + return false; +} + #endif #endif |