summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-14 21:22:59 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-14 21:22:59 +0000
commite67a8d9d984dbdef307294358d7d9a7f4314ea09 (patch)
tree3552948e76404eda2ed99ff12ee8a48a219b72bd /source3/smbd
parent254470cb566fc06f5818830d105361d853648d6e (diff)
downloadsamba-e67a8d9d984dbdef307294358d7d9a7f4314ea09.tar.gz
samba-e67a8d9d984dbdef307294358d7d9a7f4314ea09.tar.bz2
samba-e67a8d9d984dbdef307294358d7d9a7f4314ea09.zip
server_cryptkey() now calling cli_connectserverlist(). stupid microsoft
idiotic *SMBSERVER connectionism added to cli_connect_serverlist(). also added check for protocol < LANMAN2. (This used to be commit c2bcb3a286f22ed4f0f55da2a3eb2bff17906fb1)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c78
1 files changed, 4 insertions, 74 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 726d93e404..7eed028a80 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -909,81 +909,11 @@ support for server level security
****************************************************************************/
struct cli_state *server_cryptkey(void)
{
- struct cli_state *cli;
- fstring desthost;
- struct in_addr dest_ip;
- extern fstring local_machine;
- char *p;
- BOOL connected_ok = False;
- struct nmb_name calling, called;
-
- cli = server_client();
-
- if (!cli_initialise(cli))
- return NULL;
-
- p = lp_passwordserver();
- while(p && next_token( &p, desthost, LIST_SEP, sizeof(desthost))) {
- standard_sub_basic(desthost);
- strupper(desthost);
-
- if(!resolve_name( desthost, &dest_ip, 0x20)) {
- DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost));
- continue;
- }
-
- if (ismyip(dest_ip)) {
- DEBUG(1,("Password server loop - disabling password server %s\n",desthost));
- continue;
- }
-
- if (cli_connect(cli, desthost, &dest_ip)) {
- DEBUG(3,("connected to password server %s\n",desthost));
- connected_ok = True;
- break;
- }
- }
-
- if (!connected_ok) {
- DEBUG(0,("password server not available\n"));
- cli_shutdown(cli);
- return NULL;
- }
-
- make_nmb_name(&calling, local_machine, 0x0 , scope);
- make_nmb_name(&called , desthost , 0x20, scope);
-
- if (!cli_session_request(cli, &calling, &called)) {
- /* try with *SMBSERVER if the first name fails */
- cli_shutdown(cli);
- make_nmb_name(&called , "*SMBSERVER", 0x20, scope);
- if (!cli_initialise(cli) ||
- !cli_connect(cli, desthost, &dest_ip) ||
- !cli_session_request(cli, &calling, &called)) {
- DEBUG(1,("%s rejected the session\n",desthost));
- cli_shutdown(cli);
- return NULL;
- }
- }
-
- DEBUG(3,("got session\n"));
-
- if (!cli_negprot(cli)) {
- DEBUG(1,("%s rejected the negprot\n",desthost));
- cli_shutdown(cli);
- return NULL;
- }
-
- if (cli->protocol < PROTOCOL_LANMAN2 ||
- !(cli->sec_mode & 1)) {
- DEBUG(1,("%s isn't in user level security mode\n",desthost));
- cli_shutdown(cli);
- return NULL;
+ if (cli_connect_serverlist(server_client(), lp_passwordserver()))
+ {
+ return server_client();
}
-
- DEBUG(3,("password server OK\n"));
-
- return cli;
+ return NULL;
}
/****************************************************************************