summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-14 10:22:12 +0200
committerVolker Lendecke <vl@samba.org>2010-08-16 13:13:10 +0200
commit96ae4570230d2d47e23da6909f6e21dd43a19868 (patch)
tree2227d283971d61991b7859ef05a8390e37eb00ee
parenta482b3e14ec4e3eada9c2477c9eae2bfbe017f53 (diff)
downloadsamba-96ae4570230d2d47e23da6909f6e21dd43a19868.tar.gz
samba-96ae4570230d2d47e23da6909f6e21dd43a19868.tar.bz2
samba-96ae4570230d2d47e23da6909f6e21dd43a19868.zip
s3: Remove get_client_fd()
-rw-r--r--source3/auth/pampass.c5
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/dummysmbd.c2
-rw-r--r--source3/lib/substitute.c13
-rw-r--r--source3/lib/util_sock.c8
-rw-r--r--source3/modules/vfs_expand_msdfs.c2
-rw-r--r--source3/printing/print_cups.c4
-rw-r--r--source3/printing/print_iprint.c4
-rw-r--r--source3/rpc_server/srv_netlog_nt.c4
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c3
-rw-r--r--source3/smbd/process.c2
-rw-r--r--source3/smbd/server.c5
-rw-r--r--source3/smbd/service.c4
-rw-r--r--source3/smbd/session.c6
-rw-r--r--source3/smbd/sesssetup.c2
-rw-r--r--source3/torture/vfstest.c5
16 files changed, 32 insertions, 38 deletions
diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c
index e08670f481..6c7294dd8b 100644
--- a/source3/auth/pampass.c
+++ b/source3/auth/pampass.c
@@ -479,9 +479,10 @@ static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rho
#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;
}
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 850710b2c7..80d23e5431 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5792,7 +5792,6 @@ void server_messaging_context_free(void);
/* 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);
diff --git a/source3/lib/dummysmbd.c b/source3/lib/dummysmbd.c
index ee88a78e7c..eb6bfe9474 100644
--- a/source3/lib/dummysmbd.c
+++ b/source3/lib/dummysmbd.c
@@ -23,7 +23,7 @@
#include "includes.h"
-int get_client_fd(void)
+int smbd_server_fd(void)
{
return -1;
}
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index dbb5f7d08a..e5f1b2dbdf 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -62,7 +62,7 @@ bool set_local_machine_name(const char *local_name, bool perm)
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;
@@ -609,7 +609,7 @@ static char *alloc_sub_basic(const char *smb_name, const char *domain_name,
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;
}
@@ -618,8 +618,10 @@ static char *alloc_sub_basic(const char *smb_name, const char *domain_name,
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 ) {
@@ -635,7 +637,8 @@ static char *alloc_sub_basic(const char *smb_name, const char *domain_name,
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);
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index ced76ebca9..bf04af10bd 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -466,7 +466,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf,
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: "
@@ -505,7 +505,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf,
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 "
@@ -539,7 +539,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf,
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 "
@@ -666,7 +666,7 @@ ssize_t write_data(int fd, const char *buffer, size_t N)
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.
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c
index 3d5ea9630c..2d9bd4fd90 100644
--- a/source3/modules/vfs_expand_msdfs.c
+++ b/source3/modules/vfs_expand_msdfs.c
@@ -70,7 +70,7 @@ static char *read_target_host(TALLOC_CTX *ctx, const char *mapfile)
*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;
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c
index f96e8e1726..2441cfc275 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -981,9 +981,9 @@ static int cups_job_submit(int snum, struct printjob *pjob)
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,
diff --git a/source3/printing/print_iprint.c b/source3/printing/print_iprint.c
index 2f6e5b2667..75324960ef 100644
--- a/source3/printing/print_iprint.c
+++ b/source3/printing/print_iprint.c
@@ -785,9 +785,9 @@ static int iprint_job_submit(int snum, struct printjob *pjob)
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,
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index b3e54050d4..4433a707ad 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -610,8 +610,8 @@ static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
*/
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;
}
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index cec0b7138e..1c04ef167a 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1642,7 +1642,8 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
/* 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;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index f40b7dda4b..9ce4bbb6f5 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2352,7 +2352,7 @@ static void release_ip(const char *ip, void *priv)
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;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 1c614dad0b..3c79dc46f9 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -62,11 +62,6 @@ static void smbd_set_server_fd(int fd)
server_fd = fd;
}
-int get_client_fd(void)
-{
- return server_fd;
-}
-
struct event_context *smbd_event_context(void)
{
return server_event_context();
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 9a345476dc..d32e53a568 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -690,7 +690,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
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);
@@ -1199,7 +1199,7 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
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;
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index 64274b771e..92742384bf 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -131,9 +131,9 @@ bool session_claim(struct server_id pid, user_struct *vuser)
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);
@@ -144,7 +144,7 @@ bool session_claim(struct server_id pid, user_struct *vuser)
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,
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index cca3a1abf6..1d8fe16203 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -1420,7 +1420,7 @@ static void setup_new_vc_session(struct messaging_context *msg_ctx)
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);
}
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 99358de29b..cac4621dd5 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -33,11 +33,6 @@ static struct cmd_list {
struct cmd_set *cmd_set;
} *cmd_list;
-int get_client_fd(void)
-{
- return -1;
-}
-
/****************************************************************************
handle completion of commands for readline
****************************************************************************/