Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > 9d70214adc1436f851b829e058769c88 > files > 22

lib64edit-devel-3.0-0.20090923.1mdv2010.1.x86_64.rpm

--- export/src/el.c	2009-09-23 22:55:51.000000000 +0200
+++ ../src/el.c	2009-09-23 23:04:26.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");