From fbc1184c08d18d5ac0f8763a058e015e95353341 Mon Sep 17 00:00:00 2001 From: Charles Forsyth Date: Wed, 29 Apr 2015 17:44:33 +0100 Subject: switch to Dial module --- appl/lib/login.b | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'appl/lib/login.b') diff --git a/appl/lib/login.b b/appl/lib/login.b index 2feb3f6a..6a7dee1a 100644 --- a/appl/lib/login.b +++ b/appl/lib/login.b @@ -17,6 +17,8 @@ include "keyring.m"; include "security.m"; +include "dial.m"; + include "string.m"; # see login(6) @@ -35,16 +37,16 @@ login(id, password, dest: string): (string, ref Keyring->Authinfo) if(rand == nil) return nomod(Random->PATH); + dial := load Dial Dial->PATH; + if(dial == nil) + return nomod(Dial->PATH); + if(dest == nil) dest = "$SIGNER"; - for(j:=0; j= len dest) - dest = "net!"+dest+"!inflogin"; # BUG: must do better - - (ok, lc) := sys->dial(dest, nil); - if(ok < 0) - return (sys->sprint("can't contact login service: %r"), nil); + dest = dial->netmkaddr(dest, "net", "inflogin"); + lc := dial->dial(dest, nil); + if(lc == nil) + return (sys->sprint("can't contact login service: %s: %r", dest), nil); # push ssl, leave in clear mode for now (err, c) := ssl->connect(lc.dfd); -- cgit v1.2.3