[PATCH] gnu: samba: Fix fcntl hint detection in configure script.

  • Done
  • quality assurance status badge
Details
2 participants
  • Efraim Flashner
  • Pierre Langlois
Owner
unassigned
Submitted by
Pierre Langlois
Severity
normal
P
P
Pierre Langlois wrote on 21 Sep 2020 21:44
(name . Guix-patches)(address . guix-patches@gnu.org)
87k0wmvrrt.fsf@gmx.com
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.

then we can backport the patch from upstream.

Thanks,
Pierre
-----BEGIN PGP SIGNATURE-----

iQFLBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAl9pAqYYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UMdAH9A9b0R5A4xaPksdAEP3RNGrr
hBVyscpnRoGgNRqN/A5qLc0/i1APf5vFgI5o7D0OXuuRSExEYVgGL5PXYFC75Vy7
Ocy9Qo+mMvnRZhkZlPyenG7ciQlq6qYZY4zNDtSgij+f78zm/S6KaI91W7pmfhru
2xi3UTPUHQjcoLtQvYM+JIuGyqQUMsNrRT/gDC29RL7cKakUueSJ/8uvbfkbnLj5
rJaar55iDLywzeoyjeirJCQXsF1GSz2K0AEZw6Qs3q5hYStbxX1tElJNMd1a48sC
ABIvi1phX+/tDQtnZ4t4ixr9l82kC6Tv6Kt37EgirSvs0bXzEgb7UAyr/RHl8w==
=mmz1
-----END PGP SIGNATURE-----

From dc3c16fc1908a17cf834730f13d9ebff82091170 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@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.


* 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

Toggle diff (93 lines)
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@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@samba.org>
+Reviewed-by: Volker Lendecke <vl@samba.org>
+
+Autobuild-User(master): Volker Lendecke <vl@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
E
E
Efraim Flashner wrote on 22 Sep 2020 11:44
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)(address . 43554@debbugs.gnu.org)
20200922094458.GG1007@E5400
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@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
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9px5oACgkQQarn3Mo9
g1EG9A/+NvmFDQ4d68QW2gDzn9XayyZOI9su4hs0MGaxrPo5w6dswtLgpT2GkVUo
6qKYtCtZqMAACLS/sT5hc6VoLXWGu89R8RlkqVpdxeW+gkTpDW8FeDIPHFROFK6N
I41Ahy3hAJ7slsXejCaLxUKbEaRBptYxZ4v2VQ0DbHUKgmNglaylNSCPa8NMraCI
QbhhPk7SJ+H3+84aPac0ny8yw2dwLzhm3BJ9CCz63rVHYM18Fca1DnZ4Xef/skaq
UGhtLX0G6trFWB2JdofMuYyzX/9gBYvmSNDpo7VfEehkpCIdwTV58TM/ykcos6Gf
AqIftHXGYQ/DRHi0HKACT44F44iCdgkPC0EP/bX20pbluhWNwxxYhN8Q15+4cuvG
NK5oRtLh4BBQt11Ny4dm9AbcLOJpayZ2vCfT583HRZYz2Rz+bSuD5jmmaldbsAfz
0SM73A/x2WNRXg9oxPcJ4FI4ikPSxhyWhss2frVnnO5ArCQiUxT3qvgXWX9Do/ZG
JlJs8lvKDWbJ8kwkfEbAK6dl6rSGmL+bt+nc1nWP4CW43qB1OwCSzt32t8E7zlju
C4fAY/LxHJLD5tHma+e0yvcHHCeI8ggB6mEdzPIUQOr+6cGy+DB77njMkRNClojg
NypQ+R80AUZPJWBMDuOci7GsoUJodx3u2DsjdT7EIN9hQaeL7yE=
=EaAk
-----END PGP SIGNATURE-----


P
P
Pierre Langlois wrote on 22 Sep 2020 20:54
(name . Efraim Flashner)(address . efraim@flashner.co.il)
87lfh1skvi.fsf@gmx.com
Efraim Flashner writes:

Toggle quote (3 lines)
> 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
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAl9qSFEYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UZo8IAJMzsG6yDIlOG35ZFbzEH/Li
isjNQhS9xkv4jLVePFkjwdLLcFX1R1ZE7MrD662qzzfNEuzf++LUuGPx/4LsSDHv
h7tu//5LPNb1J4oOlGakxagyGqhMvixXOO27YXjJgnG0f0LYbr4Two8f50KoBbPs
qEsSTibXqDHfKh36iJ2EK1a0b7Rou0e/BESLp405Pr+Cq6/Q+EUCh0mgX4kq3qMu
IhxJHUuUS2jyx95Oa0lF0p9ZJCvBPkrxgR3g1NciZGlgBWuSV4x/+ysPofFlCV1G
4SMDxQqjmLB0tjtMyXUzQS5L9P+58RqlJlE6mbVCKGVTWut7+DBT3C2J3twEKfc=
=mH1r
-----END PGP SIGNATURE-----

Closed
?