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
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
char *ldapServer;
LDAP *ld = NULL;
int tryagain;
+ int port = LDAP_PORT;
setbuf(stdout, NULL);
char *value = "";
char option = argv[1][1];
switch (option) {
- case 'p':
+ case 'P':
case 'R':
break;
default:
case 'w':
bindpasswd = value;
break;
- case 'p':
+ case 'P':
persistent = !persistent;
break;
+ case 'p':
+ port = atoi(value);
+ break;
case 'R':
noreferrals = !noreferrals;
break;
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);