basic_ldap_auth.cc File Reference
#include "squid.h"
#include "rfc1738.h"
#include "util.h"
#include <cctype>
#include <cstring>
#include <lber.h>
#include <ldap.h>
Include dependency graph for basic_ldap_auth.cc:

Go to the source code of this file.

Macros

#define LDAP_DEPRECATED   1
 
#define PROGRAM_NAME   "basic_ldap_auth"
 
#define LDAP_NO_ATTRS   "1.1"
 

Functions

static int checkLDAP (LDAP *ld, const char *userid, const char *password, const char *server, int port)
 
static int readSecret (const char *filename)
 
static int squid_ldap_errno (LDAP *ld)
 
static void squid_ldap_set_aliasderef (LDAP *ld, int deref)
 
static void squid_ldap_set_referrals (LDAP *ld, int referrals)
 
static void squid_ldap_set_timelimit (LDAP *ld, int timelimit)
 
static void squid_ldap_set_connect_timeout (LDAP *ld, int timelimit)
 
static void squid_ldap_memfree (char *p)
 
static LDAP * open_ldap_connection (const char *ldapServer, int port)
 
static int validUsername (const char *user)
 
int main (int argc, char **argv)
 
static int ldap_escape_value (char *escaped, int size, const char *src)
 

Variables

static const char * basedn
 
static const char * searchfilter = NULL
 
static const char * binddn = NULL
 
static const char * bindpasswd = NULL
 
static const char * userattr = "uid"
 
static const char * passwdattr = NULL
 
static int searchscope = LDAP_SCOPE_SUBTREE
 
static int persistent = 0
 
static int bind_once = 0
 
static int noreferrals = 0
 
static int aliasderef = LDAP_DEREF_NEVER
 
static int connect_timeout = 0
 
static int timelimit = LDAP_NO_LIMIT
 
static int use_tls = 0
 
static int version = -1
 

Macro Definition Documentation

#define LDAP_DEPRECATED   1

Definition at line 95 of file basic_ldap_auth.cc.

#define LDAP_NO_ATTRS   "1.1"

Definition at line 167 of file basic_ldap_auth.cc.

Referenced by checkLDAP().

#define PROGRAM_NAME   "basic_ldap_auth"

Definition at line 136 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), main(), and readSecret().

Function Documentation

static int checkLDAP ( LDAP *  ld,
const char *  userid,
const char *  password,
const char *  server,
int  port 
)
static
static int ldap_escape_value ( char *  escaped,
int  size,
const char *  src 
)
static

Definition at line 620 of file basic_ldap_auth.cc.

References size.

Referenced by checkLDAP().

static LDAP* open_ldap_connection ( const char *  ldapServer,
int  port 
)
static
int readSecret ( const char *  filename)
static

Definition at line 765 of file basic_ldap_auth.cc.

References bindpasswd, buf, BUFSIZ, NULL, and PROGRAM_NAME.

Referenced by main().

static int squid_ldap_errno ( LDAP *  ld)
static

Definition at line 215 of file basic_ldap_auth.cc.

Referenced by main().

static void squid_ldap_memfree ( char *  p)
static

Definition at line 243 of file basic_ldap_auth.cc.

References free.

Referenced by checkLDAP().

static void squid_ldap_set_aliasderef ( LDAP *  ld,
int  deref 
)
static

Definition at line 220 of file basic_ldap_auth.cc.

Referenced by open_ldap_connection().

static void squid_ldap_set_connect_timeout ( LDAP *  ld,
int  timelimit 
)
static

Definition at line 238 of file basic_ldap_auth.cc.

Referenced by open_ldap_connection().

static void squid_ldap_set_referrals ( LDAP *  ld,
int  referrals 
)
static

Definition at line 225 of file basic_ldap_auth.cc.

Referenced by open_ldap_connection().

static void squid_ldap_set_timelimit ( LDAP *  ld,
int  timelimit 
)
static

Definition at line 233 of file basic_ldap_auth.cc.

References timelimit.

Referenced by open_ldap_connection().

static int validUsername ( const char *  user)
static

Definition at line 325 of file basic_ldap_auth.cc.

References p, and xisspace.

Referenced by main().

Variable Documentation

int aliasderef = LDAP_DEREF_NEVER
static

Definition at line 149 of file basic_ldap_auth.cc.

Referenced by main(), and open_ldap_connection().

const char* basedn
static

Definition at line 139 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

int bind_once = 0
static

Definition at line 147 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

const char* binddn = NULL
static

Definition at line 141 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

const char* bindpasswd = NULL
static

Definition at line 142 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), main(), and readSecret().

int connect_timeout = 0
static

Definition at line 154 of file basic_ldap_auth.cc.

Referenced by main(), and open_ldap_connection().

int noreferrals = 0
static

Definition at line 148 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), main(), and open_ldap_connection().

const char* passwdattr = NULL
static

Definition at line 144 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

int persistent = 0
static

Definition at line 146 of file basic_ldap_auth.cc.

Referenced by main().

const char* searchfilter = NULL
static

Definition at line 140 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

int searchscope = LDAP_SCOPE_SUBTREE
static

Definition at line 145 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

int timelimit = LDAP_NO_LIMIT
static

Definition at line 155 of file basic_ldap_auth.cc.

Referenced by main(), open_ldap_connection(), and squid_ldap_set_timelimit().

int use_tls = 0
static

Definition at line 158 of file basic_ldap_auth.cc.

Referenced by LDAPArguments(), ldapconnect(), main(), and open_ldap_connection().

const char* userattr = "uid"
static

Definition at line 143 of file basic_ldap_auth.cc.

Referenced by checkLDAP(), and main().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors