#include "squid.h"
#include "helper/protocol_defines.h"
#include "rfc1738.h"
#include "util.h"
#include <cctype>
#include <cstring>
#include <lber.h>
#include <ldap.h>
Go to the source code of this file.
Macros | |
#define | LDAP_DEPRECATED 1 |
#define | LDAP_SECURITY_ERROR(err) (0x2f <= (err) && (err) <= 0x32) |
#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 = nullptr |
static const char * | binddn = nullptr |
static const char * | bindpasswd = nullptr |
static const char * | userattr = "uid" |
static const char * | passwdattr = nullptr |
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
◆ LDAP_DEPRECATED
#define LDAP_DEPRECATED 1 |
Definition at line 98 of file basic_ldap_auth.cc.
◆ LDAP_NO_ATTRS
#define LDAP_NO_ATTRS "1.1" |
Definition at line 174 of file basic_ldap_auth.cc.
◆ LDAP_SECURITY_ERROR
#define LDAP_SECURITY_ERROR | ( | err | ) | (0x2f <= (err) && (err) <= 0x32) |
Definition at line 138 of file basic_ldap_auth.cc.
◆ PROGRAM_NAME
#define PROGRAM_NAME "basic_ldap_auth" |
Definition at line 143 of file basic_ldap_auth.cc.
Function Documentation
◆ checkLDAP()
|
static |
Definition at line 666 of file basic_ldap_auth.cc.
References basedn, bind_once, binddn, bindpasswd, debug(), ldap_escape_value(), LDAP_NO_ATTRS, ldapServer, noreferrals, open_ldap_connection(), passwdattr, port, PROGRAM_NAME, searchfilter, searchscope, squid_ldap_memfree(), and userattr.
Referenced by main().
◆ ldap_escape_value()
◆ main()
Definition at line 357 of file basic_ldap_auth.cc.
References aliasderef, basedn, bind_once, binddn, bindpasswd, checkLDAP(), connect_timeout, debug_enabled, HLP_MSG, ld, LDAP_SECURITY_ERROR, ldapServer, noreferrals, NULL, open_ldap_connection(), passwdattr, persistent, port, PROGRAM_NAME, readSecret(), rfc1738_unescape(), searchfilter, searchscope, SEND_BH, SEND_ERR, SEND_OK, squid_ldap_errno(), timelimit, use_tls, userattr, validUsername(), version, xmalloc, and xstrdup.
◆ open_ldap_connection()
|
static |
Definition at line 264 of file basic_ldap_auth.cc.
References aliasderef, connect_timeout, ld, ldapServer, noreferrals, NULL, port, squid_ldap_set_aliasderef(), squid_ldap_set_connect_timeout(), squid_ldap_set_referrals(), squid_ldap_set_timelimit(), timelimit, use_tls, and version.
Referenced by checkLDAP(), and main().
◆ readSecret()
|
static |
Definition at line 776 of file basic_ldap_auth.cc.
References bindpasswd, BUFSIZ, and PROGRAM_NAME.
Referenced by main().
◆ squid_ldap_errno()
|
static |
◆ squid_ldap_memfree()
|
static |
Definition at line 250 of file basic_ldap_auth.cc.
Referenced by checkLDAP().
◆ squid_ldap_set_aliasderef()
|
static |
Definition at line 227 of file basic_ldap_auth.cc.
References ld.
Referenced by open_ldap_connection().
◆ squid_ldap_set_connect_timeout()
|
static |
Definition at line 245 of file basic_ldap_auth.cc.
Referenced by open_ldap_connection().
◆ squid_ldap_set_referrals()
|
static |
Definition at line 232 of file basic_ldap_auth.cc.
References ld.
Referenced by open_ldap_connection().
◆ squid_ldap_set_timelimit()
|
static |
Definition at line 240 of file basic_ldap_auth.cc.
Referenced by open_ldap_connection().
◆ validUsername()
|
static |
Variable Documentation
◆ aliasderef
|
static |
Definition at line 156 of file basic_ldap_auth.cc.
Referenced by main(), and open_ldap_connection().
◆ basedn
|
static |
Definition at line 146 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ bind_once
|
static |
Definition at line 154 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ binddn
|
static |
Definition at line 148 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ bindpasswd
|
static |
Definition at line 149 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), main(), and readSecret().
◆ connect_timeout
|
static |
Definition at line 161 of file basic_ldap_auth.cc.
Referenced by main(), and open_ldap_connection().
◆ noreferrals
|
static |
Definition at line 155 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), main(), and open_ldap_connection().
◆ passwdattr
|
static |
Definition at line 151 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ persistent
|
static |
Definition at line 153 of file basic_ldap_auth.cc.
Referenced by main().
◆ searchfilter
|
static |
Definition at line 147 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ searchscope
|
static |
Definition at line 152 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ timelimit
|
static |
Definition at line 162 of file basic_ldap_auth.cc.
Referenced by main(), open_ldap_connection(), and squid_ldap_set_timelimit().
◆ use_tls
|
static |
Definition at line 165 of file basic_ldap_auth.cc.
Referenced by LDAPArguments(), ldapconnect(), main(), and open_ldap_connection().
◆ userattr
|
static |
Definition at line 150 of file basic_ldap_auth.cc.
Referenced by checkLDAP(), and main().
◆ version
|
static |
Definition at line 166 of file basic_ldap_auth.cc.
Referenced by LDAPArguments(), ldapconnect(), main(), open_ldap_connection(), Http::StatusLine::packedLength(), Http::StatusLine::packInto(), ProxyProtocol::Two::Parse(), Http::StatusLine::parse(), Security::HandshakeParser::parseSupportedVersionsExtension(), Http::StatusLine::set(), and Security::TlsFamilyProtocol().