Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 07ca3c09da5c98b6bf6f222290a2f298 > files > 23

lib64edit-devel-2.10-0.20070831.1mdv2008.1.x86_64.rpm

--- export/src/el.c	2007-08-31 00:02:46.000000000 +0200
+++ ../src/el.c	2007-08-31 00:03:08.000000000 +0200
@@ -473,12 +473,17 @@
 
 	fp = NULL;
 	if (fname == NULL) {
-#ifdef HAVE_ISSETUGID
 		static const char elpath[] = "/.editrc";
+#ifdef MAXPATHLEN
 		char path[MAXPATHLEN];
+#else
+		char path[4096];
+#endif
 
+#ifdef HAVE_ISSETUGID
 		if (issetugid())
 			return (-1);
+#endif
 		if ((ptr = getenv("HOME")) == NULL)
 			return (-1);
 		if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
@@ -486,14 +491,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");