Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > b080aa38c5bb0041448f6fdafd4d9238 > files > 22

libedit-devel-3.0-0.20090722.1mdv2010.0.i586.rpm

--- export/src/el.c	2009-07-22 23:27:40.000000000 +0200
+++ ../src/el.c	2009-07-22 23:49:25.000000000 +0200
@@ -41,6 +41,10 @@
 #endif
 #endif /* not lint && not SCCSID */
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
 /*
  * el.c: EditLine interface functions
  */
@@ -492,17 +496,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))
@@ -510,14 +513,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");