#include "squid.h"
#include "base/IoManip.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>
![](ext__ldap__group__acl_8cc__incl.png)
Go to the source code of this file.
Macros | |
#define | LDAP_DEPRECATED 1 |
#define | PROGRAM_NAME "ext_ldap_group_acl" |
#define | PROGRAM_VERSION "2.18" |
#define | LDAP_NO_ATTRS "1.1" |
Functions | |
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) |
Variables | |
const typedef std::unique_ptr< LDAPMessage, decltype(&ldap_msgfree)> | LdapResult |
static const char * | basedn = nullptr |
static const char * | searchfilter = nullptr |
static const char * | userbasedn = nullptr |
static const char * | userdnattr = nullptr |
static const char * | usersearchfilter = nullptr |
static const char * | binddn = nullptr |
static const char * | bindpasswd = nullptr |
static int | searchscope = LDAP_SCOPE_SUBTREE |
static int | persistent = 0 |
static int | noreferrals = 0 |
static int | aliasderef = LDAP_DEREF_NEVER |
static int | connect_timeout = 0 |
static int | timelimit = LDAP_NO_LIMIT |
Macro Definition Documentation
◆ LDAP_DEPRECATED
#define LDAP_DEPRECATED 1 |
Definition at line 46 of file ext_ldap_group_acl.cc.
◆ LDAP_NO_ATTRS
#define LDAP_NO_ATTRS "1.1" |
Definition at line 130 of file ext_ldap_group_acl.cc.
◆ PROGRAM_NAME
#define PROGRAM_NAME "ext_ldap_group_acl" |
Definition at line 94 of file ext_ldap_group_acl.cc.
◆ PROGRAM_VERSION
#define PROGRAM_VERSION "2.18" |
Definition at line 95 of file ext_ldap_group_acl.cc.
Function Documentation
◆ build_filter()
|
static |
Definition at line 648 of file ext_ldap_group_acl.cc.
References ldap_escape_value().
Referenced by searchLDAPGroup().
◆ build_searchbase()
|
static |
Definition at line 690 of file ext_ldap_group_acl.cc.
Referenced by searchLDAP(), and searchLDAPGroup().
◆ formatWithString()
|
static |
Definition at line 748 of file ext_ldap_group_acl.cc.
Referenced by searchLDAP().
◆ ldap_escape_value()
|
static |
Definition at line 629 of file ext_ldap_group_acl.cc.
References asHex().
Referenced by build_filter(), and searchLDAP().
◆ ldap_search_ok()
|
static |
Definition at line 699 of file ext_ldap_group_acl.cc.
References noreferrals, and PROGRAM_NAME.
Referenced by searchLDAP(), and searchLDAPGroup().
◆ main()
Definition at line 220 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()
|
static |
Definition at line 801 of file ext_ldap_group_acl.cc.
References bindpasswd, BUFSIZ, PROGRAM_NAME, and xstrdup.
Referenced by main().
◆ searchLDAP()
|
static |
Definition at line 758 of file ext_ldap_group_acl.cc.
References basedn, build_searchbase(), debug(), formatWithString(), ld, ldap_escape_value(), LDAP_NO_ATTRS, ldap_search_ok(), LdapResult, PROGRAM_NAME, searchLDAPGroup(), searchscope, squid_ldap_memfree(), userbasedn, userdnattr, and usersearchfilter.
Referenced by main().
◆ searchLDAPGroup()
|
static |
Definition at line 724 of file ext_ldap_group_acl.cc.
References basedn, build_filter(), build_searchbase(), debug(), ld, LDAP_NO_ATTRS, ldap_search_ok(), LdapResult, PROGRAM_NAME, searchfilter, and searchscope.
Referenced by searchLDAP().
◆ squid_ldap_errno()
|
static |
◆ squid_ldap_memfree()
|
static |
Definition at line 206 of file ext_ldap_group_acl.cc.
Referenced by searchLDAP().
◆ squid_ldap_set_aliasderef()
|
static |
◆ squid_ldap_set_connect_timeout()
|
static |
Definition at line 201 of file ext_ldap_group_acl.cc.
Referenced by main().
◆ squid_ldap_set_referrals()
|
static |
◆ squid_ldap_set_timelimit()
|
static |
Definition at line 196 of file ext_ldap_group_acl.cc.
Referenced by main().
Variable Documentation
◆ aliasderef
|
static |
Definition at line 109 of file ext_ldap_group_acl.cc.
Referenced by main().
◆ basedn
|
static |
Definition at line 99 of file ext_ldap_group_acl.cc.
Referenced by main(), searchLDAP(), and searchLDAPGroup().
◆ binddn
|
static |
Definition at line 104 of file ext_ldap_group_acl.cc.
Referenced by main().
◆ bindpasswd
|
static |
Definition at line 105 of file ext_ldap_group_acl.cc.
Referenced by main(), and readSecret().
◆ connect_timeout
|
static |
Definition at line 114 of file ext_ldap_group_acl.cc.
Referenced by main().
◆ LdapResult
const typedef std::unique_ptr<LDAPMessage, decltype(&ldap_msgfree)> LdapResult |
Definition at line 721 of file ext_ldap_group_acl.cc.
Referenced by searchLDAP(), and searchLDAPGroup().
◆ noreferrals
|
static |
Definition at line 108 of file ext_ldap_group_acl.cc.
Referenced by ldap_search_ok(), and main().
◆ persistent
|
static |
Definition at line 107 of file ext_ldap_group_acl.cc.
Referenced by main().
◆ searchfilter
|
static |
Definition at line 100 of file ext_ldap_group_acl.cc.
Referenced by main(), and searchLDAPGroup().
◆ searchscope
|
static |
Definition at line 106 of file ext_ldap_group_acl.cc.
Referenced by main(), searchLDAP(), and searchLDAPGroup().
◆ timelimit
|
static |
Definition at line 115 of file ext_ldap_group_acl.cc.
Referenced by main(), and squid_ldap_set_timelimit().
◆ userbasedn
|
static |
Definition at line 101 of file ext_ldap_group_acl.cc.
Referenced by main(), and searchLDAP().
◆ userdnattr
|
static |
Definition at line 102 of file ext_ldap_group_acl.cc.
Referenced by main(), and searchLDAP().
◆ usersearchfilter
|
static |
Definition at line 103 of file ext_ldap_group_acl.cc.
Referenced by main(), and searchLDAP().
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products