From: Joseph Sutton Date: Thu, 24 Feb 2022 02:24:13 +0000 (+1300) Subject: third_party/heimdal_build: Determine whether time_t is signed X-Git-Tag: tevent-0.12.0~620 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eb27f296ae2b797803fffbb7f4cb34d8eb06f34;p=thirdparty%2Fsamba.git third_party/heimdal_build: Determine whether time_t is signed Without this, Heimdal will assume time_t is unsigned, and a wrong assumption will cause 'infinite' ticket lifetimes to be reckoned as from the past, and thus requests will fail with KDC_ERR_NEVER_VALID. This is an adaptation to Heimdal: commit 9ae9902249732237aa1711591604a6adf24963fe Author: Nicolas Williams Date: Tue Feb 15 17:01:00 2022 -0600 cf: Check if time_t is signed BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995 Signed-off-by: Joseph Sutton Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Tue Mar 1 18:07:50 UTC 2022 on sn-devel-184 --- diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 8b499825230..78927d85193 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -343,6 +343,23 @@ def CHECK_SIZEOF(conf, vars, headers=None, define=None, critical=True): sys.exit(1) return ret +@conf +def CHECK_SIGN(conf, v, headers=None): + '''check the sign of a type''' + define_name = v.upper().replace(' ', '_') + for op, signed in [('<', 'signed'), + ('>', 'unsigned')]: + if CHECK_CODE(conf, + f'static int test_array[1 - 2 * !((({v})-1) {op} 0)];', + define=f'{define_name}_{signed.upper()}', + quote=False, + headers=headers, + local_include=False, + msg=f"Checking if '{v}' is {signed}"): + return True + + return False + @conf def CHECK_VALUEOF(conf, v, headers=None, define=None): '''check the value of a variable/define''' diff --git a/third_party/heimdal_build/wscript_configure b/third_party/heimdal_build/wscript_configure index 023935d98c0..0021cd328ec 100644 --- a/third_party/heimdal_build/wscript_configure +++ b/third_party/heimdal_build/wscript_configure @@ -206,3 +206,5 @@ if conf.CONFIG_SET('USING_EMBEDDED_HEIMDAL'): conf.define('HAVE_KRB5_ADDLOG_FUNC_NEED_CONTEXT', 1) else: pass # TODO + +conf.CHECK_SIGN('time_t')