]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Option '-p ldapport' to specify LDAP server port.
authorhno <>
Wed, 5 Sep 2001 13:58:15 +0000 (13:58 +0000)
committerhno <>
Wed, 5 Sep 2001 13:58:15 +0000 (13:58 +0000)
Old meaning of -p (persistent) is moved to -P to match openldap tools options.

helpers/basic_auth/LDAP/squid_ldap_auth.8
helpers/basic_auth/LDAP/squid_ldap_auth.c

index 06a1721e0c3e54f94e341adcc3b662e6f1171bc3..b5295f73a6b8fbeef2a52c97b0f3b5624590a2f8 100644 (file)
@@ -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
index 7abb84e8ce779dc689e673471fa5edda936c1490..474a5fd6f7a5f7ab53ade3f1ba5deb97f4a79dbe 100644 (file)
@@ -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);