Skip to main content

Module owner_only

Module owner_only 

Source
Expand description

Files and folders only their own user may open: the place AgentMux Headless keeps its data and the key file that signs a browser in. On Linux and macOS that is a file mode (0700, 0600). Windows has access lists instead, and a profile folder can have been changed so that others are in them; this module reads a folder’s list, says who besides the user, the system and the administrators is given access, and sets a list that gives it to the user and the system only.

The reading of the list is plain text (its SDDL form), so it is the same code, and the same tests, on every platform.

Structs§

Other
Someone a list lets in besides the user: what a person reads for them, and their SID, which is what removes them.

Constants§

KEY_READERS_ENV
The accounts, besides the server’s own, that may read its key file: the Windows service’s installing person (agentmux service install names them, service run passes them on in this variable), who opens the browser with agentmux open from their own terminal.

Functions§

is_account_sid
Is this the SID of one person’s own account, as text: S-1-5-21-<a>-<b>-<c>-<rid> (a local or a domain account) or S-1-12-1-<a>-<b>-<c>-<d> (an account of an organisation’s directory), every part digits only? A group, a well-known SID (Everyone, Authenticated Users, Users, Anonymous, the system, the administrators) and a built-in account that nobody signs in with (Guest and the like, relative ids 501 to 999) are not.
is_key_reader
Is trustee, as an access list names it (a SID, or an SDDL alias such as LA), one of the key readers (SIDs)? SDDL writes the built-in administrator account (the SID ending in -500) as LA, so that alias is the reader whose SID ends that way.
key_readers
KEY_READERS_ENV, as SIDs.
others_with_access
Who besides user_sid (and the system, the administrators and the owner) the list in sddl allows to do anything to the object, each named once, in the order the list gives them. A denial is not an allowance, and an entry that gives no rights gives none. An empty answer is a list only the user (and those) can use.
private_sddl
The access list as SDDL text, which the user is user_sid: only the user and the system, nothing inherited. folder adds the rights to everything made inside it.
private_sddl_with_readers
private_sddl for a file that also names readers (SIDs) with read rights: the one file a service writes and a person who is not its account must read (the key agentmux open proves itself to the server with).
program_folder_sddl
The list of a program folder the person’s own login task runs from: the user, the system and the administrators, with nothing inherited from above (a profile can carry an entry for an account that no longer exists).
refusal
The words to a person whose folder lets others in: which folder, who, and the one command that fixes it: it stops what is inherited from above, takes away each of those named, and gives the folder to the person and the system.
refusal_because
refusal for a place kept for another reason, which is said in why (a sentence without its closing full stop).
say_who
What a person reads for the principals a list can name by alias, and the SID of each; any other is its own SID.
unnamed_account
What a person reads for an account Windows has no name for (one that was deleted, say), with the id that removes it.