]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/external/kerberos_ldap_group/support.h
2 * Copyright (C) 1996-2020 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 #define KERBEROS_LDAP_GROUP_VERSION "1.4.0sq"
38 #define KERBEROS_APPLE_DEPRECATED(x)
42 #if HAVE_BROKEN_SOLARIS_KRB5_H
43 #warn "Warning! You have a broken Solaris <krb5.h> system header"
44 #warn "http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512"
45 #if defined(__cplusplus)
46 #define KRB5INT_BEGIN_DECLS extern "C" {
47 #define KRB5INT_END_DECLS
50 #endif /* HAVE_BROKEN_SOLARIS_KRB5_H */
51 #if HAVE_BROKEN_HEIMDAL_KRB5_H
58 #endif /* HAVE_KRB5_H */
62 #endif /* HAVE_COM_ERR_H */
64 #define LDAP_DEPRECATED 1
65 #if HAVE_LDAP_REBIND_FUNCTION
66 #define LDAP_REFERRALS
74 #if HAVE_MOZLDAP_LDAP_H
75 #include <mozldap/ldap.h>
81 struct gdstruct
*next
;
86 struct ndstruct
*next
;
91 struct lsstruct
*next
;
110 struct gdstruct
*groups
;
111 struct ndstruct
*ndoms
;
112 struct lsstruct
*lservs
;
116 SQUIDCEXTERN
int log_enabled
;
118 /* the macro overload style is really a gcc-ism */
123 fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
127 #define error(X...) \
128 fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
132 fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
137 /* non-GCC compilers can't do the above macro define yet. */
138 void log(char *format
,...);
139 void error(char *format
,...);
140 void warn(char *format
,...);
155 void init_args(struct main_args
*margs
);
156 void clean_args(struct main_args
*margs
);
157 const char *LogTime(void);
159 int check_memberof(struct main_args
*margs
, char *user
, char *domain
);
160 int get_memberof(struct main_args
*margs
, char *user
, char *domain
, char *group
);
162 char *get_netbios_name(struct main_args
*margs
, char *netbios
);
164 int create_gd(struct main_args
*margs
);
165 int create_nd(struct main_args
*margs
);
166 int create_ls(struct main_args
*margs
);
168 size_t get_ldap_hostname_list(struct main_args
*margs
, struct hstruct
**hlist
, size_t nhosts
, char *domain
);
169 size_t get_hostname_list(struct hstruct
**hlist
, size_t nhosts
, char *name
);
170 size_t free_hostname_list(struct hstruct
**hlist
, size_t nhosts
);
172 #if HAVE_SASL_H || HAVE_SASL_SASL_H || HAVE_SASL_DARWIN
173 int tool_sasl_bind(LDAP
* ld
, char *binddn
, char *ssl
);
177 #define MAX_DOMAINS 16
180 krb5_context context
;
181 krb5_ccache cc
[MAX_DOMAINS
];
182 char* mem_ccache
[MAX_DOMAINS
];
185 int krb5_create_cache(char *domain
, char* princ
);
186 void krb5_cleanup(void);
189 #define PROGRAM "kerberos_ldap_group"