#include "squid.h"
#include "helper/protocol_defines.h"
#include "rfc1738.h"
#include "util.h"
#include <algorithm>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <memory>
#include <sstream>
Go to the source code of this file.
|
typedef const std::unique_ptr< LDAPMessage, decltype(&ldap_msgfree)> | LdapResult |
|
|
static int | searchLDAP (LDAP *ld, char *group, char *user, char *extension_dn) |
|
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) |
|
int | main (int argc, char **argv) |
|
static std::string | ldap_escape_value (const std::string &src) |
|
static bool | build_filter (std::string &filter, const char *templ, const char *user, const char *group) |
|
static std::string | build_searchbase (const char *extension_dn, const char *base_dn) |
|
static bool | ldap_search_ok (const int result) |
|
static int | searchLDAPGroup (LDAP *ld, const char *group, const char *member, const char *extension_dn) |
|
static void | formatWithString (std::string &formatted, const std::string &value) |
|
◆ LDAP_DEPRECATED
#define LDAP_DEPRECATED 1 |
◆ LDAP_NO_ATTRS
#define LDAP_NO_ATTRS "1.1" |
◆ PROGRAM_NAME
#define PROGRAM_NAME "ext_ldap_group_acl" |
◆ PROGRAM_VERSION
#define PROGRAM_VERSION "2.18" |
◆ LdapResult
typedef const std::unique_ptr<LDAPMessage, decltype(&ldap_msgfree)> LdapResult |
◆ build_filter()
static bool build_filter |
( |
std::string & |
filter, |
|
|
const char * |
templ, |
|
|
const char * |
user, |
|
|
const char * |
group |
|
) |
| |
|
static |
◆ build_searchbase()
static std::string build_searchbase |
( |
const char * |
extension_dn, |
|
|
const char * |
base_dn |
|
) |
| |
|
static |
◆ formatWithString()
static void formatWithString |
( |
std::string & |
formatted, |
|
|
const std::string & |
value |
|
) |
| |
|
static |
◆ ldap_escape_value()
static std::string ldap_escape_value |
( |
const std::string & |
src | ) |
|
|
static |
◆ ldap_search_ok()
static bool ldap_search_ok |
( |
const int |
result | ) |
|
|
static |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 219 of file ext_ldap_group_acl.cc.
References aliasderef, basedn, binddn, bindpasswd, connect_timeout, debug(), debug_enabled, HELPER_INPUT_BUFFER, HLP_MSG, ld, ldapServer, noreferrals, NULL, persistent, port, PROGRAM_NAME, PROGRAM_VERSION, readSecret(), rfc1738_unescape(), searchfilter, searchLDAP(), searchscope, SEND_BH, SEND_ERR, SEND_OK, squid_ldap_errno(), squid_ldap_set_aliasderef(), squid_ldap_set_connect_timeout(), squid_ldap_set_referrals(), squid_ldap_set_timelimit(), strip_nt_domain, timelimit, use_tls, userbasedn, userdnattr, usersearchfilter, version, xmalloc, and xstrdup.
◆ readSecret()
int readSecret |
( |
const char * |
filename | ) |
|
|
static |
◆ searchLDAP()
static int searchLDAP |
( |
LDAP * |
ld, |
|
|
char * |
group, |
|
|
char * |
user, |
|
|
char * |
extension_dn |
|
) |
| |
|
static |
Definition at line 757 of file ext_ldap_group_acl.cc.
References basedn, build_searchbase(), debug(), formatWithString(), ld, ldap_escape_value(), LDAP_NO_ATTRS, ldap_search_ok(), PROGRAM_NAME, searchLDAPGroup(), searchscope, squid_ldap_memfree(), userbasedn, userdnattr, and usersearchfilter.
Referenced by main().
◆ searchLDAPGroup()
static int searchLDAPGroup |
( |
LDAP * |
ld, |
|
|
const char * |
group, |
|
|
const char * |
member, |
|
|
const char * |
extension_dn |
|
) |
| |
|
static |
◆ squid_ldap_errno()
static int squid_ldap_errno |
( |
LDAP * |
ld | ) |
|
|
static |
◆ squid_ldap_memfree()
static void squid_ldap_memfree |
( |
char * |
p | ) |
|
|
static |
◆ squid_ldap_set_aliasderef()
static void squid_ldap_set_aliasderef |
( |
LDAP * |
ld, |
|
|
int |
deref |
|
) |
| |
|
static |
◆ squid_ldap_set_connect_timeout()
static void squid_ldap_set_connect_timeout |
( |
LDAP * |
ld, |
|
|
int |
timelimit |
|
) |
| |
|
static |
◆ squid_ldap_set_referrals()
static void squid_ldap_set_referrals |
( |
LDAP * |
ld, |
|
|
int |
referrals |
|
) |
| |
|
static |
◆ squid_ldap_set_timelimit()
static void squid_ldap_set_timelimit |
( |
LDAP * |
ld, |
|
|
int |
timelimit |
|
) |
| |
|
static |
◆ aliasderef
int aliasderef = LDAP_DEREF_NEVER |
|
static |
◆ basedn
const char* basedn = nullptr |
|
static |
◆ binddn
const char* binddn = nullptr |
|
static |
◆ bindpasswd
const char* bindpasswd = nullptr |
|
static |
◆ connect_timeout
◆ noreferrals
◆ persistent
◆ searchfilter
const char* searchfilter = nullptr |
|
static |
◆ searchscope
int searchscope = LDAP_SCOPE_SUBTREE |
|
static |
◆ timelimit
int timelimit = LDAP_NO_LIMIT |
|
static |
◆ userbasedn
const char* userbasedn = nullptr |
|
static |
◆ userdnattr
const char* userdnattr = nullptr |
|
static |
◆ usersearchfilter
const char* usersearchfilter = nullptr |
|
static |