summaryrefslogtreecommitdiffstats
path: root/lib/libedit/el.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libedit/el.c')
-rw-r--r--lib/libedit/el.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index f163ec8..c9c3f72 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -77,7 +77,7 @@ el_init(prog, fin, fout)
el->el_prog = strdup(prog);
#ifdef DEBUG
- if ((tty = getenv("DEBUGTTY")) != NULL) {
+ if (issetugid() == 0 && (tty = getenv("DEBUGTTY")) != NULL) {
el->el_errfile = fopen(tty, "w");
if (el->el_errfile == NULL) {
extern errno;
@@ -291,7 +291,7 @@ el_source(el, fname)
if (fname == NULL) {
fname = &elpath[1];
if ((fp = fopen(fname, "r")) == NULL) {
- if ((ptr = getenv("HOME")) == NULL)
+ if (issetugid() != 0 || (ptr = getenv("HOME")) == NULL)
return -1;
(void)snprintf(path, sizeof(path), "%s%s", ptr, elpath);
fname = path;
OpenPOWER on IntegriCloud