GNU bug report logs - #43554
[PATCH] gnu: samba: Fix fcntl hint detection in configure script.

Previous Next

Package: guix-patches;

Reported by: Pierre Langlois <pierre.langlois <at> gmx.com>

Date: Mon, 21 Sep 2020 19:45:01 UTC

Severity: normal

Tags: patch

Done: Pierre Langlois <pierre.langlois <at> gmx.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43554 in the body.
You can then email your comments to 43554 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#43554; Package guix-patches. (Mon, 21 Sep 2020 19:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Langlois <pierre.langlois <at> gmx.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 21 Sep 2020 19:45:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Langlois <pierre.langlois <at> gmx.com>
To: Guix-patches <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: samba: Fix fcntl hint detection in configure script.
Date: Mon, 21 Sep 2020 20:44:38 +0100
[Message part 1 (text/plain, inline)]
Hello Guix!

While trying to get the Gnome desktop up and running on a Pinebook Pro
running Guix, I hit issues building samba.  It turned out there was a
bug in the configure script which just happened to work on x86_64 by
chance.

See <https://bugzilla.samba.org/show_bug.cgi?id=14503> for more details,
then we can backport the patch from upstream.

Thanks,
Pierre

[signature.asc (application/pgp-signature, inline)]
[0001-gnu-samba-Fix-fcntl-hint-detection-in-configure-scri.patch (text/x-patch, inline)]
From dc3c16fc1908a17cf834730f13d9ebff82091170 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois <at> gmx.com>
Date: Sat, 19 Sep 2020 23:57:41 +0100
Subject: [PATCH] gnu: samba: Fix fcntl hint detection in configure script.

The configure script generates a C program to detect support for
lifetime hints on files.  But this program could crash, potentially
leaving a stale unreadable file behind which could cause the
patch-generated-file-shebang phase to fail.

Reported upstream <https://bugzilla.samba.org/show_bug.cgi?id=14503>.

* gnu/packages/patches/patches/samba-fix-fcntl-hint-detection.patch: New
file.
* gnu/packages/samba.scm (samba)[origin]: Add patch.
* gnu/local.mk (dist_patch_DATA): Register patch.
---
 gnu/local.mk                                  |  1 +
 .../samba-fix-fcntl-hint-detection.patch      | 55 +++++++++++++++++++
 gnu/packages/samba.scm                        |  2 +
 3 files changed, 58 insertions(+)
 create mode 100644 gnu/packages/patches/samba-fix-fcntl-hint-detection.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ba7c7f373d..a22a1029ab 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1405,6 +1405,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/pango-skip-libthai-test.patch		\
   %D%/packages/patches/pciutils-hurd-configure.patch		\
   %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch		\
+  %D%/packages/patches/samba-fix-fcntl-hint-detection.patch		\
   %D%/packages/patches/sdl-pango-api_additions.patch		\
   %D%/packages/patches/sdl-pango-blit_overflow.patch		\
   %D%/packages/patches/sdl-pango-fillrect_crash.patch		\
