[yast-commit] r44223 - in /trunk/core: agents-non-y2/ag_hostnames package/yast2-core.changes yast2-core.spec.in
Author: mvidner Date: Thu Feb 7 10:35:41 2008 New Revision: 44223 URL: http://svn.opensuse.org/viewcvs/yast?rev=44223&view=rev Log: Test ports using bash's /dev/tcp instead of netcat (bnc#264309). Modified: trunk/core/agents-non-y2/ag_hostnames trunk/core/package/yast2-core.changes trunk/core/yast2-core.spec.in Modified: trunk/core/agents-non-y2/ag_hostnames URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-non-y2/ag_hostnames?rev=44223&r1=44222&r2=44223&view=diff ============================================================================== --- trunk/core/agents-non-y2/ag_hostnames (original) +++ trunk/core/agents-non-y2/ag_hostnames Thu Feb 7 10:35:41 2008 @@ -24,8 +24,6 @@ # We want to parse English output export LC_ALL=C -NETCAT=/usr/bin/netcat - # this function is duplicated in ag_showexports and ag_hostnames # after $1 seconds, kill $2 and all its children # return $2's exit status @@ -88,9 +86,17 @@ } # uses exit status +# is_port_open_long $ADDR $PORT +function is_port_open_long() { + # open (and close) a connection + exec 3<>/dev/tcp/$1/$2 && exec 3<&- +} + +# uses exit status # is_port_open $ADDR $PORT function is_port_open() { - $NETCAT -w 1 -z $1 $2 + is_port_open_long $1 $2 & + kill_after 2 $! } # uses exit status @@ -172,12 +178,8 @@ hostnames ;; 'Read (.,'*) - if [ -x $NETCAT ]; then PORT=$(echo "$COMMAND" | sed 's/^Read (., *\(.*\))/\1/') hostnames -p $PORT - else - echo '[ ".install.netcat.rpm" ]' - fi ;; 'Read (.rpc,'*) SERVICE=$(echo "$COMMAND" | sed 's/^Read (.rpc, *"\(.*\)")/\1/') Modified: trunk/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=44223&r1=44222&r2=44223&view=diff ============================================================================== --- trunk/core/package/yast2-core.changes (original) +++ trunk/core/package/yast2-core.changes Thu Feb 7 10:35:41 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Feb 7 10:35:35 CET 2008 - mvidner@suse.cz + +- Test ports using bash's /dev/tcp instead of netcat (bnc#264309). + +------------------------------------------------------------------- Wed Feb 6 14:19:47 CET 2008 - sh@suse.de - Moved macro recording and playing out of YUI class into new Modified: trunk/core/yast2-core.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/yast2-core.spec.in?rev=44223&r1=44222&r2=44223&view=diff ============================================================================== --- trunk/core/yast2-core.spec.in (original) +++ trunk/core/yast2-core.spec.in Thu Feb 7 10:35:41 2008 @@ -25,8 +25,6 @@ BuildRequires: boost-devel Summary: - -# ag_hostnames: .net.hostnames (#264309) -Recommends: netcat Requires: perl = %{perl_version} Provides: liby2util = 2.16.1 Obsoletes: liby2util < 2.16.1 -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mvidner@svn.opensuse.org