diff options
author | rsc <devnull@localhost> | 2005-03-18 19:34:22 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-18 19:34:22 +0000 |
commit | e3331bf21b87f735e265390322eac148a44d9036 (patch) | |
tree | 8ec4660016997e7bee4ad9650d0bce947f8b638b /src/cmd/auth | |
parent | 8c0613150ef8372743ee86f6a552e374c103f704 (diff) | |
download | plan9port-e3331bf21b87f735e265390322eac148a44d9036.tar.gz plan9port-e3331bf21b87f735e265390322eac148a44d9036.tar.bz2 plan9port-e3331bf21b87f735e265390322eac148a44d9036.zip |
use fixed name
Diffstat (limited to 'src/cmd/auth')
-rw-r--r-- | src/cmd/auth/ssh-agent.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/cmd/auth/ssh-agent.c b/src/cmd/auth/ssh-agent.c index ee223038..f8ded13d 100644 --- a/src/cmd/auth/ssh-agent.c +++ b/src/cmd/auth/ssh-agent.c @@ -93,7 +93,7 @@ void threadmain(int argc, char **argv) { int fd, pid, export, dotextlist; - char dir[100]; + char dir[100], *ns; char sock[200], addr[200]; uvlong x; @@ -129,13 +129,17 @@ threadmain(int argc, char **argv) if(dotextlist) listkeystext(); - x = ((uvlong)fastrand()<<32) | fastrand(); - x ^= ((uvlong)fastrand()<<32) | fastrand(); - snprint(dir, sizeof dir, "/tmp/ssh-%llux", x); - if((fd = create(dir, OREAD, DMDIR|0700)) < 0) - sysfatal("mkdir %s: %r", dir); - close(fd); - snprint(sock, sizeof sock, "%s/agent.%d", dir, pid); + ns = getns(); + snprint(sock, sizeof sock, "%s/ssh-agent.socket", ns); + if(0){ + x = ((uvlong)fastrand()<<32) | fastrand(); + x ^= ((uvlong)fastrand()<<32) | fastrand(); + snprint(dir, sizeof dir, "/tmp/ssh-%llux", x); + if((fd = create(dir, OREAD, DMDIR|0700)) < 0) + sysfatal("mkdir %s: %r", dir); + close(fd); + snprint(sock, sizeof sock, "%s/agent.%d", dir, pid); + } snprint(addr, sizeof addr, "unix!%s", sock); if((afd = announce(addr, adir)) < 0) |