From: hno <> Date: Wed, 5 Sep 2001 13:58:15 +0000 (+0000) Subject: Option '-p ldapport' to specify LDAP server port. X-Git-Tag: SQUID_3_0_PRE1~1408 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70c464010a9f2c4d69966961781dea7530cae741;p=thirdparty%2Fsquid.git Option '-p ldapport' to specify LDAP server port. Old meaning of -p (persistent) is moved to -P to match openldap tools options. --- diff --git a/helpers/basic_auth/LDAP/squid_ldap_auth.8 b/helpers/basic_auth/LDAP/squid_ldap_auth.8 index 06a1721e0c..b5295f73a6 100644 --- a/helpers/basic_auth/LDAP/squid_ldap_auth.8 +++ b/helpers/basic_auth/LDAP/squid_ldap_auth.8 @@ -51,7 +51,7 @@ it is strongly recommended to use a account with minimal associated privileges. This to limit the damage in case someone could get hold of a copy of your Squid configuration file. .TP -.BI -p +.BI -P Use a persistent LDAP connection. Normally the LDAP connection is only open while validating a username to preserve resources at the LDAP server. This option causes the LDAP connection to @@ -72,6 +72,9 @@ dereference aliases, only while or only to .B find the base object +.TP +.BI -p " ldapport" +Specify an alternate TCP port where the ldap server is listening . .SH EXAMPLES For directories using the RFC2307 layout with a single domain, all diff --git a/helpers/basic_auth/LDAP/squid_ldap_auth.c b/helpers/basic_auth/LDAP/squid_ldap_auth.c index 7abb84e8ce..474a5fd6f7 100644 --- a/helpers/basic_auth/LDAP/squid_ldap_auth.c +++ b/helpers/basic_auth/LDAP/squid_ldap_auth.c @@ -112,6 +112,7 @@ main(int argc, char **argv) char *ldapServer; LDAP *ld = NULL; int tryagain; + int port = LDAP_PORT; setbuf(stdout, NULL); @@ -119,7 +120,7 @@ main(int argc, char **argv) char *value = ""; char option = argv[1][1]; switch (option) { - case 'p': + case 'P': case 'R': break; default: @@ -176,9 +177,12 @@ main(int argc, char **argv) case 'w': bindpasswd = value; break; - case 'p': + case 'P': persistent = !persistent; break; + case 'p': + port = atoi(value); + break; case 'R': noreferrals = !noreferrals; break; @@ -221,9 +225,9 @@ main(int argc, char **argv) tryagain = 1; recover: if (ld == NULL) { - if ((ld = ldap_init(ldapServer, LDAP_PORT)) == NULL) { + if ((ld = ldap_init(ldapServer, port)) == NULL) { fprintf(stderr, "\nUnable to connect to LDAP server:%s port:%d\n", - ldapServer, LDAP_PORT); + ldapServer, port); exit(1); } squid_ldap_set_referrals(ld, !noreferrals);