www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: Re: libssh2 gmake check failed

Re: libssh2 gmake check failed

From: ctf <serviceman36_at_gmail.com>
Date: Fri, 8 Jan 2010 06:33:20 -0600

Ok. I tried it on some systems here, with
no highly satisfactory results. On my HP-UX
(IA64 and PA-RISC) systems, the build seemed
to work, but I also got the "FAIL: ssh2.sh"
complaint. On my Solaris system, the build
failed (miserably). On my Tru64 system, the
build seemed to work, but the tests/ssh2.sh
script assumes many things about
/usr/sbin/sshd which aren't true there, so it
fails sooner there than on HP-UX.

Thus, to me, it doesn't seem to be highly
portable code, and that test isn't much
better (providing only a pass-fail status,
with no diagnostic info), so I'd either
complain to the maintainer, or ignore the
test and pretend that the code really works,
or else, if possible, try to find some better
code somewhere else.

Inspection of the failing test script reveals
that it's trying to run "/usr/sbin/sshd" (or
whatever SSHD is set to), listening on an
odd-ball port (4711), with a bunch of other
special-case options, and then it runs its
own "tests/ssh2" program, which tries to talk
to this instance of the "sshd" server.

Unfortunately, the "tests/ssh2" program (see
"tests/ssh2.c") expects, by default, to send
the user name "username", and if this is not
a valid user on your system, then the server
spits up. Running it in a diagnostic mode
("-d -e"), and then running "tests/ssh2"
manually:

[...]
Invalid user username from 127.0.0.1
debug1: audit event euid 0 user (unknown user) event 9 (INVALID_USER)
debug1: aud_sav_flag=1
input_userauth_request: invalid user username
debug1: audit event euid 0 user (invalid user) event 9 (INVALID_USER)
debug1: aud_sav_flag=1
debug1: PAM: initializing for "username"
debug1: PAM: setting PAM_RHOST to "localhost"
Failed none for invalid user username from 127.0.0.1 port 52157 ssh2
debug1: audit event euid 0 user (invalid user) event 3 (AUTH_FAIL_NONE)
debug1: userauth-request for user username service ssh-connection method
publickey
debug1: attempt 1 failures 0
Failed publickey for invalid user username from 127.0.0.1 port 52157 ssh2
debug1: Entering record_failed_login uid 0
debug1: audit event euid 0 user (invalid user) event 6 (AUTH_FAIL_PUBKEY)
debug1: aud_sav_flag=1
Received disconnect from 127.0.0.1: 11: Normal Shutdown
debug1: do_cleanup
debug1: PAM: cleanup
debug1: audit event euid 0 user (invalid user) event 12 (CONNECTION_ABANDON)
debug1: aud_sav_flag=1

Without these debug options, the diagnostics
tend to go to the system log file
("/var/adm/syslog/syslog.log"), where you may
find the spoor of the previous test failures.

Luckily, the "tests/ssh2" program looks at
its environment, and if the environment
variable "USER" is defined, then its value is
used instead of "username". So, define
"USER" as some valid user name, and things
may improve.

As before:

dyi # gmake check
Making check in src
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/src'
gmake[1]: Nothing to be done for `check'.
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/src'
Making check in example
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
Making check in simple
gmake[2]: Entering directory
`/usr/local/src/libssh2/libssh2-1.2.2/example/simple'
gmake[2]: Nothing to be done for `check'.
gmake[2]: Leaving directory
`/usr/local/src/libssh2/libssh2-1.2.2/example/simple'
gmake[2]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
gmake[2]: Nothing to be done for `check-am'.
gmake[2]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
Making check in tests
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake simple
gmake[2]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake[2]: `simple' is up to date.
gmake[2]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake check-TESTS
gmake[2]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
PASS: simple
Fingerprint: A0 90 21 52 25 7A 06 7F B9 7B 52 CE FA A6 93 7F
Authentication methods: publickey,password,keyboard-interactive
        Authentication by public key failed!
FAIL: ssh2.sh
====================================================
1 of 2 tests failed
Please report to libssh2-devel_at_lists.sourceforge.net
====================================================
gmake[2]: *** [check-TESTS] Error 1
gmake[2]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake[1]: *** [check-am] Error 2
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake: *** [check-recursive] Error 1

Again, but defining "USER" ("sms" is valid
here):

dyi # USER=sms gmake check
Making check in src
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/src'
gmake[1]: Nothing to be done for `check'.
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/src'
Making check in example
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
Making check in simple
gmake[2]: Entering directory
`/usr/local/src/libssh2/libssh2-1.2.2/example/simple'
gmake[2]: Nothing to be done for `check'.
gmake[2]: Leaving directory
`/usr/local/src/libssh2/libssh2-1.2.2/example/simple'
gmake[2]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
gmake[2]: Nothing to be done for `check-am'.
gmake[2]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/example'
Making check in tests
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake simple
gmake[2]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake[2]: `simple' is up to date.
gmake[2]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake check-TESTS
gmake[2]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
PASS: simple
Fingerprint: A0 90 21 52 25 7A 06 7F B9 7B 52 CE FA A6 93 7F
Authentication methods: publickey,password,keyboard-interactive
        Authentication by public key succeeded.
PASS: ssh2.sh
==================
All 2 tests passed
==================
gmake[2]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/tests'
Making check in docs
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2/docs'
gmake[1]: Nothing to be done for `check'.
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2/docs'
gmake[1]: Entering directory `/usr/local/src/libssh2/libssh2-1.2.2'
gmake[1]: Nothing to be done for `check-am'.
gmake[1]: Leaving directory `/usr/local/src/libssh2/libssh2-1.2.2'

This could all be documented somewhere, but I
didn't see it. Perhaps the sshd programs on
the developers' systems are less fussy than
this one, and don't care if the specified
user name is valid. (Or perhaps they all
have a user named "username".)

Could you re-try with libssh2 from git and running 'env DEBUG=yes make
> check'? It will print out much more debug info that is useful. Use
> tomorrow's daily snapshot if you can't build from git directly.
>
> I wonder if this is a genuine problem with libssh2, or an error in the
> rather simplistic self-test. Could be some compatibility issue with sshd
> too.
>
> /Simon
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-01-08

the libssh2 team