diff --git a/bin/ldapjs-add b/bin/ldapjs-add index f1fe6f6..64dd6da 100755 --- a/bin/ldapjs-add +++ b/bin/ldapjs-add @@ -14,16 +14,6 @@ var Logger = require('bunyan'); ///--- Globals -dashdash.addOptionType({ - name: 'ldap.DN', - takesArg: true, - helpArg: 'LDAP_DN', - parseArg: function (option, optstr, arg) { - return ldap.parseDN(arg); - } -}); - - var opts = [ { names: ['file', 'f'], @@ -53,8 +43,9 @@ var opts = [ }, { names: ['binddn', 'D'], - type: 'ldap.DN', + type: 'string', help: 'Bind DN', + helpArg: 'BIND_DN', default: '' }, { @@ -149,6 +140,7 @@ var log = new Logger({ var client = ldap.createClient({ url: parsed.url, log: log, + strictDN: false, tlsOptions: { rejectUnauthorized: !parsed.insecure } diff --git a/bin/ldapjs-compare b/bin/ldapjs-compare index d23faf4..ec7c317 100755 --- a/bin/ldapjs-compare +++ b/bin/ldapjs-compare @@ -13,16 +13,6 @@ var Logger = require('bunyan'); ///--- Globals -dashdash.addOptionType({ - name: 'ldap.DN', - takesArg: true, - helpArg: 'LDAP_DN', - parseArg: function (option, optstr, arg) { - return ldap.parseDN(arg); - } -}); - - var opts = [ { names: ['attribute', 'a'], @@ -58,8 +48,9 @@ var opts = [ }, { names: ['binddn', 'D'], - type: 'ldap.DN', + type: 'string', help: 'Bind DN', + helpArg: 'BIND_DN', default: '' }, { @@ -144,6 +135,7 @@ var log = new Logger({ var client = ldap.createClient({ url: parsed.url, log: log, + strictDN: false, tlsOptions: { rejectUnauthorized: !parsed.insecure } diff --git a/bin/ldapjs-delete b/bin/ldapjs-delete index a7fc7f2..e35011f 100755 --- a/bin/ldapjs-delete +++ b/bin/ldapjs-delete @@ -13,16 +13,6 @@ var Logger = require('bunyan'); ///--- Globals -dashdash.addOptionType({ - name: 'ldap.DN', - takesArg: true, - helpArg: 'LDAP_DN', - parseArg: function (option, optstr, arg) { - return ldap.parseDN(arg); - } -}); - - var opts = [ { group: 'General Options' }, { @@ -46,8 +36,9 @@ var opts = [ }, { names: ['binddn', 'D'], - type: 'ldap.DN', + type: 'string', help: 'Bind DN', + helpArg: 'bind_DN', default: '' }, { @@ -128,6 +119,7 @@ var log = new Logger({ var client = ldap.createClient({ url: parsed.url, log: log, + strictDN: false, tlsOptions: { rejectUnauthorized: !parsed.insecure } diff --git a/bin/ldapjs-modify b/bin/ldapjs-modify index 7d6bb02..8d12315 100755 --- a/bin/ldapjs-modify +++ b/bin/ldapjs-modify @@ -13,16 +13,6 @@ var Logger = require('bunyan'); ///--- Globals -dashdash.addOptionType({ - name: 'ldap.DN', - takesArg: true, - helpArg: 'LDAP_DN', - parseArg: function (option, optstr, arg) { - return ldap.parseDN(arg); - } -}); - - var opts = [ { names: ['attribute', 'a'], @@ -64,8 +54,9 @@ var opts = [ }, { names: ['binddn', 'D'], - type: 'ldap.DN', + type: 'string', help: 'Bind DN', + helpArg: 'BIND_DN', default: '' }, { @@ -152,6 +143,7 @@ var log = new Logger({ var client = ldap.createClient({ url: parsed.url, log: log, + strictDN: false, tlsOptions: { rejectUnauthorized: !parsed.insecure } diff --git a/bin/ldapjs-search b/bin/ldapjs-search index d4350f0..f18d58c 100755 --- a/bin/ldapjs-search +++ b/bin/ldapjs-search @@ -12,15 +12,6 @@ var Logger = require('bunyan'); ///--- Globals -dashdash.addOptionType({ - name: 'ldap.DN', - takesArg: true, - helpArg: 'LDAP_DN', - parseArg: function (option, optstr, arg) { - return ldap.parseDN(arg); - } -}); - dashdash.addOptionType({ name: 'ldap.Filter', takesArg: true, @@ -59,8 +50,9 @@ dashdash.addOptionType({ var opts = [ { names: ['base', 'b'], - type: 'ldap.DN', + type: 'string', help: 'Base DN of search', + helpArg: 'BASE_DN', default: '' }, { @@ -128,8 +120,9 @@ var opts = [ }, { names: ['binddn', 'D'], - type: 'ldap.DN', + type: 'string', help: 'Bind DN', + helpArg: 'BIND_DN', default: '' }, { @@ -253,6 +246,7 @@ var log = new Logger({ var client = ldap.createClient({ url: parsed.url, log: log, + strictDN: false, timeout: parsed.timeout || false, tlsOptions: { rejectUnauthorized: !parsed.insecure