Skip to contentSkip to conversation

Need functions to manipulare users file.

DISCUSSION Daniel J Walsh 2 participants 2 messages Mar 17, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

Stephen we want to build a patch to either libselinux or libsepol or a third library to manipulate the local.users file.

Basically useradd, usermod, userdel and freinds need to call

selinux_adduser(dwalsh, staff_r, sysadm_r, ...)
selinux_deluser(dwalsh)
selinux_moduser(dwalsh, user_r, ...)

Do you think this belongs to libgenpol or libselinux or some third libary, like tresys has this.

Basically libgenpol understands the file format and libselinux understands the way selinux is installed.

Dan

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 2 lines · Daniel J Walsh

Stephen we want to build a patch to either libselinux or libsepol or a third library to manipulate the local.users file.

libsepol already has to understand the users source file format for reading it by sepol_genusers(3), and doesn't depend on running on a SELinux system. So I think it is likely the right place. Since libsepol doesn't assume that it is running on a SELinux system and doesn't want to assume the presence of /etc/selinux/config, the caller has to provide the path to the users directory, so for example, load_policy passes the result of selinux_users_path(3), which is provided by libselinux, to sepol_genusers(3).

Ultimately, the policy source parsing code might be moved into libsepol so that it not only provides manipulation of binary policies and user source files but also manipulation of any source.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.