Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2005 12:31:34 -0400
From:      Aziz Kezzou <french.linuxian@gmail.com>
To:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   How to check root powers on a struct proc ?
Message-ID:  <3727392705061709318b9346f@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi all,
I am trying to check that a process (struct proc) has root powers when
it calls my KLD system call.
I know from kern_jail.c that I can use suser() but this function takes
a struct thread* instead of struct proc* although the credentials
(struct ucred *p_ucred;) are stored in proc !

Is there an esay way to get a struct thread* from a struct proc* ? or
should I simply use the function:  int suser_cred(struct ucred *cred,
int flag); with cred =3D p-> p_ucred

BTW what would the value of flag  be?

Thanks,
-aziz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3727392705061709318b9346f>