Sujet : Re: System UICs
De : craigberry (at) *nospam* nospam.mac.com (Craig A. Berry)
Groupes : comp.os.vmsDate : 08. Jun 2024, 17:29:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v420t2$2m8ap$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla Thunderbird
On 6/7/24 8:55 PM, Jim Duff wrote:
On 8/6/24 10:26, Lawrence D'Oliveiro wrote:
On Fri, 7 Jun 2024 20:11:13 -0400, Arne Vajhøj wrote:
>
VMS allows multiple usernames with same UIC, but it practically
never happens.
>
The point being that privilege separation is done based on UIC, not
username.
And VMS does it by username. Some UICs on VMS are defined to be in the system group. Some UIDs on unix are defined to be in the system group. So what?
For example, on *nix, a daemon might start out as root and then
call setuid(2) and friends to isolate the current process as a
nonprivileged user. The UID to use can be easily obtained by looking up a
symbolic username in the /etc/passwd file. How would you do this on VMS?
How do you change username (and granted identifiers and/or UIC) on VMS?
$assume_persona system service and co. You'll find they're a little more flexible than setuid. Example here:
https://www.eight-cubed.com/examples/framework.php?file=sys_persona.c
Or did you mean "how would you look up a UIC by username? From DCL, f$identifier lexical:
$ uic = f$identifier ("SYSTEM", "NAME_TO_NUMBER")
$ write sys$output f$fao ("!%U", uic)
[1,4]
$
From an executable, $getuai system service.
On VMS, to start something with privileges and permanently drop them after initialization and *guarantee* that the process can never get them back (unlike both setuid and the persona system services, which can both resume their "natural" id):
Set up a user with authorized privs of (for example) NETMBX, TMPMBX, and default privs of SYSPRV, NETMBX, TMPMBX.
When the process starts, it will have SYSPRV, but after dropping the privilege (set proc/priv=nosysprv in DCL, $setprv system service in a program), you cannot re-enable it. Use a captive (or restricted) command procedure (or run a program without a command interpreter) to ensure the process cannot retain or regain privs.
Depending on what the real question was, you might also end up calling
sys$create_user_profile to get the rights and privileges of the current
process.