Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19126

Configure is not able to check libssh version with libssh 0.9.5 on Alpine linux

XMLWordPrintable

    • Team C
    • Sprint 74 (Mar 2021)
    • 0.1

      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.

            palivoda Rostislav Palivoda
            edgar.akhmetshin Edgar Akhmetshin
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: