Sujet : Re: System UICs
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.vmsDate : 08. Jun 2024, 03:39:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v40g94$2edfj$2@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Pan/0.158 (Avdiivka; )
On Sat, 8 Jun 2024 11:55:46 +1000, Jim Duff wrote:
On 8/6/24 10:26, Lawrence D'Oliveiro wrote:
>
The point being that privilege separation is done based on UIC, not
username.
And VMS does it by username.
Last I checked, the username is only significant for accounting purposes,
not for privilege checking. And there’s also the “account name”.
$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
Ah, that’s new to me. Finally found some docs for it in OpenVMS 7.0.
Just a tip: instead of writing out a call twice, once to pick up the
buffer length, then doing the buffer allocation and making the call to get
the actual data, why not write the call just once and let it execute
twice? E.g.
usrpro_d.addr = NULL;
for (;;)
{
r0_status = sys$create_user_profile
(
/*usrname =*/ &system_d,
/*itmlst =*/ NULL,
/*flags =*/ 0,
/*usrpro =*/ usrpro_d.addr,
/*usrprolen =*/ &usrpro_d.length,
/*contxt =*/ 0
);
errchk_sig(r0_status);
if (usrpro_d.addr != NULL)
break;
usrpro_d.addr = malloc(usrpro_d.length);
assert(usrpro_d.addr != NULL);
} /*for*/
Less code to write, less code to maintain, less chance for bugs to get in.
Overall just less work involved.