--- export/src/el.c 2009-09-05 13:37:56.000000000 +0200 +++ ../src/el.c 2009-09-05 13:47:56.000000000 +0200 @@ -41,6 +41,10 @@ #endif #endif /* not lint && not SCCSID */ +#ifndef MAXPATHLEN +#define MAXPATHLEN 4096 +#endif + /* * el.c: EditLine interface functions */ @@ -493,17 +497,16 @@ FILE *fp; size_t len; char *ptr; -#ifdef HAVE_ISSETUGID char path[MAXPATHLEN]; -#endif fp = NULL; if (fname == NULL) { -#ifdef HAVE_ISSETUGID static const char elpath[] = "/.editrc"; +#ifdef HAVE_ISSETUGID if (issetugid()) return (-1); +#endif if ((ptr = getenv("HOME")) == NULL) return (-1); if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path)) @@ -511,14 +514,6 @@ if (strlcat(path, elpath, sizeof(path)) >= sizeof(path)) return (-1); fname = path; -#else - /* - * If issetugid() is missing, always return an error, in order - * to keep from inadvertently opening up the user to a security - * hole. - */ - return (-1); -#endif } if (fp == NULL) fp = fopen(fname, "r");