summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-02 03:57:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-02 03:57:31 +0000
commit999c8b64f5bb44aabbfddd97b77702603f4010d8 (patch)
treed7f29855386936327812506850987d3d8db2ee1a
parent030dcde987345aefe1f3a302590b3bea15bb9d9f (diff)
correctly code the classes of permitted TZ specifications for the
issetugid() case. thanks bitblt and tholo
-rw-r--r--lib/libc/time/localtime.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index 5546e0e3c74..00132616c1e 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -7,7 +7,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 7.59";
#else
-static char rcsid[] = "$OpenBSD: localtime.c,v 1.9 1997/01/21 04:52:44 millert Exp $";
+static char rcsid[] = "$OpenBSD: localtime.c,v 1.10 1997/04/02 03:57:30 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -275,6 +275,10 @@ register struct state * const sp;
register int i;
register int fid;
+ if (name != NULL && issetugid() != 0)
+ if ((name[0] == ':' && name[1] == '/') ||
+ name[0] == '/' || strchr(name, '.'))
+ name = NULL;
if (name == NULL && (name = TZDEFAULT) == NULL)
return -1;
{
@@ -291,7 +295,7 @@ register struct state * const sp;
if (name[0] == ':')
++name;
doaccess = name[0] == '/';
- if (!doaccess && issetugid() == 0) {
+ if (!doaccess) {
if ((p = TZDIR) == NULL)
return -1;
if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)