From 2e862cea9d35938b5a25e5c63f43912cc7090f9c Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Thu, 24 Mar 2011 01:58:38 +0000
Subject: [PATCH] ITS#6849

---
 CHANGES                | 1 +
 clients/tools/common.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/CHANGES b/CHANGES
index 06a1386a93..a33fb58d8c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
 OpenLDAP 2.4 Change Log
 
 OpenLDAP 2.4.25 Engineering
+	Fixed tools for incompatible args (ITS#6849)
 	Fixed slapd add objectclasses in order (ITS#6837)
 	Fixed slapd sortval handling (ITS#6845)
 	Fixed slapd-ldap chain cn=config support (ITS#6837)
diff --git a/clients/tools/common.c b/clients/tools/common.c
index 895eb6676b..f3369460c1 100644
--- a/clients/tools/common.c
+++ b/clients/tools/common.c
@@ -1127,6 +1127,12 @@ tool_args( int argc, char **argv )
 		}
 #endif
 	}
+
+	if ( ( pw_file || want_bindpw ) && !BER_BVISNULL( &passwd ) ) {
+		fprintf( stderr, "%s: -%c incompatible with -w\n",
+			prog, ( pw_file ? 'y' : 'W' ) );
+		exit( EXIT_FAILURE );
+	}
 }
 
 
-- 
GitLab