make key prompt work
This commit is contained in:
parent
68f2c92c6f
commit
f0fb9c573e
3 changed files with 14 additions and 16 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include "std.h"
|
#include "std.h"
|
||||||
#include "dat.h"
|
#include "dat.h"
|
||||||
|
#include <9pclient.h>
|
||||||
|
|
||||||
int extrafactotumdir;
|
int extrafactotumdir;
|
||||||
int debug;
|
int debug;
|
||||||
|
|
@ -132,15 +133,16 @@ promptforkey(int fd, char *params)
|
||||||
static int
|
static int
|
||||||
sendkey(Attr *attr)
|
sendkey(Attr *attr)
|
||||||
{
|
{
|
||||||
int fd, rv;
|
int rv;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
CFid *fid;
|
||||||
|
|
||||||
fd = open("/mnt/factotum/ctl", ORDWR);
|
fid = nsopen("factotum", nil, "ctl", OWRITE);
|
||||||
if(fd < 0)
|
if(fid == nil)
|
||||||
sysfatal("opening /mnt/factotum/ctl: %r");
|
sysfatal("opening factotum/ctl: %r");
|
||||||
rv = fprint(fd, "key %A\n", attr);
|
snprint(buf, sizeof buf, "key %A\n", attr);
|
||||||
read(fd, buf, sizeof buf);
|
rv = fswrite(fid, buf, strlen(buf));
|
||||||
close(fd);
|
fsclose(fid);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -163,8 +165,8 @@ gflag(char *s)
|
||||||
int nf;
|
int nf;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if((fd = open("/dev/cons", ORDWR)) < 0)
|
if((fd = open("/dev/tty", ORDWR)) < 0)
|
||||||
sysfatal("open /dev/cons: %r");
|
sysfatal("open /dev/tty: %r");
|
||||||
|
|
||||||
nf = getfields(s, f, nelem(f), 0, "\n");
|
nf = getfields(s, f, nelem(f), 0, "\n");
|
||||||
if(nf == 1){ /* needkey or old badkey */
|
if(nf == 1){ /* needkey or old badkey */
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ p9anyclient(Conv *c)
|
||||||
if(dom && strcmp(q+1, dom) != 0)
|
if(dom && strcmp(q+1, dom) != 0)
|
||||||
continue;
|
continue;
|
||||||
*q++ = '\0';
|
*q++ = '\0';
|
||||||
if(k = keyfetch(c, "%A proto=%q dom=%q", attr, f[i], q))
|
if(k = keylookup("%A proto=%q dom=%q", attr, f[i], q))
|
||||||
goto found;
|
goto found;
|
||||||
*--q = '@';
|
*--q = '@';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ int
|
||||||
secdial(void)
|
secdial(void)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int fd;
|
|
||||||
|
|
||||||
p = secstore;
|
p = secstore;
|
||||||
if(p == nil) /* else use the authserver */
|
if(p == nil) /* else use the authserver */
|
||||||
|
|
@ -32,10 +31,7 @@ secdial(void)
|
||||||
if(p == nil)
|
if(p == nil)
|
||||||
p = "secstore";
|
p = "secstore";
|
||||||
|
|
||||||
fd = dial(netmkaddr(p, "net", "secstore"), 0, 0, 0);
|
return dial(netmkaddr(p, "net", "secstore"), 0, 0, 0);
|
||||||
if(fd < 0)
|
|
||||||
fprint(2, "secdial: %r\n");
|
|
||||||
return fd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue