Squid Web Cache v8/master
Loading...
Searching...
No Matches
valid.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2026 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9/*
10 NT_auth - Version 2.0
11
12 Modified to act as a Squid authenticator module.
13 Returns OK for a successful authentication, or ERR upon error.
14
15 Guido Serassio, Torino - Italy
16
17 Uses code from -
18 Antonino Iannella 2000
19 Andrew Tridgell 1997
20 Richard Sharpe 1996
21 Bill Welliver 1999
22
23 * Distributed freely under the terms of the GNU General Public License,
24 * version 2 or later. See the file COPYING for licensing details
25 *
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, see <https://www.gnu.org/licenses/>.
33 */
34
35#ifndef SQUID_SRC_AUTH_BASIC_SSPI_VALID_H
36#define SQUID_SRC_AUTH_BASIC_SSPI_VALID_H
37
38#include "sspi/sspwin32.h"
39
40#include <lm.h>
41#include <sys/types.h>
42#undef debug
43
44/************* CONFIGURATION ***************/
45/* SMB User verification function */
46
47#define NTV_NO_ERROR 0
48#define NTV_SERVER_ERROR 1
49#define NTV_GROUP_ERROR 2
50#define NTV_LOGON_ERROR 3
51
52#ifndef LOGON32_LOGON_NETWORK
53#define LOGON32_LOGON_NETWORK 3
54#endif
55
56#define NTV_DEFAULT_DOMAIN "."
57
58extern char * NTAllowedGroup;
59extern char * NTDisAllowedGroup;
60extern int UseDisallowedGroup;
61extern int UseAllowedGroup;
62extern int debug_enabled;
63extern char Default_NTDomain[DNLEN+1];
64extern const char * errormsg;
65
74int Valid_User(char *UserName, char *Password, char *Group);
75
76/* Debugging stuff */
77#if defined(__GNUC__) /* this is really a gcc-ism */
78#include <unistd.h>
79static char *__foo;
80#define debug(X...) if (debug_enabled) { \
81 fprintf(stderr,"nt_auth[%d](%s:%d): ", getpid(), \
82 ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
83 __LINE__);\
84 fprintf(stderr,X); }
85#else /* __GNUC__ */
86static void
87debug(char *format,...)
88{
89 if (debug_enabled) {
90 va_list args;
91
92 va_start(args,format);
93 fprintf(stderr, "nt_auth[%d]: ",getpid());
94 vfprintf(stderr, format, args);
95 va_end(args);
96 }
97}
98#endif /* __GNUC__ */
99
100#endif /* SQUID_SRC_AUTH_BASIC_SSPI_VALID_H */
101
int debug_enabled
Definition debug.cc:13
char * NTAllowedGroup
int Valid_User(char *UserName, char *Password, char *Group)
Definition valid.cc:119
int UseAllowedGroup
static void debug(char *format,...)
Definition valid.h:87
char * NTDisAllowedGroup
int UseDisallowedGroup
const char * errormsg
Definition valid.cc:43
char Default_NTDomain[DNLEN+1]
Definition valid.cc:42