]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/external/kerberos_ldap_group/support.h
3073b8cd8ab19222617b7906b4cf8cd89386e272
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 * -----------------------------------------------------------------------------
12 * Author: Markus Moeller (markus_moeller at compuserve.com)
14 * Copyright (C) 2007 Markus Moeller. All rights reserved.
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
30 * -----------------------------------------------------------------------------
33 #ifndef SQUID_SRC_ACL_EXTERNAL_KERBEROS_LDAP_GROUP_SUPPORT_H
34 #define SQUID_SRC_ACL_EXTERNAL_KERBEROS_LDAP_GROUP_SUPPORT_H
36 #define KERBEROS_LDAP_GROUP_VERSION "1.4.0sq"
38 #include "compat/krb5.h"
43 #endif /* HAVE_COM_ERR_H */
44 #define LDAP_DEPRECATED 1
45 #if HAVE_LDAP_REBIND_FUNCTION
46 #define LDAP_REFERRALS
54 #if HAVE_MOZLDAP_LDAP_H
55 #include <mozldap/ldap.h>
61 struct gdstruct
*next
;
66 struct ndstruct
*next
;
71 struct lsstruct
*next
;
90 struct gdstruct
*groups
;
91 struct ndstruct
*ndoms
;
92 struct lsstruct
*lservs
;
96 extern int log_enabled
;
98 /* the macro overload style is really a gcc-ism */
103 fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
107 #define error(X...) \
108 fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
112 fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
117 /* non-GCC compilers can't do the above macro define yet. */
118 void log(char *format
,...);
119 void error(char *format
,...);
120 void warn(char *format
,...);
135 void init_args(struct main_args
*margs
);
136 void clean_args(struct main_args
*margs
);
137 const char *LogTime(void);
139 int check_memberof(struct main_args
*margs
, char *user
, char *domain
);
140 int get_memberof(struct main_args
*margs
, char *user
, char *domain
, char *group
);
142 char *get_netbios_name(struct main_args
*margs
, char *netbios
);
144 int create_gd(struct main_args
*margs
);
145 int create_nd(struct main_args
*margs
);
146 int create_ls(struct main_args
*margs
);
148 size_t get_ldap_hostname_list(struct main_args
*margs
, struct hstruct
**hlist
, size_t nhosts
, char *domain
);
149 size_t get_hostname_list(struct hstruct
**hlist
, size_t nhosts
, char *name
);
150 size_t free_hostname_list(struct hstruct
**hlist
, size_t nhosts
);
152 #if HAVE_SASL_H || HAVE_SASL_SASL_H || HAVE_SASL_DARWIN
153 int tool_sasl_bind(LDAP
* ld
, char *binddn
, char *ssl
);
157 #define MAX_DOMAINS 16
160 krb5_context context
;
161 krb5_ccache cc
[MAX_DOMAINS
];
162 char* mem_ccache
[MAX_DOMAINS
];
165 int krb5_create_cache(char *domain
, char* princ
);
166 void krb5_cleanup(void);
169 #define PROGRAM "kerberos_ldap_group"
171 #endif /* SQUID_SRC_ACL_EXTERNAL_KERBEROS_LDAP_GROUP_SUPPORT_H */