public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Krzysiek Pawlik (nelchael)" <nelchael@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in x11-terms/mrxvt/files: mrxvt-0.5.3-display-security.patch
Date: Wed, 30 Apr 2008 07:02:28 +0000	[thread overview]
Message-ID: <E1Jr6Ki-0007ar-Di@stork.gentoo.org> (raw)

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



                 reply	other threads:[~2008-04-30  7:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Jr6Ki-0007ar-Di@stork.gentoo.org \
    --to=nelchael@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox