Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Apr 2013 21:28:25 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249955 - in head/usr.sbin/bsdconfig/share: . media
Message-ID:  <201304262128.r3QLSPaI058312@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Fri Apr 26 21:28:24 2013
New Revision: 249955
URL: http://svnweb.freebsd.org/changeset/base/249955

Log:
  Properly sanitize --menu results (guards against Gtk library warnings from
  X11 side of things from bleeding into Xdialog(1) stderr output). It should
  be duely noted that such errors are not a by-product of anything in the
  Xdialog(1) utility or API, but optional libraries that it can link against
  (such as Gtk1 versus Gtk2; if you compile xdialog from ports against Gtk2
  AND misconfigure your fonts or generally make Gtk2 unhappy, these warning
  messages can bleed into the captured stderr -- that is we we sanitize!).

Modified:
  head/usr.sbin/bsdconfig/share/device.subr
  head/usr.sbin/bsdconfig/share/media/tcpip.subr

Modified: head/usr.sbin/bsdconfig/share/device.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/device.subr	Fri Apr 26 21:19:05 2013	(r249954)
+++ head/usr.sbin/bsdconfig/share/device.subr	Fri Apr 26 21:28:24 2013	(r249955)
@@ -645,7 +645,12 @@ f_device_menu()
 
 	[ "$errexit" ] && set -e
 
-	[ $retval -eq 0 ] && echo "$mtag" >&2
+	if [ $retval -eq 0 ]; then
+		# Clean up the output of [X]dialog(1) and return it
+		setvar DIALOG_MENU_$$ "$mtag"
+		mtag=$( f_dialog_menutag )
+		echo "$mtag" >&2
+	fi
 
 	return $retval
 }

Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/media/tcpip.subr	Fri Apr 26 21:19:05 2013	(r249954)
+++ head/usr.sbin/bsdconfig/share/media/tcpip.subr	Fri Apr 26 21:28:24 2013	(r249955)
@@ -1399,6 +1399,8 @@ f_device_dialog_tcp()
 					2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 				)
 				local retval=$?
+				setvar DIALOG_MENU_$$ "$cp"
+				cp=$( f_dialog_menutag )
 				f_dprintf "retval=%u mtag=[%s]" $retval "$cp"
 
 				if [ $retval -eq 2 ]; then



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304262128.r3QLSPaI058312>