| 1 |
.TH "getseuserbyname" "3" "29 September 2005" "[email protected]" "SELinux API documentation" |
| 2 |
.SH "NAME" |
| 3 |
getseuserbyname \- get SELinux username and level for a given Linux username |
| 4 |
. |
| 5 |
.SH "SYNOPSIS" |
| 6 |
.B #include <selinux/selinux.h> |
| 7 |
.sp |
| 8 |
.BI "int getseuserbyname(const char *" linuxuser ", char **" selinuxuser ", char **" level "); |
| 9 |
. |
| 10 |
.SH "DESCRIPTION" |
| 11 |
.BR getseuserbyname () |
| 12 |
retrieves the SELinux username and security level associated with |
| 13 |
a given Linux username. The SELinux username and security level can |
| 14 |
then be passed to other libselinux functions such as |
| 15 |
.BR \%get_ordered_context_list_with_level (3) |
| 16 |
and |
| 17 |
.BR \%get_default_context_with_level (3). |
| 18 |
|
| 19 |
The returned SELinux username and level should be freed by the caller |
| 20 |
using free. |
| 21 |
. |
| 22 |
.SH "RETURN VALUE" |
| 23 |
On success, 0 is returned. |
| 24 |
On failure, \-1 is returned and |
| 25 |
.I errno |
| 26 |
is set appropriately. |
| 27 |
|
| 28 |
The errors documented for the |
| 29 |
.BR stat (2) |
| 30 |
system call are also applicable here. |
| 31 |
. |
| 32 |
.SH "SEE ALSO" |
| 33 |
.BR selinux "(8)" |