From a8a1c63c1fb37d500103e92199e149e0c7c2ecfa Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze@samba.org>
Date: Wed, 23 Nov 2022 15:12:14 +0100
Subject: [PATCH 25/54] CVE-2022-37966 wafsamba: add support for
 CHECK_VARIABLE(mandatory=True)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 9da028c46f70db60a80d47f5dadbec194510211f)

Conflict: NA
Reference: https://attachments.samba.org/attachment.cgi?id=17695
---
 buildtools/wafsamba/samba_autoconf.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 3ca2f3341901..834acb70097b 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -185,7 +185,8 @@ def CHECK_TYPE_IN(conf, t, headers=None, alternate=None, define=None, cflags='')
 
 @conf
 def CHECK_VARIABLE(conf, v, define=None, always=False,
-                   headers=None, msg=None, lib=None):
+                   headers=None, msg=None, lib=None,
+                   mandatory=False):
     '''check for a variable declaration (or define)'''
     if define is None:
         define = 'HAVE_%s' % v.upper()
@@ -209,6 +210,7 @@ def CHECK_VARIABLE(conf, v, define=None, always=False,
                       lib=lib,
                       headers=headers,
                       define=define,
+                      mandatory=mandatory,
                       always=always)
 
 
-- 
2.34.1
