s3:winbind: For 'security = ADS' require realm/workgroup to be set
authorAndreas Schneider <asn@samba.org>
Wed, 28 Apr 2021 10:25:42 +0000 (12:25 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 29 Apr 2021 04:48:37 +0000 (04:48 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14695

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr 29 04:48:37 UTC 2021 on sn-devel-184

source3/winbindd/winbindd.c

index 02da60cb9fa8aa8511aa1e38e7ac5224feba0bbb..406aaaf4ecbb6c556662df370cb2215731b26f09 100644 (file)
@@ -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);
        }