summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/getrealm.c
diff options
context:
space:
mode:
Diffstat (limited to 'kerberosIV/krb/getrealm.c')
-rw-r--r--kerberosIV/krb/getrealm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kerberosIV/krb/getrealm.c b/kerberosIV/krb/getrealm.c
index 45ab920d575..7d303287d60 100644
--- a/kerberosIV/krb/getrealm.c
+++ b/kerberosIV/krb/getrealm.c
@@ -82,7 +82,9 @@ krb_realmofhost(host)
if ((trans_file = fopen(KRB_RLM_TRANS, "r")) == (FILE *) 0) {
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.realms", sizeof(tbuf) - strlen(tbuf));