Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update.
	* elf/dl-load.c (expand_dynamic_string_token): Don't expand
	$ORIGIN for SUID binaries.
  • Loading branch information
Ulrich Drepper committed May 3, 1999
1 parent 4e9a34c commit 6853609
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,5 +1,8 @@
1999-05-03 Ulrich Drepper <drepper@cygnus.com>

* elf/dl-load.c (expand_dynamic_string_token): Don't expand
$ORIGIN for SUID binaries.

* sysdeps/unix/sysv/linux/arm/Dist: Add sigrestorer.S.

1999-05-02 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
Expand Down
7 changes: 5 additions & 2 deletions elf/dl-load.c
Expand Up @@ -161,7 +161,9 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
{
size_t len = 1;

if (((strncmp (&sf[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
/* $ORIGIN is not expanded for SUID/GUID programs. */
if (((!__libc_enable_secure
&& strncmp (&sf[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|| (strncmp (&sf[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
&& (s[len] == '\0' || s[len] == '/' || s[len] == ':'))
++cnt;
Expand Down Expand Up @@ -209,7 +211,8 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
const char *repl;
size_t len;

if (((strncmp (&s[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
if (((!__libc_enable_secure
&& strncmp (&s[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|| (strncmp (&s[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
&& (s[len] == '\0' || s[len] == '/' || s[len] == ':'))
{
Expand Down

0 comments on commit 6853609

Please sign in to comment.