From 6eebe18fa9682f570127b08fb116ab561223de22 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 3 Dec 1999 19:55:34 +0000 Subject: smb-agent improvements. added -D (daemon) option. smb agent is restricted to connections from the current user (socket is created with current user uid). (This used to be commit 5af076e4b7ee13eebe0b89748e3f5a1ef21f8c73) --- source3/libsmb/clientgen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 218ab67758..176be9948b 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -2938,6 +2938,7 @@ static int cli_init_redirect(struct cli_state *cli, struct sockaddr_un sa; fstring ip_name; struct cli_state cli_redir; + fstring path; pstring data; uint32 len; @@ -2945,6 +2946,8 @@ static int cli_init_redirect(struct cli_state *cli, char *in = cli->inbuf; char *out = cli->outbuf; + slprintf(path, sizeof(path)-1, "/tmp/smb-agent/smb.%d", getuid()); + if (strequal(srv_name, "*SMBSERVER")) { fstrcpy(ip_name, "\\\\"); @@ -2962,8 +2965,7 @@ static int cli_init_redirect(struct cli_state *cli, ZERO_STRUCT(sa); sa.sun_family = AF_UNIX; - safe_strcpy(sa.sun_path, "/tmp/smb-agent/smb.sock", - sizeof(sa.sun_path)-1); + safe_strcpy(sa.sun_path, path, sizeof(sa.sun_path)-1); DEBUG(10, ("socket open succeeded. file name: %s\n", sa.sun_path)); -- cgit