From 757c49f6dc52afd6ee39c0b282e9a787b6df7a12 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 28 Apr 2021 12:25:42 +0200 Subject: [PATCH] s3:winbind: For 'security = ADS' require realm/workgroup to be set BUG: https://bugzilla.samba.org/show_bug.cgi?id=14695 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Apr 29 04:48:37 UTC 2021 on sn-devel-184 --- source3/winbindd/winbindd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 02da60cb9fa..406aaaf4ecb 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1781,6 +1781,23 @@ int main(int argc, const char **argv) daemon_sd_notifications(false); } + if (lp_security() == SEC_ADS) { + const char *realm = lp_realm(); + const char *workgroup = lp_workgroup(); + + if (workgroup == NULL || strlen(workgroup) == 0) { + DBG_ERR("For 'secuirity = ADS' mode, the 'workgroup' " + "parameter is required to be set!\n"); + exit(1); + } + + if (realm == NULL || strlen(realm) == 0) { + DBG_ERR("For 'secuirity = ADS' mode, the 'realm' " + "parameter is required to be set!\n"); + exit(1); + } + } + if (!cluster_probe_ok()) { exit(1); } -- 2.47.3