Chris PeBenito 473ea7
.TH "getseuserbyname" "3" "29 September 2005" "dwalsh@redhat.com" "SE Linux API documentation"
Chris PeBenito 473ea7
.SH "NAME"
Chris PeBenito 473ea7
getseuserbyname \- get SELinux username and level for a given Linux username
Chris PeBenito 473ea7
.SH "SYNOPSIS"
Chris PeBenito 473ea7
.B #include <selinux/selinux.h>
Chris PeBenito 473ea7
.sp
Chris PeBenito 473ea7
.BI "int getseuserbyname(const char *" linuxuser ", char **" selinuxuser ", char **" level ");
Chris PeBenito 473ea7
.SH "DESCRIPTION"
Chris PeBenito 473ea7
.B getseuserbyname
Chris PeBenito 473ea7
retrieves the SELinux username and security level associated with 
Chris PeBenito 473ea7
a given Linux username.  The SELinux username and security level can
Chris PeBenito 473ea7
then be passed to other libselinux functions such as 
Chris PeBenito 473ea7
get_ordered_context_list_with_level and get_default_context_with_level.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.br
Chris PeBenito 473ea7
Chris PeBenito 473ea7
The returned SELinux username and level should be freed by the caller
Chris PeBenito 473ea7
using free.  
Chris PeBenito 473ea7
.SH "RETURN VALUE"
Chris PeBenito 473ea7
On success, 0 is returned.
Chris PeBenito 473ea7
On failure, \-1 is returned and errno is set appropriately.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
The errors documented for the stat(2) system call are also applicable
Chris PeBenito 473ea7
here.
Chris PeBenito 473ea7