summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-12-09 22:26:30 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-12-09 22:26:30 +0100
commit17566b4dd30979777ce7f25429084818c0f924f4 (patch)
tree76c1558754e352bbabf2e3073bd6f8ed3b4bc54d /sys
parentf9d379974ad71fa02881ace25615bcefd8db075d (diff)
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.
Diffstat (limited to 'sys')
-rwxr-xr-xsys/src/9/boot/bootrc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc
index e4d45635b..8e525fb11 100755
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -88,8 +88,6 @@ fn main{
}
if not
x=($x -u)
- if(! ~ $#auth 0)
- x=($x -a $auth)
if(! ~ $#debugfactotum 0)
x=($x -p)
must $x
@@ -98,9 +96,11 @@ fn main{
# 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)