diff options
author | Luke Leighton <lkcl@samba.org> | 1999-12-03 19:55:34 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-12-03 19:55:34 +0000 |
commit | 6eebe18fa9682f570127b08fb116ab561223de22 (patch) | |
tree | fb47ba04b4543590269c8cda39585a00eb26eace /source3/libsmb | |
parent | 7d01f964ff3c1a11bd72d987312f9826fee1c124 (diff) | |
download | samba-6eebe18fa9682f570127b08fb116ab561223de22.tar.gz samba-6eebe18fa9682f570127b08fb116ab561223de22.tar.bz2 samba-6eebe18fa9682f570127b08fb116ab561223de22.zip |
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)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)); |