]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/basic/SMB_LM/valid.cc
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 #include "auth/basic/SMB_LM/valid.h"
11 #include "smblib/smblib.h"
14 #include <sys/types.h>
25 Valid_User(char *USERNAME
, char *PASSWORD
, const char *SERVER
, char *, const char *DOMAIN
)
27 const char *supportedDialects
[] = {"PC NETWORK PROGRAM 1.0",
28 "MICROSOFT NETWORKS 1.03",
29 "MICROSOFT NETWORKS 3.0",
40 con
= SMB_Connect_Server(NULL
, SERVER
, DOMAIN
);
42 return (NTV_SERVER_ERROR
);
44 if (SMB_Negotiate(con
, supportedDialects
) < 0) { /* An error */
46 return (NTV_PROTOCOL_ERROR
);
48 if (SMB_Logon_Server(con
, USERNAME
, PASSWORD
, NULL
, 0) < 0) {
50 return (NTV_LOGON_ERROR
);
53 return (NTV_NO_ERROR
);