diff options
| author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-29 02:53:59 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-29 02:53:59 +0200 |
| commit | 0f59758d126d800fdf57fd913947f4d4ca9cc253 (patch) | |
| tree | 59bf67bcbf7551ea1f7e2e7e806a5d1a7f531ec0 | |
| parent | b4d2e39d8cfad9fe9585dd6b2382d1261122f22f (diff) | |
| download | plan9front-0f59758d126d800fdf57fd913947f4d4ca9cc253.tar.xz | |
factotum: authdial timeout
| -rw-r--r-- | sys/src/cmd/auth/factotum/fs.c | 2 | ||||
| -rw-r--r-- | sys/src/cmd/auth/factotum/util.c | 47 |
2 files changed, 26 insertions, 23 deletions
diff --git a/sys/src/cmd/auth/factotum/fs.c b/sys/src/cmd/auth/factotum/fs.c index 78176f781..d7b992507 100644 --- a/sys/src/cmd/auth/factotum/fs.c +++ b/sys/src/cmd/auth/factotum/fs.c @@ -220,7 +220,7 @@ private(void) static void notifyf(void*, char *s) { - if(strncmp(s, "interrupt", 9) == 0) + if(strncmp(s, "interrupt", 9) == 0 || strncmp(s, "alarm", 5) == 0) noted(NCONT); noted(NDFLT); } diff --git a/sys/src/cmd/auth/factotum/util.c b/sys/src/cmd/auth/factotum/util.c index d61951dae..e824cb6b4 100644 --- a/sys/src/cmd/auth/factotum/util.c +++ b/sys/src/cmd/auth/factotum/util.c @@ -27,30 +27,33 @@ _authdial(char *net, char *authdom) { int fd, vanilla; + alarm(30*1000); vanilla = net==nil || strcmp(net, "/net")==0; - if(!vanilla || bindnetcs()>=0) - return authdial(net, authdom); - - /* - * If we failed to mount /srv/cs, assume that - * we're still bootstrapping the system and dial - * the one auth server passed to us on the command line. - * In normal operation, it is important *not* to do this, - * because the bootstrap auth server is only good for - * a single auth domain. - * - * The ticket request code should really check the - * remote authentication domain too. - */ - - /* use the auth server passed to us as an arg */ - if(authaddr == nil) - return -1; - fd = dial(netmkaddr(authaddr, "tcp", "567"), 0, 0, 0); - if(fd >= 0) - return fd; - return dial(netmkaddr(authaddr, "il", "566"), 0, 0, 0); + fd = authdial(net, authdom); + else { + /* + * If we failed to mount /srv/cs, assume that + * we're still bootstrapping the system and dial + * the one auth server passed to us on the command line. + * In normal operation, it is important *not* to do this, + * because the bootstrap auth server is only good for + * a single auth domain. + * + * The ticket request code should really check the + * remote authentication domain too. + */ + + /* use the auth server passed to us as an arg */ + fd = -1; + if(authaddr != nil){ + fd = dial(netmkaddr(authaddr, "tcp", "567"), 0, 0, 0); + if(fd < 0) + fd = dial(netmkaddr(authaddr, "il", "566"), 0, 0, 0); + } + } + alarm(0); + return fd; } int |
