Your message dated Wed, 29 Nov 2023 16:36:14 +0000
with message-id <e1r8nxq-002och...@fasolo.debian.org>
and subject line Bug#1056348: fixed in libssh2 1.11.0-3
has caused the Debian Bug report #1056348,
regarding FTBFS: tests fail in clean environment
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1056348: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056348
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: libssh2
Version: 1.9.0-2
Severity: serious
Tags: ftbfs patch

Hi!

Building libssh2 using debuild in a clean local chroot, I get test
failures and even a core dump!

...

PASS: mansyntax.sh                                                              
                                                                                
                                        
PASS: test_simple                                                               
                                                                                
                                        
FAIL: test_sshd.test 1 - sshd-test_ssh2                                         
                                                                                
                                        
FAIL: test_sshd.test 2 - sshd-test_auth_pubkey_ok_ed25519                       
                                                                                
                                        
=====================================                                           
                                                                                
                                        
   libssh2 -: tests/test-suite.log
=====================================

# TOTAL: 4
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_sshd
===============

Fingerprint: 12 FD AD 1E 3B 31 B1 0B AB B0 0F 2A 8D 1B 9A 62 C3 26 BD 2F 
Authentication methods: publickey,password,keyboard-interactive
Authentication by public key failed!
all done
./test_sshd.test: line 131: 2476672 Segmentation fault      (core dumped) 
"${test}"
# sshd executable: '/usr/sbin/sshd' (OpenSSH_9.4, OpenSSL 3.0.12 24 Oct 2023)
# ssh executable: '/usr/bin/ssh' (OpenSSH_9.4p1 Debian-1, OpenSSL 3.0.12 24 Oct 
2023)
1..2
not ok 1 - sshd-test_ssh2
FAIL: test_sshd.test 1 - sshd-test_ssh2
not ok 2 - sshd-test_auth_pubkey_ok_ed25519
FAIL: test_sshd.test 2 - sshd-test_auth_pubkey_ok_ed25519

============================================================================
Testsuite summary for libssh2 -
============================================================================
# TOTAL: 4
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
============================================================================

These are both down to environment: the test code assumes that "USER"
is a valid environment varliable, which is not necessarily
true. Here's a patch which fixes this for these two tests, and fails
cleanly with diagnostics if there's a problem.