diff --git a/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch b/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch
new file mode 100644
index 0000000000..b56c628537
--- /dev/null
+++ b/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch
@@ -0,0 +1,55 @@
+From 454ccd986b61799908a6898a55d0480911f15306 Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <slow <at> samba.org>
+Date: Mon, 21 Sep 2020 07:48:43 +0200
+Subject: [PATCH] s3: fix fcntl waf configure check
+
+RN: Fix fcntl waf configure check
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=14503
+
+Signed-off-by: Ralph Boehme <slow <at> samba.org>
+Reviewed-by: Volker Lendecke <vl <at> samba.org>
+
+Autobuild-User(master): Volker Lendecke <vl <at> samba.org>
+Autobuild-Date(master): Mon Sep 21 07:26:54 UTC 2020 on sn-devel-184
+---
+ source3/wscript | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/source3/wscript b/source3/wscript
+index 840ed430c0f..d3ef346eecd 100644
+--- a/source3/wscript
++++ b/source3/wscript
+@@ -1244,7 +1244,7 @@ err:
+
+ int main(void)
+ {
+-        uint64_t *hint, get_hint;
++        uint64_t hint, get_hint;
+         int fd;
+
+         fd = open(DATA, O_RDONLY | O_CREAT | O_EXCL);
+@@ -1252,8 +1252,8 @@ int main(void)
+             goto err;
+         }
+
+-        *hint = RWH_WRITE_LIFE_SHORT;
+-        int ret = fcntl(fd, F_SET_RW_HINT, hint);
++        hint = RWH_WRITE_LIFE_SHORT;
++        int ret = fcntl(fd, F_SET_RW_HINT, &hint);
+         if (ret == -1) {
+             goto err;
+         }
+@@ -1267,8 +1267,8 @@ int main(void)
+             goto err;
+         }
+
+-        *hint = RWH_WRITE_LIFE_EXTREME;
+-        ret = fcntl(fd, F_SET_FILE_RW_HINT, hint);
++        hint = RWH_WRITE_LIFE_EXTREME;
++        ret = fcntl(fd, F_SET_FILE_RW_HINT, &hint);
+         if (ret == -1) {
+             goto err;
+         }
+--
+2.28.0
+
diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm
index c04426c49c..76a9c01866 100644
--- a/gnu/packages/samba.scm
+++ b/gnu/packages/samba.scm
@@ -32,6 +32,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix licenses)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages acl)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages autotools)
@@ -182,6 +183,7 @@ external dependencies.")
                            "samba-" version ".tar.gz"))
        (sha256
         (base32 "1lkgih0vrarf5zy6chspkwarqdylzwr63nxr3qjkpazrs86nlm9h"))
+       (patches (search-patches "samba-fix-fcntl-hint-detection.patch"))
        (modules '((guix build utils)))
        (snippet
         '(begin
--
2.28.0


Information forwarded to guix-patches <at> gnu.org:
bug#43554; Package guix-patches. (Tue, 22 Sep 2020 09:46:01 GMT) Full text and rfc822 format available.

Message #8 received at 43554 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Pierre Langlois <pierre.langlois <at> gmx.com>
Cc: 43554 <at> debbugs.gnu.org
Subject: Re: [bug#43554] [PATCH] gnu: samba: Fix fcntl hint detection in
 configure script.
Date: Tue, 22 Sep 2020 12:44:58 +0300
[Message part 1 (text/plain, inline)]
I haven't built it out but it's an upstream patch fixing a bug. Assuming
it doesn't break other architectures it looks good to me.


-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Reply sent to Pierre Langlois <pierre.langlois <at> gmx.com>:
You have taken responsibility. (Tue, 22 Sep 2020 18:55:02 GMT) Full text and rfc822 format available.

Notification sent to Pierre Langlois <pierre.langlois <at> gmx.com>:
bug acknowledged by developer. (Tue, 22 Sep 2020 18:55:02 GMT) Full text and rfc822 format available.

Message #13 received at 43554-done <at> debbugs.gnu.org (full text, mbox):

From: Pierre Langlois <pierre.langlois <at> gmx.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Pierre Langlois <pierre.langlois <at> gmx.com>, 43554-done <at> debbugs.gnu.org
Subject: Re: [bug#43554] [PATCH] gnu: samba: Fix fcntl hint detection in
 configure script.
Date: Tue, 22 Sep 2020 19:54:09 +0100
[Message part 1 (text/plain, inline)]
Efraim Flashner writes:

> I haven't built it out but it's an upstream patch fixing a bug. Assuming
> it doesn't break other architectures it looks good to me.

Thanks! Tested on x86_64 and aarch64, pushed with d3456739c5afd210cdc47b8c147adc277b84bfa8

Pierre

[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Oct 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.