From 0098ee1ab1d968c2d7ba151f969f353b21207a5c Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Thu, 21 May 2026 10:23:49 +0200 Subject: [PATCH] Remove dead-code validation block for unbound distinguishedName variable (#5) The `distinguishedName` package variable was declared but never registered with the argument parser, so the validation branch checking it was unreachable and the warning message referenced a non-existent `--distinguished-name` flag. --- main.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main.go b/main.go index e79cfdc..f42f10e 100755 --- a/main.go +++ b/main.go @@ -28,9 +28,6 @@ var ( authPassword string authHashes string useKerberos bool - - // Source values - distinguishedName string ) func parseArgs() { @@ -65,11 +62,6 @@ func parseArgs() { if useLdaps && !group_ldapSettings.LongNameToArgument["--port"].IsPresent() { ldapPort = 636 } - - if len(distinguishedName) != 0 && (len(domainController) == 0 || len(authUsername) == 0 || len(authPassword) == 0) { - logger.Warn("Error: Options --dc-ip, --username, --password are required when using --distinguished-name.") - os.Exit(1) - } } func main() {