[ZBX-19126] Configure is not able to check libssh version with libssh 0.9.5 on Alpine linux Created: 2021 Mar 17  Updated: 2024 Apr 10  Resolved: 2021 Mar 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Packages (C)
Affects Version/s: 5.0.9, 5.2.5, 5.4.0beta1
Fix Version/s: 5.4 (plan)

Type: Problem report Priority: Critical
Reporter: Edgar Akhmetshin Assignee: Rostislav Palivoda
Resolution: Duplicate Votes: 0
Labels: Alpine, Docker, configure, libssh
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Docker 20.10.5


Issue Links:
Duplicate
duplicates ZBX-18553 SSH agent is limited to 64KB Closed
Team: Team C
Sprint: Sprint 74 (Mar 2021)
Story Points: 0.1

 Description   

Steps to reproduce:

  1. Install official Docker CE
  2. run Alpine 3.13/3.12:
    docker run -it alpine:3.12 /bin/sh
    docker run -it alpine:3.13 /bin/sh
    
  3. install libssh-dev on both containers:
    apk add libssh-dev
    
  4. check presence of the version string:
    on 3.13:
    cat /usr/include/libssh/libssh.h|grep -i LIBSSH_VERSION
    #include <libssh/libssh_version.h>
    on 3.12:
    cat /usr/include/libssh/libssh.h  | egrep \#define.*'LIBSSH_VERSION_MAJOR'
    #define LIBSSH_VERSION_MAJOR  0
    
  5. check libssh.m4 used with Zabbix during configure step:
      if test "x$want_ssh" = "xyes"; then
         AC_MSG_CHECKING(for SSH support)
         if test "x$_libssh_dir" = "xno"; then
           if test -f /usr/include/libssh/libssh.h; then
             SSH_CFLAGS=-I/usr/include
             SSH_LDFLAGS=-L/usr/lib
             SSH_LIBS="-lssh"
             found_ssh="yes"
    	 LIBSSH_ACCEPT_VERSION([/usr/include/libssh/libssh.h])
           elif test -f /usr/local/include/libssh/libssh.h; then
             SSH_CFLAGS=-I/usr/local/include
             SSH_LDFLAGS=-L/usr/local/lib
             SSH_LIBS="-lssh"
             found_ssh="yes"
    	 LIBSSH_ACCEPT_VERSION([/usr/local/include/libssh/libssh.h])
           else #libraries are not found in default directories
             found_ssh="no"
             AC_MSG_RESULT(no)
           fi # test -f /usr/include/libssh/libssh.h; then
         else # test "x$_libssh_dir" = "xno"; then
           if test -f $_libssh_dir/include/libssh/libssh.h; then
    	 SSH_CFLAGS=-I$_libssh_dir/include
             SSH_LDFLAGS=-L$_libssh_dir/lib
             SSH_LIBS="-lssh"
             found_ssh="yes"
    	 LIBSSH_ACCEPT_VERSION([$_libssh_dir/include/libssh/libssh.h])
           else #if test -f $_libssh_dir/include/libssh/libssh.h; then
             found_ssh="no"
             AC_MSG_RESULT(no)
           fi #test -f $_libssh_dir/include/libssh/libssh.h; then
         fi #if test "x$_libssh_dir" = "xno"; then
      fi # if test "x$want_ssh" != "xno"; then
    
    ...
    
    AC_DEFUN([LIBSSH_ACCEPT_VERSION],
    [
    	# Zabbix minimal major supported version of libssh:
    	minimal_libssh_major_version=0
    	minimal_libssh_minor_version=6
    
    	# get the major version
    	found_ssh_version_major=`cat $1 | $EGREP \#define.*'LIBSSH_VERSION_MAJOR ' | $AWK '{print @S|@3;}'`
    	found_ssh_version_minor=`cat $1 | $EGREP \#define.*'LIBSSH_VERSION_MINOR ' | $AWK '{print @S|@3;}'`
    
    	if test $((found_ssh_version_major)) -gt $((minimal_libssh_major_version)); then
    		accept_ssh_version="yes"
    	elif test $((found_ssh_version_major)) -lt $((minimal_libssh_major_version)); then
    		accept_ssh_version="no"
    	elif test $((found_ssh_version_minor)) -ge $((minimal_libssh_minor_version)); then
    		accept_ssh_version="yes"
    	else
    		accept_ssh_version="no"
    	fi;
    ])dnl 
    

Result:
checking for SSH support... yes
configure: error: SSH library version requirement not met (>= 0.6.0)

Expected:
Correct configure/build procedure.



 Comments   
Comment by Alexander Vladishev [ 2021 Mar 18 ]

Closed as duplicate of ZBX-18553.

Generated at Fri May 09 05:37:11 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.