-- System Information:
Debian Release: 11.8
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 
'oldoldstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-26-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff --git a/tests/session_fixture.c b/tests/session_fixture.c
index 3bb9da2..4671117 100644
--- a/tests/session_fixture.c
+++ b/tests/session_fixture.c
@@ -430,11 +430,18 @@ int test_auth_pubkey(LIBSSH2_SESSION *session, int flags,
 
     /* Ignore our hard-wired Dockerfile user when not running under Docker */
     if(!openssh_fixture_have_docker() && strcmp(username, "libssh2") == 0) {
-        username = getenv("USER");
+        if(getenv("USER"))
+            username = getenv("USER");
+        else if(getenv("LOGNAME"))
+            username = getenv("LOGNAME");
 #ifdef WIN32
-        if(!username)
+        else if(getenv("USERNAME"))
             username = getenv("USERNAME");
 #endif
+        else {
+            fprintf(stderr, "Failed to find a username from env\n");
+            return 1;
+        }
     }
 
     userauth_list = libssh2_userauth_list(session, username,
diff --git a/tests/test_ssh2.c b/tests/test_ssh2.c
index a637cdc..6e28598 100644
--- a/tests/test_ssh2.c
+++ b/tests/test_ssh2.c
@@ -63,10 +63,16 @@ int main(int argc, char *argv[])
 
     if(getenv("USER"))
         username = getenv("USER");
+    else if(getenv("LOGNAME"))
+        username = getenv("LOGNAME");
 #ifdef WIN32
     else if(getenv("USERNAME"))
         username = getenv("USERNAME");
 #endif
+    else {
+        fprintf(stderr, "Failed to find a username from env\n");
+        return 1;
+    }
 
     if(getenv("PRIVKEY"))
         privkey = getenv("PRIVKEY");

--- End Message ---
--- Begin Message ---
Source: libssh2
Source-Version: 1.11.0-3
Done: Nicolas Mora <babelou...@debian.org>

We believe that the bug you reported is fixed in the latest version of
libssh2, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1056...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Nicolas Mora <babelou...@debian.org> (supplier of updated libssh2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 28 Nov 2023 13:12:56 -0500
Source: libssh2
Architecture: source
Version: 1.11.0-3
Distribution: unstable
Urgency: medium
Maintainer: Nicolas Mora <babelou...@debian.org>
Changed-By: Nicolas Mora <babelou...@debian.org>
Closes: 1056348
Changes:
 libssh2 (1.11.0-3) unstable; urgency=medium
 .
   * d/patch: Backport PR-1241 from upstream (Closes: #1056348)
Checksums-Sha1:
 bb88287483b11d08d66b0a9d088bf0c4d7cd95f8 2289 libssh2_1.11.0-3.dsc
 fbdb4751a4bc93e895e9c3426f7f80b437d250fe 1053562 libssh2_1.11.0.orig.tar.gz
 45356748f83d27fe878dd5d963d1d1dbcc3298c7 488 libssh2_1.11.0.orig.tar.gz.asc
 a14ac665f57463a3936151b71ec9589257f40aa5 10504 libssh2_1.11.0-3.debian.tar.xz
 36413313e2ba528546b6aa73290f422b44b427d0 7454 libssh2_1.11.0-3_amd64.buildinfo
Checksums-Sha256:
 250dad54817026377b10349f9ae2a59c2245fc01544fbc05ee32930938d19d01 2289 
libssh2_1.11.0-3.dsc
 3736161e41e2693324deb38c26cfdc3efe6209d634ba4258db1cecff6a5ad461 1053562 
libssh2_1.11.0.orig.tar.gz
 b6a32c85a3f9b6f30f2b3595ba034b48a8508ee9c94708ef811f58fd7adfcdee 488 
libssh2_1.11.0.orig.tar.gz.asc
 4c3443c6549f57496c219d0134766f81a4c97cde40daad1ce4ef8aa468934cd6 10504 
libssh2_1.11.0-3.debian.tar.xz
 14636a9986fa07d30e204892b1e6bc78f428142dbc96389c2081bdc2e99a3e3f 7454 
libssh2_1.11.0-3_amd64.buildinfo
Files:
 8c045fbbb2c4c93579b45330071644d3 2289 libs optional libssh2_1.11.0-3.dsc
 a01d543fd891ca48fe47726540d50b17 1053562 libs optional 
libssh2_1.11.0.orig.tar.gz
 afe042f2abfbc990ba9f9081af7f9887 488 libs optional 
libssh2_1.11.0.orig.tar.gz.asc
 4069c0f83e88115ee5ebf86ee14b4d8d 10504 libs optional 
libssh2_1.11.0-3.debian.tar.xz
 578cbc7f995f52489e8f299b9b9e51ba 7454 libs optional 
libssh2_1.11.0-3_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEhAWwL8wo75dEyPJT/oITlEC9IrkFAmVmY50ACgkQ/oITlEC9
IrlHGw/+KT2LdQJcAXfXNY/KO619KhSf/flrviI80me64BXA1zhX/APKw6mN23XD
f14FD+WKnGVsCQ2DE6iCUM/8I9p8k79txQ6XtK8A/DtkYJ8WGW/AsP2LmaFsuei4
CatXHC805ApiSgG9268oyJwgeYBOtvGiGccYgbXdtN2XuzRBosnh4Hh4w4bJWj8v
/UlCEyBsufQov/hzzxRMQZpjhpksfR6uPz6bij7RuylCl8PK6RexpxyYYZHSP2l3
gwuGPHwsmlM+Cn0gU2QY1pEeAyBKKuvKOYfJwgwdOyShORf7Bho5VgsT96YI6Wnv
x6S5+w3Lf7/2iFU7Jslyo5PKuQzd4kwfOHNadJVczAzJA9azyJ36MrWZNsU+hrpX
YdkgE9K1IUgvfsChkXCgY3hpAmXJ52WAwE6o+u7Nc+cERV5psYqK5d0t5NeKHAnq
wf57zufYfHCCWIURupkKhCtbH2t1HafY/HdDxjg32YhSzI0rt/fYCfN1O192I+ut
G3UEFDPVWBec/R9Hgd5cctoxGjnOLUqORvaLl8TA0ffPr76U3JM4m9rBGTlM7QaC
fI8apdwTJyWJhOn+Drc97epLoNl6E/pOwrq6P1WmXtQtLoSZkV1hC1nB8bOXsPA0
mIHXxhwxH4JGrOv65X9ji3u0daf//sALfFMCDBQI5AXHFu6RLCA=
=tFfg
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to