This page continues The Master Files: Global Changes.
Running one command inside an account: run.in#
A program is compiled, cataloged and debugged in its own account: its VOC, its private catalog,
the files its I-types translate through. An account that is locked out of its own programs
(bp-off) cannot do any of that, so the administrator does it for the account.
run.in acme basic bp prog
run.in acme basic bp prog debugging no.query
run.in acme catalog bp prog local no.query
run.in acme decatalog prog
run.in acme delete.catalog prog local
run.in acme debug bp prog
run.in acme compile.dict cust total
The verb is in the SDSYS VOC only and refuses anyone else ("Command requires administrator
privileges"). It runs one command from the list above, in a registered account (never
SDSYS itself, never a path), and it is back in SDSYS when the command ends. That includes a
command that aborts, a break and a run-time error in a program being debugged: the session is put
back before anything else happens and says so ("run.in: the command did not finish; the session is
back in account acme"). Without this an administrator would be left in the account, with the
command's reach, until typing logto sdsys (the administrator's way back by hand; it is refused to
every other session).
What it checks before it changes anything: the account and every name are one plain word (a-z,
0-9, dot, dash and underscore, a letter or digit first, at most 64 characters, and not a word SD
reads as an option); each option is on that command's own list and is given once; the first name of
basic, catalog, debug and compile.dict is a file in that account's VOC. The command
SD runs is built from those words and is never the text you typed. basic is always given
no.catalog, so a $catalog directive in the account's source (or in a file it includes, or in
its $BASIC.OPTIONS) is not acted on: without it, compiling the source as the administrator would
catalog it as the administrator, in the global catalog if the directive says global. To
catalog a program of an account, say so: run.in acme catalog bp prog. run.in does not start the
account's login paragraph (it would run with the administrator's rights), and it does not nest.
The command does not run as the administrator. The account's files, VOC and programs are written by the account's user, so nothing in them is trusted:
- The words must be SD's own. The command word and every option word must be, in that account's
VOC, exactly the entry SD ships. An account that has changed or removed one (its own
basic, say) is refused before anything happens: run.in: basic is not SD's own entry in the VOC of account acme (it is missing or was changed there); nothing was run. Put SD's own entry back in that account's VOC (the record of the same name innewvoc;update.accountsputs the shipped entry back, whether it is missing or was changed: it asks first only when the type differs, and it keeps an entry marked[LOCKED]unless it is a verb) and try again. - For the command itself the session is not the administrator. Only the one gate the command
needs is on (
bp-editforbasic,catalog,decataloganddelete.catalog,dict-editforcompile.dict, none fordebug), andshandos.executeare off whatever the account's own switches say. A program being debugged therefore has the account's reach, not yours: it cannot open another account's files, run a shell command,logtoanother account (logto is refused while run.in is running a command in account acme) or follow a Q-pointer out of the account. Everything is put back when the command ends, as above. - Compiling reads the account and nothing else. A
$executein the source is a compile error ($execute is refused in a compile started by run.in), and an include or a dictionary that lies outside the account is refused; SD's ownsyscomheaders are still found. - Nothing is written outside the account, and no trigger of the account's runs. The command
itself runs as the
sdsysuser, which may write anywhere under the accounts root, sorun.inlooks first at every file the command would write or delete: the named file, its dictionary, its.outfile, the private catalog a$private.cataloguerecord names, the object file adecatalogwould remove. If one of them lies outside the account's own directory (links and..followed) the command is refused: run.in: bp.out in account acme names a path outside the account; nothing was run. A trigger is code the account's user wrote, and it would run on the command's reads and writes, so a trigger on the account's VOC or on any of those files is refused the same way: run.in: voc in account acme has a trigger; nothing was run. Edit such a file in the account it lives in, or take the trigger off first.
It adds no authority: the administrator can already logto into any registered account. What it
adds is the way back and a shorter list. Every use writes run.in begin account=… command=… and
run.in end account=… (or run.in revert account=… reason=abort) to the audit trail, and a
refusal writes run.in refused … with the reason.
Continued in#
The Master Files: The Group and the Modes — the sdsys group and the modes of what SD makes.