valid.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34*/
35
36#ifndef _VALID_H_
37#define _VALID_H_
38
39#include "sspwin32.h"
40
41#if HAVE_WINDOWS_H
42#include <windows.h>
43#endif
44#include <lm.h>
45#include <sys/types.h>
46#undef debug
47
48/************* CONFIGURATION ***************/
49/* SMB User verification function */
50
51#define NTV_NO_ERROR 0
52#define NTV_SERVER_ERROR 1
53#define NTV_GROUP_ERROR 2
54#define NTV_LOGON_ERROR 3
55
56#ifndef LOGON32_LOGON_NETWORK
57#define LOGON32_LOGON_NETWORK 3
58#endif
59
60#define NTV_DEFAULT_DOMAIN "."
61
62extern char * NTAllowedGroup;
63extern char * NTDisAllowedGroup;
64extern int UseDisallowedGroup;
65extern int UseAllowedGroup;
66extern int debug_enabled;
67extern char Default_NTDomain[DNLEN+1];
68extern const char * errormsg;
69
78int Valid_User(char *UserName, char *Password, char *Group);
79
80/* Debugging stuff */
81#if defined(__GNUC__) /* this is really a gcc-ism */
82#include <unistd.h>
83static char *__foo;
84#define debug(X...) if (debug_enabled) { \
85 fprintf(stderr,"nt_auth[%d](%s:%d): ", getpid(), \
86 ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
87 __LINE__);\
88 fprintf(stderr,X); }
89#else /* __GNUC__ */
90static void
91debug(char *format,...)
92{
93 if (debug_enabled) {
94 va_list args;
95
96 va_start(args,format);
97 fprintf(stderr, "nt_auth[%d]: ",getpid());
98 vfprintf(stderr, format, args);
99 va_end(args);
100 }
101}
102#endif /* __GNUC__ */
103
104#endif
105
int Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, char *BACKUP, const char *DOMAIN)
Definition: valid.cc:25
int debug_enabled
Definition: debug.cc:13
char * NTAllowedGroup
int UseAllowedGroup
static void debug(char *format,...)
Definition: valid.h:91
char * NTDisAllowedGroup
int UseDisallowedGroup
const char * errormsg
Definition: valid.cc:52
char Default_NTDomain[DNLEN+1]
Definition: valid.cc:51

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors