From f521205cb3d188fdcadcbd205dcfda4a7dcb89a0 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 4 Dec 1999 19:14:37 +0000 Subject: jeremy is going to hate me for this. created an "nmb-agent" utility that, yes: it connects to the 137 socket and accepts unix socket connections which it redirects onto port 137. it uses the name_trn_id field to filter requests to the correct location. name_query() and name_status() are the first victims to use this feature (by specifying a file descriptor of -1). (This used to be commit d923bc8da2cf996408194d98381409191dd81a16) --- source3/libsmb/clientgen.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'source3/libsmb/clientgen.c') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index fea105887f..86edfa8bec 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -2949,7 +2949,6 @@ static int cli_init_redirect(struct cli_state *cli, const struct user_credentials *usr) { int sock; - struct sockaddr_un sa; fstring ip_name; struct cli_state cli_redir; fstring path; @@ -2969,29 +2968,13 @@ static int cli_init_redirect(struct cli_state *cli, srv_name = ip_name; } - sock = socket(AF_UNIX, SOCK_STREAM, 0); + sock = open_pipe_sock(path); if (sock < 0) { - DEBUG(0, ("unix socket open failed\n")); return sock; } - ZERO_STRUCT(sa); - sa.sun_family = AF_UNIX; - safe_strcpy(sa.sun_path, path, sizeof(sa.sun_path)-1); - - DEBUG(10, ("socket open succeeded. file name: %s\n", sa.sun_path)); - - if (connect(sock, (struct sockaddr*) &sa, sizeof(sa)) < 0) - { - DEBUG(0,("socket connect to %s failed\n", sa.sun_path)); - close(sock); - return False; - } - - DEBUG(10,("connect succeeded\n")); - ZERO_STRUCT(data); p = &data[4]; -- cgit