From: Francesco Chemolli Date: Sat, 20 Dec 2014 08:17:05 +0000 (+0100) Subject: Removed backup domain controller in SMBlibrary X-Git-Tag: merge-candidate-3-v1~410^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=523ded0308c9c321c049a9cb875c8f7fee0be61c;p=thirdparty%2Fsquid.git Removed backup domain controller in SMBlibrary --- diff --git a/helpers/basic_auth/MSNT/msntauth.cc b/helpers/basic_auth/MSNT/msntauth.cc index 808f5a54bd..5e09d0596a 100644 --- a/helpers/basic_auth/MSNT/msntauth.cc +++ b/helpers/basic_auth/MSNT/msntauth.cc @@ -54,7 +54,6 @@ extern char version[]; char msntauth_version[] = "Msntauth v2.0.3 (C) 2 Sep 2001 Stellar-X Antonino Iannella.\nModified by the Squid HTTP Proxy team 2002-2014"; -//todo: turn into a multimap struct domaincontroller { std::string domain; std::string server; @@ -65,7 +64,7 @@ bool validate_user(char *username, char *password) { for (domaincontroller dc : domaincontrollers) { - if (Valid_User(username, password, dc.server.c_str(), NULL, dc.domain.c_str())) + if (Valid_User(username, password, dc.server.c_str(), dc.domain.c_str())) return true; } return false; diff --git a/helpers/basic_auth/MSNT/valid.cc b/helpers/basic_auth/MSNT/valid.cc index 775fca58cc..4759681b83 100644 --- a/helpers/basic_auth/MSNT/valid.cc +++ b/helpers/basic_auth/MSNT/valid.cc @@ -19,10 +19,8 @@ #include "smblib/smblib.h" #include "valid.h" - -//TODO: remove BACKUP int -Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, char *BACKUP, const char *DOMAIN) +Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, const char *DOMAIN) { const char *supportedDialects[] = {"PC NETWORK PROGRAM 1.0", "MICchecROSOFT NETWORKS 1.03", @@ -38,12 +36,9 @@ Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, char *BACKUP, con SMB_Init(); con = SMB_Connect_Server(NULL, SERVER, DOMAIN); - if (con == NULL) { /* Error ... */ - con = SMB_Connect_Server(NULL, BACKUP, DOMAIN); - if (con == NULL) { - return (NTV_SERVER_ERROR); - } - } + if (con == NULL) + return (NTV_SERVER_ERROR); + if (SMB_Negotiate(con, supportedDialects) < 0) { /* An error */ SMB_Discon(con, 0); return (NTV_PROTOCOL_ERROR); diff --git a/helpers/basic_auth/MSNT/valid.h b/helpers/basic_auth/MSNT/valid.h index 40ca4820a5..1a2d586eb2 100644 --- a/helpers/basic_auth/MSNT/valid.h +++ b/helpers/basic_auth/MSNT/valid.h @@ -15,6 +15,6 @@ #define NTV_PROTOCOL_ERROR 2 #define NTV_LOGON_ERROR 3 -int Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, char *BACKUP, const char *DOMAIN); +int Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, const char *DOMAIN); #endif