#include "squid.h"#include "helper/protocol_defines.h"#include "include/util.h"#include <cassert>#include <cctype>#include <cstring>#include <windows.h>#include <objbase.h>#include <initguid.h>#include <adsiid.h>#include <iads.h>#include <adshlp.h>#include <adserr.h>#include <lm.h>#include <dsrole.h>#include <sddl.h>
Go to the source code of this file.
Enumerations | |
| enum | ADSI_PATH { LDAP_MODE , GC_MODE } |
Functions | |
| wchar_t * | My_NameTranslate (wchar_t *, int, int) |
| char * | Get_WIN32_ErrorMessage (HRESULT) |
| void | CloseCOM (void) |
| HRESULT | GetLPBYTEtoOctetString (VARIANT *pVar, LPBYTE *ppByte) |
| wchar_t * | Get_primaryGroup (IADs *pUser) |
| wchar_t * | GetLDAPPath (wchar_t *Base_DN, int query_mode) |
| char * | GetDomainName (void) |
| int | add_User_Group (wchar_t *Group) |
| static int | wccmparray (const wchar_t *str, const wchar_t **array) |
| static int | wcstrcmparray (const wchar_t *str, const char **array) |
| HRESULT | Recursive_Memberof (IADs *pObj) |
| static wchar_t ** | build_groups_DN_array (const char **array, char *userdomain) |
| int | Valid_Local_Groups (char *UserName, const char **Groups) |
| int | Valid_Global_Groups (char *UserName, const char **Groups) |
| static void | usage (const char *program) |
| void | process_options (int argc, char *argv[]) |
| int | main (int argc, char *argv[]) |
Variables | |
| enum ADSI_PATH | ADSI_Path |
| int | use_global = 0 |
| char * | program_name |
| pid_t | mypid |
| char * | machinedomain |
| int | use_case_insensitive_compare = 0 |
| char * | DefaultDomain = nullptr |
| const char | NTV_VALID_DOMAIN_SEPARATOR [] = "\\/" |
| int | numberofgroups = 0 |
| int | WIN32_COM_initialized = 0 |
| char * | WIN32_ErrorMessage = nullptr |
| wchar_t ** | User_Groups |
| int | User_Groups_Count = 0 |
Enumeration Type Documentation
◆ ADSI_PATH
| enum ADSI_PATH |
| Enumerator | |
|---|---|
| LDAP_MODE | |
| GC_MODE | |
Definition at line 95 of file ext_ad_group_acl.cc.
Function Documentation
◆ add_User_Group()
| int add_User_Group | ( | wchar_t * | Group | ) |
Definition at line 347 of file ext_ad_group_acl.cc.
References User_Groups, User_Groups_Count, xmalloc, and xrealloc().
Referenced by Recursive_Memberof(), and Valid_Global_Groups().
◆ build_groups_DN_array()
|
static |
Definition at line 481 of file ext_ad_group_acl.cc.
References debug(), My_NameTranslate(), NULL, numberofgroups, safe_free, and xmalloc.
Referenced by Valid_Global_Groups().
◆ CloseCOM()
| void CloseCOM | ( | void | ) |
Definition at line 117 of file ext_ad_group_acl.cc.
References WIN32_COM_initialized.
Referenced by main().
◆ Get_primaryGroup()
| wchar_t * Get_primaryGroup | ( | IADs * | pUser | ) |
Definition at line 154 of file ext_ad_group_acl.cc.
References debug(), Get_WIN32_ErrorMessage(), GetLPBYTEtoOctetString(), My_NameTranslate(), NULL, safe_free, and xmalloc.
Referenced by Valid_Global_Groups().
◆ Get_WIN32_ErrorMessage()
| char * Get_WIN32_ErrorMessage | ( | HRESULT | hr | ) |
Definition at line 212 of file ext_ad_group_acl.cc.
References WIN32_ErrorMessage.
Referenced by Get_primaryGroup(), GetDomainName(), My_NameTranslate(), Recursive_Memberof(), Valid_Global_Groups(), and Valid_Local_Groups().
◆ GetDomainName()
| char * GetDomainName | ( | void | ) |
Definition at line 297 of file ext_ad_group_acl.cc.
References debug(), Get_WIN32_ErrorMessage(), NULL, safe_free, and xmalloc.
Referenced by main().
◆ GetLDAPPath()
| wchar_t * GetLDAPPath | ( | wchar_t * | Base_DN, |
| int | query_mode | ||
| ) |
Definition at line 281 of file ext_ad_group_acl.cc.
References LDAP_MODE, and xmalloc.
Referenced by Recursive_Memberof(), and Valid_Global_Groups().
◆ GetLPBYTEtoOctetString()
| HRESULT GetLPBYTEtoOctetString | ( | VARIANT * | pVar, |
| LPBYTE * | ppByte | ||
| ) |
Definition at line 124 of file ext_ad_group_acl.cc.
Referenced by Get_primaryGroup().
◆ main()
Definition at line 770 of file ext_ad_group_acl.cc.
References CloseCOM(), debug(), DefaultDomain, GetDomainName(), HELPER_INPUT_BUFFER, HLP_MSG, machinedomain, mypid, NULL, numberofgroups, process_options(), program_name, rfc1738_unescape(), SEND_BH, SEND_ERR, SEND_OK, use_case_insensitive_compare, use_global, Valid_Global_Groups(), Valid_Local_Groups(), VERSION, and xstrdup.
◆ My_NameTranslate()
Definition at line 226 of file ext_ad_group_acl.cc.
References debug(), Get_WIN32_ErrorMessage(), NULL, WIN32_COM_initialized, and xmalloc.
Referenced by build_groups_DN_array(), Get_primaryGroup(), and Valid_Global_Groups().
◆ process_options()
| void process_options | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 734 of file ext_ad_group_acl.cc.
References debug_enabled, DefaultDomain, getopt(), optarg, opterr, optopt, program_name, usage(), use_case_insensitive_compare, use_global, and xstrndup().
Referenced by main().
◆ Recursive_Memberof()
| HRESULT Recursive_Memberof | ( | IADs * | pObj | ) |
Definition at line 402 of file ext_ad_group_acl.cc.
References add_User_Group(), debug(), GC_MODE, Get_WIN32_ErrorMessage(), GetLDAPPath(), LDAP_MODE, Recursive_Memberof(), and safe_free.
Referenced by Recursive_Memberof(), and Valid_Global_Groups().
◆ usage()
|
static |
Definition at line 722 of file ext_ad_group_acl.cc.
Referenced by process_options().
◆ Valid_Global_Groups()
| int Valid_Global_Groups | ( | char * | UserName, |
| const char ** | Groups | ||
| ) |
Definition at line 602 of file ext_ad_group_acl.cc.
References add_User_Group(), build_groups_DN_array(), debug(), DefaultDomain, GC_MODE, Get_primaryGroup(), Get_WIN32_ErrorMessage(), GetLDAPPath(), LDAP_MODE, My_NameTranslate(), NTV_VALID_DOMAIN_SEPARATOR, NULL, Recursive_Memberof(), safe_free, User_Groups, User_Groups_Count, and wccmparray().
Referenced by main().
◆ Valid_Local_Groups()
| int Valid_Local_Groups | ( | char * | UserName, |
| const char ** | Groups | ||
| ) |
Definition at line 524 of file ext_ad_group_acl.cc.
References assert, debug(), Get_WIN32_ErrorMessage(), NULL, and wcstrcmparray().
Referenced by main().
◆ wccmparray()
|
static |
Definition at line 373 of file ext_ad_group_acl.cc.
References debug().
Referenced by Valid_Global_Groups().
◆ wcstrcmparray()
|
static |
Definition at line 386 of file ext_ad_group_acl.cc.
References debug(), and use_case_insensitive_compare.
Referenced by Valid_Local_Groups().
Variable Documentation
◆ ADSI_Path
| enum ADSI_PATH ADSI_Path |
◆ DefaultDomain
| char* DefaultDomain = nullptr |
Definition at line 105 of file ext_ad_group_acl.cc.
Referenced by main(), process_options(), and Valid_Global_Groups().
◆ machinedomain
| char* machinedomain |
Definition at line 103 of file ext_ad_group_acl.cc.
Referenced by main().
◆ mypid
| pid_t mypid |
Definition at line 102 of file ext_ad_group_acl.cc.
Referenced by main().
◆ NTV_VALID_DOMAIN_SEPARATOR
| const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/" |
Definition at line 106 of file ext_ad_group_acl.cc.
Referenced by Valid_Global_Groups().
◆ numberofgroups
| int numberofgroups = 0 |
Definition at line 107 of file ext_ad_group_acl.cc.
Referenced by build_groups_DN_array(), and main().
◆ program_name
| char* program_name |
Definition at line 101 of file ext_ad_group_acl.cc.
Referenced by main(), process_options(), and usage().
◆ use_case_insensitive_compare
| int use_case_insensitive_compare = 0 |
Definition at line 104 of file ext_ad_group_acl.cc.
Referenced by main(), process_options(), and wcstrcmparray().
◆ use_global
| int use_global = 0 |
Definition at line 100 of file ext_ad_group_acl.cc.
Referenced by main(), and process_options().
◆ User_Groups
| wchar_t** User_Groups |
Definition at line 110 of file ext_ad_group_acl.cc.
Referenced by add_User_Group(), and Valid_Global_Groups().
◆ User_Groups_Count
| int User_Groups_Count = 0 |
Definition at line 111 of file ext_ad_group_acl.cc.
Referenced by add_User_Group(), and Valid_Global_Groups().
◆ WIN32_COM_initialized
| int WIN32_COM_initialized = 0 |
Definition at line 108 of file ext_ad_group_acl.cc.
Referenced by CloseCOM(), and My_NameTranslate().
◆ WIN32_ErrorMessage
| char* WIN32_ErrorMessage = nullptr |
Definition at line 109 of file ext_ad_group_acl.cc.
Referenced by Get_WIN32_ErrorMessage().
