Commit cf73a5c9 authored by ghpzin's avatar ghpzin
Browse files

vsftpd: fix build with gcc15

- add patch from fedora, fixing `setup_bio_callbacks` definition

Fixes build failure with gcc15:
```
ssl.c: In function 'ssl_accept':
ssl.c:493:3: error: too many arguments to function 'setup_bio_callbacks';
expected 0, have 1
  493 |   setup_bio_callbacks(p_ssl);
      |   ^~~~~~~~~~~~~~~~~~~ ~~~~~
ssl.c:37:13: note: declared here
   37 | static void setup_bio_callbacks();
      |             ^~~~~~~~~~~~~~~~~~~
ssl.c: In function 'ssl_session_init':
ssl.c:647:3: error: too many arguments to function 'setup_bio_callbacks';
expected 0, have 1
  647 |   setup_bio_callbacks(p_ssl);
      |   ^~~~~~~~~~~~~~~~~~~ ~~~~~
ssl.c:37:13: note: declared here
   37 | static void setup_bio_callbacks();
      |             ^~~~~~~~~~~~~~~~~~~
ssl.c: At top level:
ssl.c:692:13: error: conflicting types for 'setup_bio_callbacks'; have
'void(SSL *)' {aka 'void(struct ssl_st *)'}
  692 | static void setup_bio_callbacks(SSL* p_ssl)
      |             ^~~~~~~~~~~~~~~~~~~
ssl.c:37:13: note: previous declaration of 'setup_bio_callbacks' with
type 'void(void)'
   37 | static void setup_bio_callbacks();
      |             ^~~~~~~~~~~~~~~~~~~
```
parent ef6712a9
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  libcap,
  libseccomp,
  openssl,
@@ -27,7 +28,16 @@ stdenv.mkDerivation rec {
    libxcrypt
  ];

  patches = [ ./CVE-2015-1419.patch ];
  patches = [
    ./CVE-2015-1419.patch

    # Fix build with gcc15
    (fetchpatch {
      name = "vsftpd-correct-the-definition-of-setup_bio_callbacks-in-ssl.patch";
      url = "https://src.fedoraproject.org/rpms/vsftpd/raw/c31087744900967ff4d572706a296bf6c8c4a68e/f/0076-Correct-the-definition-of-setup_bio_callbacks-in-ssl.patch";
      hash = "sha256-eYiY2eKQ+qS3CiRZYGuRHcnAe32zLDdb/GwF6NyHch4=";
    })
  ];

  postPatch = ''
    sed -i "/VSF_BUILD_SSL/s/^#undef/#define/" builddefs.h