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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Copyright 2000 The FreeRADIUS server project
21 #include <sys/types.h>
24 #include "smblib-priv.h"
27 SMB_Handle_Type SMB_Connect_Server(void *, char *, char *);
29 int Valid_User(char *USERNAME,char *PASSWORD,char *SERVER,char *BACKUP, char *DOMAIN)
31 char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
32 "MICROSOFT NETWORKS 1.03",
33 "MICROSOFT NETWORKS 3.0",
43 con = SMB_Connect_Server(NULL, SERVER, DOMAIN);
44 if (con == NULL) { /* Error ... */
45 con = SMB_Connect_Server(NULL, BACKUP, DOMAIN);
47 return(NTV_SERVER_ERROR);
50 if (SMB_Negotiate(con, SMB_Prots) < 0) { /* An error */
52 return(NTV_PROTOCOL_ERROR);
54 /* Test for a server in share level mode do not authenticate against it */
55 if (con -> Security == 0)
58 return(NTV_PROTOCOL_ERROR);
61 if (SMB_Logon_Server(con, USERNAME, PASSWORD) < 0) {
63 return(NTV_LOGON_ERROR);