summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-24 14:57:47 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-24 14:57:47 +0100
commit2c9444685d6fd535244638cc51871fd25d1eb1d6 (patch)
treec659ed0d013b6b6ab732bf4cc6e1385ca73ece8c /source3
parente7cd5291db8df13ca60c081727c7d804308c8737 (diff)
downloadsamba-2c9444685d6fd535244638cc51871fd25d1eb1d6.tar.gz
samba-2c9444685d6fd535244638cc51871fd25d1eb1d6.tar.bz2
samba-2c9444685d6fd535244638cc51871fd25d1eb1d6.zip
cli_pipe: Avoid sys_connect.
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index db89b3165b..5f5f99201d 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2502,6 +2502,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
struct sockaddr_un addr;
NTSTATUS status;
int fd;
+ socklen_t salen;
result = talloc_zero(mem_ctx, struct rpc_pipe_client);
if (result == NULL) {
@@ -2531,8 +2532,9 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
ZERO_STRUCT(addr);
addr.sun_family = AF_UNIX;
strlcpy(addr.sun_path, socket_path, sizeof(addr.sun_path));
+ salen = sizeof(struct sockaddr_un);
- if (sys_connect(fd, (struct sockaddr *)(void *)&addr) == -1) {
+ if (connect(fd, (struct sockaddr *)(void *)&addr, salen) == -1) {
DEBUG(0, ("connect(%s) failed: %s\n", socket_path,
strerror(errno)));
close(fd);