1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

s3-smbd: Remove obsolete smbd_set_server_fd().

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2011-06-16 16:08:09 +02:00 committed by Andrew Bartlett
parent cbec251f9a
commit b2511a280a
3 changed files with 6 additions and 37 deletions

View File

@ -1819,7 +1819,6 @@ void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
NTSTATUS can_delete_directory(struct connection_struct *conn,
const char *dirname);
bool change_to_root_user(void);
void smbd_set_server_fd(int fd);
void contend_level2_oplocks_begin(files_struct *fsp,
enum level2_contention_type type);
void contend_level2_oplocks_end(files_struct *fsp,

View File

@ -176,32 +176,3 @@ void smbd_init_globals(void)
smbd_server_conn->smb1.echo_handler.trusted_fd = -1;
smbd_server_conn->smb1.echo_handler.socket_lock_fd = -1;
}
void smbd_set_server_fd(int fd)
{
struct smbd_server_connection *sconn = smbd_server_conn;
char addr[INET6_ADDRSTRLEN];
const char *name;
sconn->sock = fd;
/*
* Initialize sconn->client_id: If we can't find the client's
* name, default to its address.
*/
client_addr(fd, sconn->client_id.addr, sizeof(sconn->client_id.addr));
name = client_name(sconn->sock);
if (strcmp(name, "UNKNOWN") != 0) {
name = talloc_strdup(sconn, name);
} else {
name = NULL;
}
sconn->client_id.name =
(name != NULL) ? name : sconn->client_id.addr;
sub_set_socket_ids(sconn->client_id.addr, sconn->client_id.name,
client_socket_addr(sconn->sock, addr,
sizeof(addr)));
}

View File

@ -371,6 +371,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
uint16_t flags,
void *private_data)
{
struct smbd_server_connection *sconn = smbd_server_conn;
struct smbd_open_socket *s = talloc_get_type_abort(private_data,
struct smbd_open_socket);
struct sockaddr_storage addr;
@ -380,8 +381,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
uint64_t unique_id;
fd = accept(s->fd, (struct sockaddr *)(void *)&addr,&in_addrlen);
smbd_set_server_fd(fd);
sconn->sock = fd;
if (fd == -1 && errno == EINTR)
return;
@ -392,14 +392,14 @@ static void smbd_accept_connection(struct tevent_context *ev,
}
if (s->parent->interactive) {
smbd_process(smbd_server_conn);
smbd_process(sconn);
exit_server_cleanly("end of interactive mode");
return;
}
if (!allowable_number_of_smbd_processes()) {
close(fd);
smbd_set_server_fd(-1);
sconn->sock = -1;
return;
}
@ -489,8 +489,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
getpeername failure if we reopen the logs
and use %I in the filename.
*/
smbd_set_server_fd(-1);
sconn->sock = -1;
if (pid != 0) {
add_child_pid(pid);
@ -1252,7 +1251,7 @@ extern void build_options(bool screen);
/* Started from inetd. fd 0 is the socket. */
/* We will abort gracefully when the client or remote system
goes away */
smbd_set_server_fd(dup(0));
smbd_server_conn->sock = dup(0);
/* close our standard file descriptors */
close_low_fds(False); /* Don't close stderr */