Bug 257653 - security/gvm-libs: 21.4.1 build fails (incomplete type 'crypt_data', etc.)
Summary: security/gvm-libs: 21.4.1 build fails (incomplete type 'crypt_data', etc.)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-06 10:37 UTC by John Hein
Modified: 2021-09-05 02:13 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments
[patch] don't build code that requires crypt_r on 11.x (2.31 KB, patch)
2021-08-06 15:36 UTC, John Hein
jcfyecrayz: maintainer-approval? (acm)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2021-08-06 10:37:46 UTC
security/gvm-libs on 11-stable/amd64 is exhibiting a build failure. LDAP and RADIUS options are off.

 .
 .
[ 57% 30/47] /usr/bin/cc -DGVM_LIBS_VERSION=\"21.4.1\" -DREDIS_SOCKET_PATH=\"/var/run/redis/redis.sock\" -Dgvm_util_shared_EXPORTS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/libxml2 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC -MD -MT util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o -MF util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o.d -o util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o -c /usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c
FAILED: util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o 
/usr/bin/cc -DGVM_LIBS_VERSION=\"21.4.1\" -DREDIS_SOCKET_PATH=\"/var/run/redis/redis.sock\" -Dgvm_util_shared_EXPORTS -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/libxml2 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC -MD -MT util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o -MF util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o.d -o util/CMakeFiles/gvm_util_shared.dir/passwordbasedauthentication.c.o -c /usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:204:21: error: invalid application of 'sizeof' to an incomplete type 'struct crypt_data'
  data = calloc (1, sizeof (struct crypt_data));
                    ^      ~~~~~~~~~~~~~~~~~~~
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:185:10: note: forward declaration of 'struct crypt_data'
  struct crypt_data *data = NULL;
         ^
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:205:10: warning: implicit declaration of function 'crypt_r' is invalid in C99 [-Wimplicit-function-declaration]
  rslt = crypt_r (password, settings, data);
         ^
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:205:8: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
  rslt = crypt_r (password, settings, data);
       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:241:25: error: invalid application of 'sizeof' to an incomplete type 'struct crypt_data'
      data = calloc (1, sizeof (struct crypt_data));
                        ^      ~~~~~~~~~~~~~~~~~~~
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:232:10: note: forward declaration of 'struct crypt_data'
  struct crypt_data *data = NULL;
         ^
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:255:13: warning: implicit declaration of function 'crypt_r' is invalid in C99 [-Wimplicit-function-declaration]
      cmp = crypt_r (password ? password : "", tmp, data);
            ^
/usr/ports/security/gvm-libs/work/gvm-libs-21.4.1/util/passwordbasedauthentication.c:255:11: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
      cmp = crypt_r (password ? password : "", tmp, data);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings and 2 errors generated.
Comment 1 John Hein 2021-08-06 15:36:28 UTC
Created attachment 226993 [details]
[patch] don't build code that requires crypt_r on 11.x

This patch fixes the problem on 11.x (which does not have crypt_r).  No change for 12.x+

The patch skips compiling pba_hash() and pba_verify_hash() on FreeBSD 11.x which (currently) does not have crypt_r(3).

This can be removed when support for 11.x is no longer needed in the ports tree.

A better upstream patch might be to detect the missing crypt_r(3) via cmake.  But this patch seemed easier - and it addresses a short-lived problem during the remaining time until 11.x is EOL.

But if someone else wants to touch cmake for this, feel free.  I might be more inclined to do that myself were it not cmake.

There is no need to bump PORTREVISION for this as it fixes a build bug which prevents any packages to be generated for 11.x anyway.

openvas builds fine with this change.

QA:
 poudriere - ok (stable-11/amd64)
 portlint - ok (no new warnings or errors, but there are lots of pre-existing ones that could be addressed - these are not in the scope of this bug)
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-09-05 02:12:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a65d2f7cdef55aee89e8fc9984df706eff65538a

commit a65d2f7cdef55aee89e8fc9984df706eff65538a
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2021-09-05 02:06:04 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2021-09-05 02:11:19 +0000

    security/gvm: update to 21.4.2

    The following ports part of security gvm were updated

    security/gvmd: Update to 21.4.3
    security/gvm-libs: Update to 21.4.2
    security/openvas: Update to 21.4.2
    security/py-ospd-openvas: Update to 21.4.2
    security/py-ospd: Update to 21.4.3
    security/greenbone-security-assistant: Update to 21.4.2

    - Fix build on FreeBSD 11 [1]
    PR:             257653
    Reported by:    John Hein <jcfyecrayz _ at _ liamekaens.com> [1]

 security/greenbone-security-assistant/Makefile     |  2 +-
 security/greenbone-security-assistant/distinfo     |  6 +++---
 .../files/patch-gsad_CMakeLists.txt                | 23 +++++++++++-----------
 security/gvm-libs/Makefile                         |  2 +-
 security/gvm-libs/distinfo                         |  6 +++---
 .../files/patch-util_passwordbasedauthentication.c | 21 +++++++++++++++++---
 .../patch-util_passwordbasedauthentication.h (new) | 15 ++++++++++++++
 security/gvm-libs/pkg-plist                        | 10 +++++-----
 security/gvm/Makefile                              |  2 +-
 security/gvmd/Makefile                             |  2 +-
 security/gvmd/distinfo                             |  6 +++---
 security/gvmd/pkg-plist                            |  2 +-
 security/openvas/Makefile                          |  2 +-
 security/openvas/distinfo                          |  6 +++---
 security/openvas/pkg-plist                         |  4 ++--
 security/py-ospd-openvas/Makefile                  |  2 +-
 security/py-ospd-openvas/distinfo                  |  6 +++---
 security/py-ospd/Makefile                          |  2 +-
 security/py-ospd/distinfo                          |  6 +++---
 security/py-ospd/files/patch-setup.py (new)        | 11 +++++++++++
 20 files changed, 89 insertions(+), 47 deletions(-)
Comment 3 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2021-09-05 02:13:40 UTC
- Committed thanks!