/* check for sighup processing */
if (reload_after_sighup) {
- unbecome_user();
+ change_to_root_user();
DEBUG(1,("Reloading services after SIGHUP\n"));
reload_services(False);
reload_after_sighup = False;
do {
ret = receive_message_or_smb(inbuf,bufsize,timeout);
- got_keepalive = (ret && (CVAL(inbuf,0) == 0x85));
+ got_keepalive = (ret && (CVAL(inbuf,0) == SMBkeepalive));
} while (ret && got_keepalive);
return ret;
/* 0x19 */ { NULL, NULL, 0 },
/* 0x1a */ { "SMBreadbraw",reply_readbraw,AS_USER},
/* 0x1b */ { "SMBreadBmpx",reply_readbmpx,AS_USER},
-/* 0x1c */ { "SMBreadBs",NULL,AS_USER},
+/* 0x1c */ { "SMBreadBs",NULL,0 },
/* 0x1d */ { "SMBwritebraw",reply_writebraw,AS_USER},
-/* 0x1e */ { NULL,NULL,0},
-/* 0x1f */ { NULL,NULL,0},
-/* 0x20 */ { NULL,NULL,0},
+/* 0x1e */ { "SMBwriteBmpx",reply_writebmpx,AS_USER},
+/* 0x1f */ { "SMBwriteBs",reply_writebs,AS_USER},
+/* 0x20 */ { "SMBwritec",NULL,0},
/* 0x21 */ { NULL, NULL, 0 },
/* 0x22 */ { "SMBsetattrE",reply_setattrE,AS_USER | NEED_WRITE },
/* 0x23 */ { "SMBgetattrE",reply_getattrE,AS_USER },
/* does this protocol need to be run as root? */
if (!(flags & AS_USER))
- unbecome_user();
+ change_to_root_user();
/* does this protocol need a valid tree connection? */
if ((flags & AS_USER) && !conn) {
/* does this protocol need to be run as the connected user? */
- if ((flags & AS_USER) && !become_user(conn,session_tag)) {
+ if ((flags & AS_USER) && !change_to_user(conn,session_tag)) {
if (flags & AS_GUEST)
flags &= ~AS_USER;
else
}
/* load service specific parameters */
- if (conn && !become_service(conn,(flags & AS_USER)?True:False)) {
+ if (conn && !set_current_service(conn,(flags & AS_USER)?True:False)) {
return(ERROR_DOS(ERRSRV,ERRaccess));
}
/* does this protocol need to be run as guest? */
if ((flags & AS_GUEST) &&
- (!become_guest() ||
+ (!change_to_guest() ||
!check_access(smbd_server_fd(), lp_hostsallow(-1), lp_hostsdeny(-1)))) {
return(ERROR_DOS(ERRSRV,ERRaccess));
}
if (msg_type == 0)
show_msg(inbuf);
- else if(msg_type == 0x85)
+ else if(msg_type == SMBkeepalive)
return; /* Keepalive packet. */
nread = construct_reply(inbuf,outbuf,nread,max_send);
}
else
if (!send_smb(smbd_server_fd(),outbuf))
- exit_server("process_smb: send_smb failed.\n");
+ exit_server("process_smb: send_smb failed.");
}
trans_num++;
}
last_idle_closed_check = t;
/* become root again if waiting */
- unbecome_user();
+ change_to_root_user();
/* check if we need to reload services */
check_reload(t);
if (keepalive && (t - last_keepalive_sent_time)>keepalive)
{
- struct cli_state *cli = server_client();
- if (!send_keepalive(smbd_server_fd())) {
- DEBUG( 2, ( "Keepalive failed - exiting.\n" ) );
- return False;
- }
- /* also send a keepalive to the password server if its still
- connected */
- if (cli && cli->initialised)
- if (!send_keepalive(cli->fd)) {
- DEBUG( 2, ( "password server keepalive failed.\n"));
- cli_shutdown(cli);
- }
- last_keepalive_sent_time = t;
+ extern auth_authsupplied_info *negprot_global_auth_info;
+ if (!send_keepalive(smbd_server_fd())) {
+ DEBUG( 2, ( "Keepalive failed - exiting.\n" ) );
+ return False;
+ }
+
+ /* send a keepalive for a password server or the like.
+ This is attached to the auth_info created in the
+ negprot */
+ if (negprot_global_auth_info
+ && negprot_global_auth_info->challenge_set_method
+ && negprot_global_auth_info->challenge_set_method->send_keepalive) {
+ negprot_global_auth_info->challenge_set_method->send_keepalive
+ (&negprot_global_auth_info->challenge_set_method->private_data);
+ }
+
+ last_keepalive_sent_time = t;
}
/* check for connection timeouts */