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.
This commit is contained in:
Pierre Langlois 2020-09-19 23:57:41 +01:00
parent a2c0dbb84a
commit d3456739c5
No known key found for this signature in database
GPG Key ID: A8FC9E447F4F7D54
3 changed files with 58 additions and 0 deletions

View File

@ -1406,6 +1406,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 \

View File

@ -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

View File

@ -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