ref: 17566b4dd30979777ce7f25429084818c0f924f4
parent: f9d379974ad71fa02881ace25615bcefd8db075d
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Dec 9 17:26:30 EST 2014
bootrc: do not pass authserver with -a flag to factotum, handle multiple secstore addresses factotum is started in bootrc before the network is setup (as we need it to negotiate wpa key for wifi). once, the network is setup, the bootstrap authservers are passed in /net/ndb, which factotum reads when doing bootstrap authdial. it does this only when no authserver was specified earlier! but we want net.rc to select the proper bootstrap authserver... the $secstore variable takes precedence over $auth. as there is no connection server yet, we have to select the set of servers here and pass them to secstore with -s flag. note that this will work if multiple addresses where specified.
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -88,8 +88,6 @@
}
if not
x=($x -u)
- if(! ~ $#auth 0)
- x=($x -a $auth)
if(! ~ $#debugfactotum 0)
x=($x -p)
must $x
@@ -98,9 +96,11 @@
# config method
$mp(1) $ma
- # load keys from secstore
- if(~ $#auth 1 && test -x /bin/auth/secstore && test -f /mnt/factotum/ctl){
- x=(auth/secstore -G factotum -s $auth)
+ # load keys from secstore if $auth or $secstore is not empty
+ x=secstore
+ if(~ $#$x 0) x=auth
+ if(! ~ $#$x 0 && test -x /bin/auth/secstore && test -f /mnt/factotum/ctl){
+ x=(auth/secstore -G factotum -s^$$x)
if(~ $service cpu)
$x -n >/mnt/factotum/ctl
if(~ $status *readnvram* || ! ~ $service cpu)