public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] gentoo-x86 commit in x11-terms/mrxvt/files: mrxvt-0.5.3-display-security.patch
@ 2008-04-30  7:02 99% Krzysiek Pawlik (nelchael)
  0 siblings, 0 replies; 1+ results
From: Krzysiek Pawlik (nelchael) @ 2008-04-30  7:02 UTC (permalink / raw
  To: gentoo-commits

nelchael    08/04/30 07:02:28

  Added:                mrxvt-0.5.3-display-security.patch
  Log:
  Added patch to fix unsecure default DISPLAY, patch created by Gautam Iyer. See bug #219750. Dropped stable mips keyword.
  (Portage version: 2.1.5_rc6)

Revision  Changes    Path
1.1                  x11-terms/mrxvt/files/mrxvt-0.5.3-display-security.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-terms/mrxvt/files/mrxvt-0.5.3-display-security.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-terms/mrxvt/files/mrxvt-0.5.3-display-security.patch?rev=1.1&content-type=text/plain

Index: mrxvt-0.5.3-display-security.patch
===================================================================
Index: src/init.c
===================================================================
--- src/init.c	(revision 265)
+++ src/init.c	(working copy)
@@ -1030,38 +1030,38 @@
     /*
      * Open display, get options/resources and create the window
      */
-    if (IS_NULL(rs[Rs_display_name] = getenv("DISPLAY")))
-	rs[Rs_display_name] = ":0";
-
     rxvt_get_options( r, r_argc, r_argv );
     rxvt_free( r_argv ); /* XXX memory leak? */
 
 #ifdef LOCAL_X_IS_UNIX
-    if( rs[Rs_display_name][0] == ':' )
+    /*
+     * 2008-04-29 gi1242: Force UNIX sockets for security (Gentoo Bug #219750)
+     */
+    if( IS_NULL( rs[Rs_display_name] ) )
+	rs[Rs_display_name] = getenv( "DISPLAY" );
+
+    if( rs[Rs_display_name] && rs[Rs_display_name][0] == ':' )
     {
-	int	l = 5 + STRLEN(rs[Rs_display_name]);
+	char *val;
+	int l = 5 + STRLEN(rs[Rs_display_name]);
 	if (l <= 0 || l > 1024) /* possible integer overflow */
 	    l = 1024;
+
 	val = rxvt_malloc(l);
-	STRCPY(val, "unix");
-	STRNCAT(val, rs[Rs_display_name], l-5);
-	val[l-1] = (char) 0;
-	rxvt_msg (DBG_INFO, DBG_INIT, "Open X display %s\n", val);
-	r->Xdisplay = XOpenDisplay(val);
-	rxvt_free(val);
+	STRCPY( val, "unix");
+	STRNCAT( val, rs[Rs_display_name], l-5);
+
+	rs[Rs_display_name] = val;
     }
-#endif
+#endif /* LOCAL_X_IS_UNIX */
 
-    if (IS_NULL(r->Xdisplay))
+    rxvt_msg( DBG_INFO, DBG_INIT, "Open X display %s\n", rs[Rs_display_name] );
+    r->Xdisplay = XOpenDisplay( rs[Rs_display_name] );
+    if( IS_NULL(r->Xdisplay) )
     {
-	rxvt_msg (DBG_INFO, DBG_INIT, "Open X display %s\n",
-		    rs[Rs_display_name] ? rs[Rs_display_name] : "nil");
-	r->Xdisplay = XOpenDisplay( rs[Rs_display_name] );
-	if (IS_NULL(r->Xdisplay))
-	{
-	    rxvt_msg (DBG_ERROR, DBG_INIT,  "can't open display %s", rs[Rs_display_name] );
-	    exit( EXIT_FAILURE );
-	}
+	rxvt_msg( DBG_ERROR, DBG_INIT, "Error opening display %s\n",
+		rs[Rs_display_name] );
+	exit( EXIT_FAILURE );
     }
 
 



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2008-04-30  7:02 99% [gentoo-commits] gentoo-x86 commit in x11-terms/mrxvt/files: mrxvt-0.5.3-display-security.patch Krzysiek Pawlik (nelchael)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox