Hi,

On Thu, Nov 7, 2013 at 9:12 PM, <chru...@suse.cz> wrote:

> Hi!
> > for example:
> >     $ finger @xxxx || echo "test fail"
> >     finger: unknown host: xxxx
> >     getaddrinfo: No address associated with hostname
> >     test fail
>
> Hmm, at my computers (SUSE, Gentoo) it works as:
>
> $ finger @xxxx || echo "test fail"
> finger: unknown host: xxxx
>
> Are you sure that finger returns nonzero? From what package and what
> version does your finger come from?
>
Yes, it returns nonzero in ubuntu. I have tested it in centos before, it
returned zero same as your enviroment. I thinks it doen't relative to the
package version, because it also happened in netstat test. I considerd that
the default shell in ubuntu is dash not bash before, but it doesn't help
even I forced to use bash. Maybe it cause by the bash version or something
else, I could find the root cause yet. If you have time can you test it in
debian based distribution?

However, I gave by finger and bash package version below, it seems applying
some patch not pure packages.

apt-get source finger
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'bsd-finger' as source package instead of 'finger'
Need to get 37.6 kB of source archives.
Get:1 http://ubuntu.cs.nctu.edu.tw/ubuntu/ precise/main bsd-finger 0.17-14
(dsc) [1,653 B]
Get:2 http://ubuntu.cs.nctu.edu.tw/ubuntu/ precise/main bsd-finger 0.17-14
(tar) [25.5 kB]
Get:3 http://ubuntu.cs.nctu.edu.tw/ubuntu/ precise/main bsd-finger 0.17-14
(diff) [10.4 kB]
Fetched 37.6 kB in 0s (168 kB/s)
gpgv: Signature made Fri 12 Feb 2010 02:03:58 PM CST using RSA key ID
947897D8
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./bsd-finger_0.17-14.dsc
dpkg-source: info: extracting bsd-finger in bsd-finger-0.17
dpkg-source: info: unpacking bsd-finger_0.17.orig.tar.gz
dpkg-source: info: unpacking bsd-finger_0.17-14.debian.tar.bz2
dpkg-source: info: applying 01-legacy.patch
dpkg-source: info: applying 02-518559-nsswitch-sources.patch
dpkg-source: info: applying 03-468454-fingerd-ipv6.patch
dpkg-source: info: applying 04-468454-finger-ipv6.patch
dpkg-source: info: applying 05-547014-netgroup.patch

apt-get source bash
Reading package lists... Done
Building dependency tree
Reading state information... Done
NOTICE: 'bash' packaging is maintained in the 'Bzr' version control system
at:
http://bazaar.launchpad.net/~doko/+junk/pkg-bash-debian
Please use:
bzr branch http://bazaar.launchpad.net/~doko/+junk/pkg-bash-debian
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 4,355 kB of source archives.
Get:1 http://ubuntu.cs.nctu.edu.tw/ubuntu/ precise-updates/main bash
4.2-2ubuntu2.1 (dsc) [2,234 B]
Get:2 http://ubuntu.cs.nctu.edu.tw/ubuntu/ precise-updates/main bash
4.2-2ubuntu2.1 (tar) [4,266 kB]
Get:3 http://ubuntu.cs.nctu.edu.tw/ubuntu/ precise-updates/main bash
4.2-2ubuntu2.1 (diff) [86.6 kB]
Fetched 4,355 kB in 5s (791 kB/s)
gpgv: Signature made Tue 19 Mar 2013 06:46:05 AM CST using RSA key ID
8B3C16AE
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on
./bash_4.2-2ubuntu2.1.dsc
dpkg-source: info: extracting bash in bash-4.2
dpkg-source: info: unpacking bash_4.2.orig.tar.gz
dpkg-source: info: applying bash_4.2-2ubuntu2.1.diff.gz


>
> Btw what is wrong at the code bellow is the redirection, which does not
> work, the >/dev/null should be before the 2>&1. Even if your finger
> really returns nonzero the code bellow is quite cryptic as it looks like
> it redirects all output from the finger into the /dev/null but it really
> just redirects stderr into stdout which goes to the grep...
>
> Yes, I thinks the redirection sequence is weird, I just don't want to do
many modifications of the  original code. Can you help to improve it?


>  > ---
> >  testcases/network/tcp_cmds/finger/finger01 |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/testcases/network/tcp_cmds/finger/finger01
> b/testcases/network/tcp_cmds/finger/finger01
> > index 6a72c8f..a5206be 100755
> > --- a/testcases/network/tcp_cmds/finger/finger01
> > +++ b/testcases/network/tcp_cmds/finger/finger01
> > @@ -116,8 +116,8 @@ do_test2()
> >
> >      tst_resm TINFO "finger -bad user "
> >      finger $BADUSER 2>&1 1>/dev/null || end_testcase "finger $BADUSER"
> > -    finger @$BADHOST 2>&1 1>/dev/null || end_testcase "finger @$BADHOST"
> > -    if ! finger $BADUSER@$BADHOST 2>&1 1>/dev/null; then
> > +    finger @$BADHOST 2>&1 1>/dev/null | grep "finger: unknown host" ||
> end_testcase "finger @$BADHOST"
> > +    if ! finger $BADUSER@$BADHOST 2>&1 1>/dev/null | grep "finger:
> unknown host"; then
> >          end_testcase "finger $BADUSER@$BADHOST"
> >      fi
> >  }
>
> --
> Cyril Hrubis
> chru...@suse.cz
>



-- 
Regards,
Vincent Hsu
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to