summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-sysdep.c18
-rw-r--r--sysdeps/generic/sigaction.h4
-rw-r--r--sysdeps/generic/sigset.h4
-rw-r--r--sysdeps/generic/sys/ptrace.h4
-rw-r--r--sysdeps/unix/bsd/osf/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/linux/sys/ptrace.h2
-rw-r--r--sysdeps/unix/sysv/minix/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/sco3.2.4/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/sysv4/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/sysv4/sigset.h5
10 files changed, 34 insertions, 19 deletions
diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c
index 546993dbd1..4d5faad69f 100644
--- a/sysdeps/generic/dl-sysdep.c
+++ b/sysdeps/generic/dl-sysdep.c
@@ -40,6 +40,7 @@ _dl_sysdep_start (void **start_argptr,
Elf32_auxv_t *av;
uid_t uid, euid;
gid_t gid, egid;
+ unsigned int seen;
user_entry = (Elf32_Addr) &_start;
_dl_argc = *(int *) start_argptr;
@@ -49,7 +50,12 @@ _dl_sysdep_start (void **start_argptr,
while (*start_argptr)
++start_argptr;
- for (av = (void *) ++start_argptr; av->a_type != AT_NULL; ++av)
+ seen = 0;
+#define M(type) (1 << (type))
+
+ for (av = (void *) ++start_argptr;
+ av->a_type != AT_NULL;
+ seen |= M ((++av)->a_type))
switch (av->a_type)
{
case AT_PHDR:
@@ -75,6 +81,16 @@ _dl_sysdep_start (void **start_argptr,
break;
}
+ /* Linux doesn't provide us with any of these values on the stack
+ when the dynamic linker is run directly as a program. */
+
+#define SEE(UID, uid) if ((seen & M (AT_##UID)) == 0) uid = __get##uid ()
+ SEE (UID, uid);
+ SEE (GID, gid);
+ SEE (EUID, euid);
+ SEE (EGID, egid);
+
+
_dl_secure = uid != euid || gid != egid;
#ifdef DL_SYSDEP_INIT
diff --git a/sysdeps/generic/sigaction.h b/sysdeps/generic/sigaction.h
index 31ce45c705..1676b1ce8e 100644
--- a/sysdeps/generic/sigaction.h
+++ b/sysdeps/generic/sigaction.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* These definitions match those used by the 4.4 BSD kernel.
diff --git a/sysdeps/generic/sigset.h b/sysdeps/generic/sigset.h
index b3664e7876..e9dc7c728b 100644
--- a/sysdeps/generic/sigset.h
+++ b/sysdeps/generic/sigset.h
@@ -1,5 +1,5 @@
/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version.
-Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc.
+Copyright (C) 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _SIGSET_H_types
diff --git a/sysdeps/generic/sys/ptrace.h b/sysdeps/generic/sys/ptrace.h
index a342e62d64..5fab97e51f 100644
--- a/sysdeps/generic/sys/ptrace.h
+++ b/sysdeps/generic/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Generic version; constants are common.
-Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _PTRACE_H
diff --git a/sysdeps/unix/bsd/osf/sigaction.h b/sysdeps/unix/bsd/osf/sigaction.h
index 8a4e2c5b84..d809b6bd74 100644
--- a/sysdeps/unix/bsd/osf/sigaction.h
+++ b/sysdeps/unix/bsd/osf/sigaction.h
@@ -1,5 +1,5 @@
/* Structure and constand definitions for sigaction et al. OSF/1 version.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996 Free Software Foundation, Inc.
Contributed by Brendan Kehoe (brendan@zen.org).
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* Structure describing the action to be taken when a signal arrives. */
diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h
index 51d3317af2..cf3709e802 100644
--- a/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _SYS_PTRACE_H
diff --git a/sysdeps/unix/sysv/minix/sigaction.h b/sysdeps/unix/sysv/minix/sigaction.h
index 9395206407..6b0c460914 100644
--- a/sysdeps/unix/sysv/minix/sigaction.h
+++ b/sysdeps/unix/sysv/minix/sigaction.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* Structure describing the action to be taken when a signal arrives. */
diff --git a/sysdeps/unix/sysv/sco3.2.4/sigaction.h b/sysdeps/unix/sysv/sco3.2.4/sigaction.h
index c6344f0810..c21b928cdb 100644
--- a/sysdeps/unix/sysv/sco3.2.4/sigaction.h
+++ b/sysdeps/unix/sysv/sco3.2.4/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for SCO's sigaction.
-Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* Structure describing the action to be taken when a signal arrives. */
diff --git a/sysdeps/unix/sysv/sysv4/sigaction.h b/sysdeps/unix/sysv/sysv4/sigaction.h
index dbb31f1077..1305ba61e6 100644
--- a/sysdeps/unix/sysv/sysv4/sigaction.h
+++ b/sysdeps/unix/sysv/sysv4/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for SVR4's sigaction.
-Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* Structure describing the action to be taken when a signal arrives. */
diff --git a/sysdeps/unix/sysv/sysv4/sigset.h b/sysdeps/unix/sysv/sysv4/sigset.h
index b21b519fc9..57aff36ab7 100644
--- a/sysdeps/unix/sysv/sysv4/sigset.h
+++ b/sysdeps/unix/sysv/sysv4/sigset.h
@@ -1,5 +1,5 @@
/* __sig_atomic_t, __sigset_t, and related definitions. SVR4 version.
-Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _SIGSET_H_types
@@ -94,4 +94,3 @@ __sigismember (__const __sigset_t *__set, int __sig)
}
#endif /* ! _SIGSET_H_fns */
-