Subject: Re: core dump filename format
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 09/07/1999 15:54:35
>> I can't see any decent way to implement %u; I don't think the kernel
>> has user names available.

> Think again.

> Look at getlogin(2)/setlogin(2).

> Look in curproc->p_session->s_login

Hmm!  Of course, the obvious next question is "what if the process
doesn't belong to a session?" (or, if that's not possible, what if it
belongs to the same session as init and inetd and such?).

Nevertheless, at the very least, we now have two potential formats: one
for this string (p->p_session->s_login) and one for the process's UID
(p->p_ucred->cr_uid or perhaps p->p_cred->pc_ruid - or perhaps two
formats, one for each).

What happens for the login user string if no session login name has
been set would have to be specified.

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B