mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Update.
1999-05-04 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (expand_dynamic_string_token): Recognize { } around DST. Correctly ignore ORIGIN IN SUID binaries.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
1999-05-04 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* elf/dl-load.c (expand_dynamic_string_token): Recognize { }
|
||||||
|
around DST. Correctly ignore ORIGIN IN SUID binaries.
|
||||||
|
|
||||||
1999-05-03 Ulrich Drepper <drepper@cygnus.com>
|
1999-05-03 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* sysdeps/generic/strtok_r.c: Use rawmemchr instead of strchr.
|
* sysdeps/generic/strtok_r.c: Use rawmemchr instead of strchr.
|
||||||
|
@ -171,10 +171,15 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
|||||||
size_t len = 1;
|
size_t len = 1;
|
||||||
|
|
||||||
/* $ORIGIN is not expanded for SUID/GUID programs. */
|
/* $ORIGIN is not expanded for SUID/GUID programs. */
|
||||||
if (((!__libc_enable_secure
|
if ((((!__libc_enable_secure
|
||||||
&& strncmp (&sf[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|
&& strncmp (&sf[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|
||||||
|| (strncmp (&sf[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
|
|| (strncmp (&sf[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
|
||||||
&& (s[len] == '\0' || s[len] == '/' || s[len] == ':'))
|
&& (s[len] == '\0' || s[len] == '/' || s[len] == ':'))
|
||||||
|
|| (s[1] == '{'
|
||||||
|
&& ((!__libc_enable_secure
|
||||||
|
&& strncmp (&sf[2], "ORIGIN}", 7) == 0 && (len = 9) != 0)
|
||||||
|
|| (strncmp (&sf[2], "PLATFORM}", 9) == 0
|
||||||
|
&& (len = 11) != 0))))
|
||||||
++cnt;
|
++cnt;
|
||||||
|
|
||||||
st = sf + len;
|
st = sf + len;
|
||||||
@ -220,13 +225,19 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
|||||||
const char *repl;
|
const char *repl;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (((!__libc_enable_secure
|
if ((((strncmp (&s[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|
||||||
&& strncmp (&s[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|
|| (strncmp (&s[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
|
||||||
|| (strncmp (&s[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
|
&& (s[len] == '\0' || s[len] == '/' || s[len] == ':'))
|
||||||
&& (s[len] == '\0' || s[len] == '/' || s[len] == ':'))
|
|| (s[1] == '{'
|
||||||
|
&& ((strncmp (&s[2], "ORIGIN}", 7) == 0 && (len = 9) != 0)
|
||||||
|
|| (strncmp (&s[2], "PLATFORM}", 9) == 0
|
||||||
|
&& (len = 11) != 0))))
|
||||||
{
|
{
|
||||||
if ((repl = len == 7 ? l->l_origin : _dl_platform) != NULL
|
repl = ((len == 7 || s[2] == 'O')
|
||||||
&& repl != (const char *) -1)
|
? (__libc_enable_secure ? NULL : l->l_origin)
|
||||||
|
: _dl_platform);
|
||||||
|
|
||||||
|
if (repl != NULL && repl != (const char *) -1)
|
||||||
{
|
{
|
||||||
wp = __stpcpy (wp, repl);
|
wp = __stpcpy (wp, repl);
|
||||||
s += len;
|
s += len;
|
||||||
@ -242,7 +253,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* No SDK we recognize. */
|
/* No DST we recognize. */
|
||||||
*wp++ = *s++;
|
*wp++ = *s++;
|
||||||
}
|
}
|
||||||
else if (*s == ':')
|
else if (*s == ':')
|
||||||
|
Reference in New Issue
Block a user