115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
|
elseif tmppw[i] >= 10 then
tmppw[i] = tmppw[i] + (0x41 - 10)
else tmppw[i] = tmppw[i] + 0x30 end
end
lib.dbg('assigning temporary password')
dlg:auth_attach_pw(uid, reset,
pstr { ptr = [rawstring](tmppw), ct = 32 },
lib.str.plit 'temporary password');
end
local terra ipc_report(acks: lib.mem.ptr(lib.ipc.ack), rep: rawstring)
var decbuf: int8[21]
for i=0,acks.ct do
var num = lib.math.decstr(acks(i).clid, &decbuf[20])
if acks(i).success then
................................................................................
if cfmode.help then
[ lib.emit(false, 1, 'usage: ', `argv[0], ' mkroot ', cfmode.type.helptxt.flags, ' <handle>', cfmode.type.helptxt.opts) ]
return 1
end
if cfmode.arglist.ct == 1 then
var am = dlg:conf_get('credential-store')
var mg: bool
if (not am) or am:cmp(lib.str.plit 'managed') then
mg = true
elseif am:cmp(lib.str.plit 'unmanaged') then
lib.warn('credential store is unmanaged; you will need to create credentials for the new root user manually!')
mg = false
else lib.bail('unknown credential store mode "',{am.ptr,am.ct},'"; should be either "managed" or "unmanaged"') end
var kbuf: uint8[lib.crypt.const.maxdersz]
var root = lib.store.actor.mk(&kbuf[0])
root.handle = cfmode.arglist(0)
var epithets = array(
|
|
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
|
elseif tmppw[i] >= 10 then
tmppw[i] = tmppw[i] + (0x41 - 10)
else tmppw[i] = tmppw[i] + 0x30 end
end
lib.dbg('assigning temporary password')
dlg:auth_attach_pw(uid, reset,
pstr { ptr = [rawstring](tmppw), ct = 32 },
'temporary password');
end
local terra ipc_report(acks: lib.mem.ptr(lib.ipc.ack), rep: rawstring)
var decbuf: int8[21]
for i=0,acks.ct do
var num = lib.math.decstr(acks(i).clid, &decbuf[20])
if acks(i).success then
................................................................................
if cfmode.help then
[ lib.emit(false, 1, 'usage: ', `argv[0], ' mkroot ', cfmode.type.helptxt.flags, ' <handle>', cfmode.type.helptxt.opts) ]
return 1
end
if cfmode.arglist.ct == 1 then
var am = dlg:conf_get('credential-store')
var mg: bool
if (not am) or am:cmp('managed') then
mg = true
elseif am:cmp('unmanaged') then
lib.warn('credential store is unmanaged; you will need to create credentials for the new root user manually!')
mg = false
else lib.bail('unknown credential store mode "',{am.ptr,am.ct},'"; should be either "managed" or "unmanaged"') end
var kbuf: uint8[lib.crypt.const.maxdersz]
var root = lib.store.actor.mk(&kbuf[0])
root.handle = cfmode.arglist(0)
var epithets = array(
|