#3 Fix build with GCC 10 (and clang) differently
Merged 3 years ago by aegorenk. Opened 3 years ago by tbaeder.
rpms/ tbaeder/vsftpd master  into  master

@@ -1,33 +0,0 @@ 

- From 8882c5f7788fc2ea7cae824a7fa09b82782fc81e Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>

- Date: Fri, 7 Feb 2020 11:51:46 +0100

- Subject: [PATCH] Fix assignment of an enumerator of a different type

- 

- The kVSFSysStrOpenUnknown enumerator is not part of the

- EVSFSysUtilOpenMode enum. The assignment causes a build failure with

- gcc 10.

- 

- The open_mode variable need not be initialized, because the switch

- statement either sets the variable or causes us to exit.

- 

- Resolves: rhbz#1800239

- ---

-  sysstr.c | 2 +-

-  1 file changed, 1 insertion(+), 1 deletion(-)

- 

- diff --git a/sysstr.c b/sysstr.c

- index d86cdf1..ff2671b 100644

- --- a/sysstr.c

- +++ b/sysstr.c

- @@ -74,7 +74,7 @@ str_chdir(const struct mystr* p_str)

-  int

-  str_open(const struct mystr* p_str, const enum EVSFSysStrOpenMode mode)

-  {

- -  enum EVSFSysUtilOpenMode open_mode = kVSFSysStrOpenUnknown;

- +  enum EVSFSysUtilOpenMode open_mode;

-    switch (mode)

-    {

-      case kVSFSysStrOpenReadOnly:

- -- 

- 2.24.1

- 

file added
+28
@@ -0,0 +1,28 @@ 

+ diff -ruN vsftpd-3.0.3.orig/sysstr.c vsftpd-3.0.3/sysstr.c

+ --- vsftpd-3.0.3.orig/sysstr.c	2020-11-17 09:47:03.872923383 +0100

+ +++ vsftpd-3.0.3/sysstr.c	2020-11-17 09:48:41.219754145 +0100

+ @@ -74,19 +74,11 @@

+  int

+  str_open(const struct mystr* p_str, const enum EVSFSysStrOpenMode mode)

+  {

+ -  enum EVSFSysUtilOpenMode open_mode = kVSFSysStrOpenUnknown;

+ -  switch (mode)

+ -  {

+ -    case kVSFSysStrOpenReadOnly:

+ -      open_mode = kVSFSysUtilOpenReadOnly;

+ -      break;

+ -    case kVSFSysStrOpenUnknown:

+ -      /* Fall through */

+ -    default:

+ -      bug("unknown mode value in str_open");

+ -      break;

+ -  }

+ -  return vsf_sysutil_open_file(str_getbuf(p_str), open_mode);

+ +  if (mode == kVSFSysStrOpenReadOnly)

+ +    return vsf_sysutil_open_file(str_getbuf(p_str), kVSFSysUtilOpenReadOnly);

+ +

+ +  bug("unknown mode value in str_open");

+ +  return -1;

+  }

+  

+  int

file modified
+6 -2
@@ -92,10 +92,10 @@ 

  Patch63: 0001-Set-s_uwtmp_inserted-only-after-record-insertion-rem.patch

  Patch64: 0002-Repeat-pututxline-if-it-fails-with-EINTR.patch

  Patch65: 0001-Repeat-pututxline-until-it-succeeds-if-it-fails-with.patch

- Patch66: 0001-Fix-assignment-of-an-enumerator-of-a-different-type.patch

  Patch67: 0001-Fix-timestamp-handling-in-MDTM.patch

  Patch68: 0002-Drop-an-unused-global-variable.patch

  Patch69: 0001-Remove-a-hint-about-the-ftp_home_dir-SELinux-boolean.patch

+ Patch70: fix-str_open.patch

  

  %description

  vsftpd is a Very Secure FTP daemon. It was written completely from
@@ -111,7 +111,7 @@ 

  %else

  %make_build CFLAGS="$RPM_OPT_FLAGS -fpie -pipe -Wextra -Werror" \

  %endif

-         LINK="-pie -lssl" %{?_smp_mflags}

+         LINK="-pie -lssl $RPM_LD_FLAGS" %{?_smp_mflags}

  

  %install

  mkdir -p $RPM_BUILD_ROOT%{_sbindir}
@@ -164,6 +164,10 @@ 

  %{_var}/ftp

  

  %changelog

+ * Wed Nov 27 2020 Timm Bäder<tbaeder@redhat.com> - 3.0.3-41

+ - Fix str_open() so it doesn't warn when compiled with clang

+ - Pass $RPM_LD_FLAGS when linking

+ 

  * Mon Nov 02 2020 Artem Egorenkov <aegorenk@redhat.com> - 3.0.3-40

  - Unit files fixed "After=network-online.target"

  

See commit message.

The second commit just passes the appropriate ldflags we get from rpm to $LINK.

Thanks for the PR.
Could you, please, add entries in spec %changelog with descriptions.

1 new commit added

  • Update changelog
3 years ago

Hi,

thanks for the reply. I've added a commit that updates the changelog.

Pull-Request has been merged by aegorenk

3 years ago