From 70c40d4148538a0444178303422a373e2fe2d0c7 Mon Sep 17 00:00:00 2001 From: bitblt Date: Tue, 25 Mar 1997 21:51:46 +0000 Subject: config file paranoia --- kerberosIV/krb/get_krbrlm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kerberosIV/krb/get_krbrlm.c') diff --git a/kerberosIV/krb/get_krbrlm.c b/kerberosIV/krb/get_krbrlm.c index ee4a06efdb1..ff9f0ebc532 100644 --- a/kerberosIV/krb/get_krbrlm.c +++ b/kerberosIV/krb/get_krbrlm.c @@ -54,7 +54,9 @@ krb_get_lrealm(r, n) if ((cnffile = fopen(KRB_CONF, "r")) == NULL) { char tbuf[128]; - char *tdir = (char *) getenv("KRBCONFDIR"); + char *tdir = NULL; + if (issetugid() == 0) + tdir = (char *) getenv("KRBCONFDIR"); strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf)-1); tbuf[sizeof(tbuf)-1] = 0; strncat(tbuf, "/krb.conf", sizeof(tbuf)-strlen(tbuf)); -- cgit v1.2.3