diff options
| author | charles forsyth <charles.forsyth@gmail.com> | 2015-06-13 16:34:09 +0100 |
|---|---|---|
| committer | charles forsyth <charles.forsyth@gmail.com> | 2015-06-13 16:34:09 +0100 |
| commit | 62d7827bc358c000db9ff48fe61bd28ac352a884 (patch) | |
| tree | 3369436e1f4ccfabd4bd5a58632d26934b868688 /appl/cmd/auth | |
| parent | 15cdcc9295cbd45a03f77559b9de402033858a41 (diff) | |
mkfiles/mkfile-Linux-386
Diffstat (limited to 'appl/cmd/auth')
| -rw-r--r-- | appl/cmd/auth/logind.b | 4 | ||||
| -rw-r--r-- | appl/cmd/auth/passwd.b | 25 |
2 files changed, 11 insertions, 18 deletions
diff --git a/appl/cmd/auth/logind.b b/appl/cmd/auth/logind.b index f9d14616..1bf17b15 100644 --- a/appl/cmd/auth/logind.b +++ b/appl/cmd/auth/logind.b @@ -13,6 +13,8 @@ include "keyring.m"; kr: Keyring; IPint: import kr; +include "dial.m"; + include "security.m"; ssl: SSL; @@ -62,7 +64,7 @@ init(nil: ref Draw->Context, nil: list of string) kill(tpid, "kill"); } -dologin(c: ref Sys->Connection): string +dologin(c: ref Dial->Connection): string { ivec: array of byte; diff --git a/appl/cmd/auth/passwd.b b/appl/cmd/auth/passwd.b index b001cb16..2c5306b6 100644 --- a/appl/cmd/auth/passwd.b +++ b/appl/cmd/auth/passwd.b @@ -8,6 +8,9 @@ include "draw.m"; include "keyring.m"; kr: Keyring; +include "dial.m"; + dial: Dial; + include "security.m"; auth: Auth; @@ -39,6 +42,9 @@ init(nil: ref Draw->Context, args: list of string) kr = load Keyring Keyring->PATH; if(kr == nil) noload(Keyring->PATH); + dial = load Dial Dial->PATH; + if(dial == nil) + noload(Dial->PATH); auth = load Auth Auth->PATH; if(auth == nil) noload(Auth->PATH); @@ -156,8 +162,8 @@ err(s: string) mountsrv(ai: ref Keyring->Authinfo): string { - (rc, c) := sys->dial(netmkaddr(signer, "net", "infkey"), nil); - if(rc < 0) + c := dial->dial(dial->netmkaddr(signer, "net", "infkey"), nil); + if(c == nil) err(sys->sprint("can't dial %s: %r", signer)); (fd, id_or_err) := auth->client("sha1/rc4_256", ai, c.dfd); if(fd == nil) @@ -220,21 +226,6 @@ putsecret(oldhash: array of byte, secret: array of byte): string return nil; } -netmkaddr(addr, net, svc: string): string -{ - if(net == nil) - net = "net"; - (n, nil) := sys->tokenize(addr, "!"); - if(n <= 1){ - if(svc== nil) - return sys->sprint("%s!%s", net, addr); - return sys->sprint("%s!%s!%s", net, addr, svc); - } - if(svc == nil || n > 2) - return addr; - return sys->sprint("%s!%s", addr, svc); -} - readline(io: ref Sys->FD, mode: string): (int, string) { r : int; |
