This breaks the perfcol_onefs() build.
Tim, Steve, this use of smbd_server_fd is replacable by calls into
substitute.c. I don't have a onefs environment around to build a fix, so I've
decided to insert an #error, making it not compile. The fix should be pretty
obvious, you can get the socket data via "%I" and "%i" substitutions.
/* The following definitions come from smbd/server.c */
-int smbd_server_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 smbd_server_fd(void)
-{
- return -1;
-}
-
int find_service(fstring service)
{
return -1;
/* get address info once, doesn't change for process */
if (rem_addr == 0) {
- struct sockaddr_storage sa;
- socklen_t sa_len;
- int fd = smbd_server_fd();
-
- sa_len = sizeof sa;
- if (getpeername(fd, (struct sockaddr *)&sa, &sa_len) == 0 &&
- sa.ss_family == AF_INET)
- rem_addr = ((struct sockaddr_in *)&sa)->sin_addr.s_addr;
- else
+
+#error Isilon, please remove this after testing the code below
+
+ char *addr;
+
+ addr = talloc_sub_basic(talloc_tos(), "", "", "%I");
+ if (addr != NULL) {
+ rem_addr = interpret_addr(addr);
+ TALLOC_FREE(addr);
+ } else {
rem_addr = ISC_MASKED_ADDR;
+ }
- sa_len = sizeof sa;
- if (getsockname(fd, (struct sockaddr *)&sa, &sa_len) == 0 &&
- sa.ss_family == AF_INET)
- loc_addr = ((struct sockaddr_in *)&sa)->sin_addr.s_addr;
- else
+ addr = talloc_sub_basic(talloc_tos(), "", "", "%i");
+ if (addr != NULL) {
+ loc_addr = interpret_addr(addr);
+ TALLOC_FREE(addr);
+ } else {
loc_addr = ISC_MASKED_ADDR;
+ }
}
/*
struct {
/*
- * fd for the fcntl lock mutexing access to smbd_server_fd
+ * fd for the fcntl lock mutexing access to our sock
*/
int socket_lock_fd;
extern int dcelogin_atmost_once;
#endif /* WITH_DFS */
-int smbd_server_fd(void)
-{
- return server_fd;
-}
-
static void smbd_set_server_fd(int fd)
{
struct smbd_server_connection *sconn = smbd_server_conn;
char addr[INET6_ADDRSTRLEN];
const char *name;
- server_fd = fd;
-
sconn->sock = fd;
/*
exit_server("normal exit");
}
-static int server_fd = -1;
int last_message = -1;
-int smbd_server_fd(void)
-{
- return server_fd;
-}
-
struct event_context *smbd_event_context(void)
{
static struct event_context *ctx;
poptFreeContext(pc);
/* TODO: check output */
- reload_services(smbd_messaging_context(), smbd_server_fd(), False);
+ reload_services(smbd_messaging_context(), -1, False);
/* the following functions are part of the Samba debugging
facilities. See lib/debug.c */