#ifdef PAM_RHOST
if (rhost == NULL) {
- our_rhost = client_name(get_client_fd());
+ our_rhost = client_name(smbd_server_fd());
if (strequal(our_rhost,"UNKNOWN"))
- our_rhost = client_addr(get_client_fd(),addr,sizeof(addr));
+ our_rhost = client_addr(smbd_server_fd(), addr,
+ sizeof(addr));
} else {
our_rhost = rhost;
}
/* The following definitions come from smbd/server.c */
int smbd_server_fd(void);
-int get_client_fd(void);
struct event_context *smbd_event_context(void);
struct messaging_context *smbd_messaging_context(void);
struct memcache *smbd_memcache(void);
#include "includes.h"
-int get_client_fd(void)
+int smbd_server_fd(void)
{
return -1;
}
if (strequal(tmp_local_machine, "*SMBSERVER") ||
strequal(tmp_local_machine, "*SMBSERV") ) {
SAFE_FREE(local_machine);
- local_machine = SMB_STRDUP(client_socket_addr(get_client_fd(),
+ local_machine = SMB_STRDUP(client_socket_addr(smbd_server_fd(),
addr, sizeof(addr)) );
SAFE_FREE(tmp_local_machine);
return local_machine ? true : false;
break;
case 'I' : {
int offset = 0;
- client_addr(get_client_fd(), addr, sizeof(addr));
+ client_addr(smbd_server_fd(), addr, sizeof(addr));
if (strnequal(addr,"::ffff:",7)) {
offset = 7;
}
break;
}
case 'i':
- a_string = realloc_string_sub( a_string, "%i",
- client_socket_addr(get_client_fd(), addr, sizeof(addr)) );
+ a_string = realloc_string_sub(
+ a_string, "%i",
+ client_socket_addr(smbd_server_fd(),
+ addr, sizeof(addr)));
break;
case 'L' :
if ( StrnCaseCmp(p, "%LOGONSERVER%", strlen("%LOGONSERVER%")) == 0 ) {
a_string = realloc_string_sub(a_string, "%N", automount_server(smb_name));
break;
case 'M' :
- a_string = realloc_string_sub(a_string, "%M", client_name(get_client_fd()));
+ a_string = realloc_string_sub(
+ a_string, "%M", client_name(smbd_server_fd()));
break;
case 'R' :
a_string = realloc_string_sub(a_string, "%R", remote_proto);
if (readret == -1) {
save_errno = errno;
- if (fd == get_client_fd()) {
+ if (fd == smbd_server_fd()) {
/* Try and give an error message
* saying what client failed. */
DEBUG(0,("read_fd_with_timeout: "
if (selrtn == -1) {
save_errno = errno;
/* something is wrong. Maybe the socket is dead? */
- if (fd == get_client_fd()) {
+ if (fd == smbd_server_fd()) {
/* Try and give an error message saying
* what client failed. */
DEBUG(0,("read_fd_with_timeout: timeout "
if (readret == -1) {
save_errno = errno;
/* the descriptor is probably dead */
- if (fd == get_client_fd()) {
+ if (fd == smbd_server_fd()) {
/* Try and give an error message
* saying what client failed. */
DEBUG(0,("read_fd_with_timeout: timeout "
return ret;
}
- if (fd == get_client_fd()) {
+ if (fd == smbd_server_fd()) {
char addr[INET6_ADDRSTRLEN];
/*
* Try and give an error message saying what client failed.
*space = '\0';
- if (strncmp(client_addr(get_client_fd(),addr,sizeof(addr)),
+ if (strncmp(client_addr(smbd_server_fd(),addr,sizeof(addr)),
buf, strlen(buf)) == 0) {
found = true;
break;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, user);
- clientname = client_name(get_client_fd());
+ clientname = client_name(smbd_server_fd());
if (strcmp(clientname, "UNKNOWN") == 0) {
- clientname = client_addr(get_client_fd(),addr,sizeof(addr));
+ clientname = client_addr(smbd_server_fd(),addr,sizeof(addr));
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, pjob->user);
- clientname = client_name(get_client_fd());
+ clientname = client_name(smbd_server_fd());
if (strcmp(clientname, "UNKNOWN") == 0) {
- clientname = client_addr(get_client_fd(),addr,sizeof(addr));
+ clientname = client_addr(smbd_server_fd(),addr,sizeof(addr));
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
*/
if (!allow_access(lp_domain_hostsdeny(), lp_domain_hostsallow(),
- client_name(get_client_fd()),
- client_addr(get_client_fd(),addr,sizeof(addr)))) {
+ client_name(smbd_server_fd()),
+ client_addr(smbd_server_fd(),addr,sizeof(addr)))) {
DEBUG(0,("get_md4pw: Workstation %s denied access to domain\n", mach_acct));
return False;
}
/* check smb.conf parameters and the the sec_desc */
- if ( !check_access(get_client_fd(), lp_hostsallow(snum), lp_hostsdeny(snum)) ) {
+ if ( !check_access(smbd_server_fd(), lp_hostsallow(snum),
+ lp_hostsdeny(snum)) ) {
DEBUG(3, ("access DENIED (hosts allow/deny) for printer open\n"));
ZERO_STRUCTP(r->out.handle);
return WERR_ACCESS_DENIED;
char addr[INET6_ADDRSTRLEN];
char *p = addr;
- client_socket_addr(get_client_fd(),addr,sizeof(addr));
+ client_socket_addr(smbd_server_fd(),addr,sizeof(addr));
if (strncmp("::ffff:", addr, 7) == 0) {
p = addr + 7;
server_fd = fd;
}
-int get_client_fd(void)
-{
- return server_fd;
-}
-
struct event_context *smbd_event_context(void)
{
return server_event_context();
add_session_user(sconn, conn->server_info->unix_name);
safe_strcpy(conn->client_address,
- client_addr(get_client_fd(),addr,sizeof(addr)),
+ client_addr(smbd_server_fd(),addr,sizeof(addr)),
sizeof(conn->client_address)-1);
conn->num_files_open = 0;
conn->lastused = conn->lastused_count = time(NULL);
DEBUG(3,("%s (%s) couldn't find service %s\n",
get_remote_machine_name(),
- client_addr(get_client_fd(),addr,sizeof(addr)),
+ client_addr(smbd_server_fd(),addr,sizeof(addr)),
service));
*status = NT_STATUS_BAD_NETWORK_NAME;
return NULL;
client_name() handles this case internally.
*/
- hostname = client_name(get_client_fd());
+ hostname = client_name(smbd_server_fd());
if (strcmp(hostname, "UNKNOWN") == 0) {
- hostname = client_addr(get_client_fd(),addr,sizeof(addr));
+ hostname = client_addr(smbd_server_fd(),addr,sizeof(addr));
}
fstrcpy(sessionid.username, vuser->server_info->unix_name);
sessionid.gid = vuser->server_info->utok.gid;
fstrcpy(sessionid.remote_machine, get_remote_machine_name());
fstrcpy(sessionid.ip_addr_str,
- client_addr(get_client_fd(),addr,sizeof(addr)));
+ client_addr(smbd_server_fd(),addr,sizeof(addr)));
sessionid.connect_start = time(NULL);
if (!smb_pam_claim_session(sessionid.username, sessionid.id_str,
char addr[INET6_ADDRSTRLEN];
struct shutdown_state state;
- state.ip = client_addr(get_client_fd(),addr,sizeof(addr));
+ state.ip = client_addr(smbd_server_fd(),addr,sizeof(addr));
state.msg_ctx = msg_ctx;
connections_forall_read(shutdown_other_smbds, &state);
}
struct cmd_set *cmd_set;
} *cmd_list;
-int get_client_fd(void)
-{
- return -1;
-}
-
/****************************************************************************
handle completion of commands for readline
****************************************************************************/