From 17566b4dd30979777ce7f25429084818c0f924f4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 9 Dec 2014 22:26:30 +0100 Subject: 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. --- sys/src/9/boot/bootrc | 10 +++++----- 1 file 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) -- cgit v1.2.3