4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 * Copyright 2000,2006 The FreeRADIUS server project
21 #include <freeradius-devel/ident.h>
24 #include <sys/types.h>
27 #include "smblib-priv.h"
30 SMB_Handle_Type SMB_Connect_Server(void *, char *, char *);
32 int Valid_User(char *USERNAME,char *PASSWORD,char *SERVER,char *BACKUP, char *DOMAIN)
34 char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
35 "MICROSOFT NETWORKS 1.03",
36 "MICROSOFT NETWORKS 3.0",
46 con = SMB_Connect_Server(NULL, SERVER, DOMAIN);
47 if (con == NULL) { /* Error ... */
48 con = SMB_Connect_Server(NULL, BACKUP, DOMAIN);
50 return(NTV_SERVER_ERROR);
53 if (SMB_Negotiate(con, SMB_Prots) < 0) { /* An error */
55 return(NTV_PROTOCOL_ERROR);
57 /* Test for a server in share level mode do not authenticate against it */
58 if (con -> Security == 0)
61 return(NTV_PROTOCOL_ERROR);
64 if (SMB_Logon_Server(con, USERNAME, PASSWORD) < 0) {
66 return(NTV_LOGON_ERROR);