Skip to contentSkip to conversation

Some missing man pages from libselinux

PATCH Daniel J Walsh 2 participants 2 messages Sep 24, 2008 – Sep 29, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We are still missing the following man pages. Perhaps some of these functions should be removed? selinux_users_path seems to return a bogus directory? Also do not have _raw functions defined in man pages.

matchpathcon_checkmatches
matchpathcon_filespec_add
matchpathcon_filespec_destroy
matchpathcon_filespec_eval
matchpathcon_index
matchpathcon_init_prefix
print_access_vector
security_canonicalize_context
security_disable
security_set_boolean_list
selinux_check_passwd_access
selinux_customizable_types_path
selinux_file_context_cmp
selinux_file_context_verify
selinux_get_callback
selinux_init_load_policy
selinux_lsetfilecon_default
selinux_mkload_policy
selinux_raw_to_trans_context
selinux_trans_to_raw_context
selinux_translations_path
selinux_users_path
set_selinuxmnt

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjaOUgACgkQrlYvE4MpobOiewCeJmyth4NPBeNu4rvnvc8fcsMd UxEAn0mDTAiDHVzyhvG2QNaBUKBzemE9
=dElU
-----END PGP SIGNATURE-----

man/man3/avc_get_initial_sid.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/avc_get_initial_sid.3 libselinux-2.0.71/man/man3/avc_get_initial_sid.3
@@ -0,0 +1 @@
+.so man3/avc_context_to_sid.3
man/man3/fgetfilecon.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/fgetfilecon.3 libselinux-2.0.71/man/man3/fgetfilecon.3
@@ -0,0 +1 @@
+.so man3/getfilecon.3
man/man3/get_default_type.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/get_default_type.3 libselinux-2.0.71/man/man3/get_default_type.3
@@ -0,0 +1 @@
+.so man3/get_ordered_context_list.3
man/man3/getkeycreatecon.3 +38 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/getkeycreatecon.3 libselinux-2.0.71/man/man3/getkeycreatecon.3
@@ -0,0 +1,38 @@
+.TH "getkeycreatecon" "3" "9 September 2008" "[email protected] from [email protected]" "SELinux API documentation"
+.SH "NAME"
+getkeycreatecon, setkeycreatecon \- get or set the SELinux security context used for creating a new kernel keyrings.
+
+.SH "SYNOPSIS"
+.B #include <selinux/selinux.h>
+.sp
+.BI "int getkeycreatecon(security_context_t *" con );
+
+.BI "int setkeycreatecon(security_context_t "context );
+
+.SH "DESCRIPTION"
+.B getkeycreatecon
+retrieves the context used for creating a new kernel keyring.
+This returned context should be freed with freecon if non-NULL.  
+getkeycreatecon sets *con to NULL if no keycreate context has been explicitly 
+set by the program (i.e. using the default policy behavior).
+
+.B setkeycreatecon
+sets the context used for creating a new kernel keyring.
+NULL can be passed to
+setkeycreatecon to reset to the default policy behavior.  
+The keycreate context is automatically reset after the next execve, so a
+program doesn't need to explicitly sanitize it upon startup.  
+
+setkeycreatecon can be applied prior to library
+functions that internally perform an file creation,
+in order to set an file context on the objects.
+
+
+Note: Signal handlers that perform an setkeycreate must take care to
+save, reset, and restore the keycreate context to avoid unexpected behavior.
+.SH "RETURN VALUE"
+On error -1 is returned.
+On success 0 is returned.
+
+.SH "SEE ALSO"
+.BR selinux "(8), " freecon "(3), " getcon "(3), " getexeccon "(3)"
man/man3/getsockcreatecon.3 +38 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/getsockcreatecon.3 libselinux-2.0.71/man/man3/getsockcreatecon.3
@@ -0,0 +1,38 @@
+.TH "getsockcreatecon" "3" "24 September 2008" "[email protected] from [email protected]" "SELinux API documentation"
+.SH "NAME"
+getsockcreatecon, setsockcreatecon \- get or set the SELinux security context used for creating a new labeled sockets.
+
+.SH "SYNOPSIS"
+.B #include <selinux/selinux.h>
+.sp
+.BI "int getsockcreatecon(security_context_t *" con );
+
+.BI "int setsockcreatecon(security_context_t "context );
+
+.SH "DESCRIPTION"
+.B getsockcreatecon
+retrieves the context used for creating a new labeled network socket.
+This returned context should be freed with freecon if non-NULL.  
+getsockcreatecon sets *con to NULL if no sockcreate context has been explicitly 
+set by the program (i.e. using the default policy behavior).
+
+.B setsockcreatecon
+sets the context used for creating a new labeled network sockets
+NULL can be passed to
+setsockcreatecon to reset to the default policy behavior.  
+The sockcreate context is automatically reset after the next execve, so a
+program doesn't need to explicitly sanitize it upon startup.  
+
+setsockcreatecon can be applied prior to library
+functions that internally perform an file creation,
+in order to set an file context on the objects.
+
+
+Note: Signal handlers that perform an setsockcreate must take care to
+save, reset, and restore the sockcreate context to avoid unexpected behavior.
+.SH "RETURN VALUE"
+On error -1 is returned.
+On success 0 is returned.
+
+.SH "SEE ALSO"
+.BR selinux "(8), " freecon "(3), " getcon "(3)
man/man3/is_selinux_enabled.3 +9 -1
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/is_selinux_enabled.3 libselinux-2.0.71/man/man3/is_selinux_enabled.3
@@ -1,14 +1,22 @@
 .TH "is_selinux_enabled" "3" "1 January 2004" "[email protected]" "SELinux API documentation"
 .SH "NAME"
 is_selinux_enabled \- check whether SELinux is enabled
+
+.SH "NAME"
+is_selinux_mls_enabled \- check whether SELinux is enabled for (Multi Level Securty) MLS 
 .SH "SYNOPSIS"
 .B #include <selinux/selinux.h>
 .sp
 .B int is_selinux_enabled();
 
+.B int is_selinux_mls_enabled();
+
 .SH "DESCRIPTION"
 .B is_selinux_enabled
-returns 1 if SELinux is running or 0 if it is not.  May change soon.
+returns 1 if SELinux is running or 0 if it is not. 
+
+.B is_selinux_mls_enabled
+returns 1 if SELinux is running in MLS mode or 0 if it is not. 
 
 .SH "SEE ALSO"
 .BR selinux "(8)"
man/man3/is_selinux_mls_enabled.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/is_selinux_mls_enabled.3 libselinux-2.0.71/man/man3/is_selinux_mls_enabled.3
@@ -0,0 +1 @@
+.so man3/is_selinux_enabled.3
man/man3/lgetfilecon.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/lgetfilecon.3 libselinux-2.0.71/man/man3/lgetfilecon.3
@@ -0,0 +1 @@
+.so man3/getfilecon.3
man/man3/matchpathcon_fini.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/matchpathcon_fini.3 libselinux-2.0.71/man/man3/matchpathcon_fini.3
@@ -0,0 +1 @@
+.so man3/matchpathcon.3
man/man3/matchpathcon_init.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/matchpathcon_init.3 libselinux-2.0.71/man/man3/matchpathcon_init.3
@@ -0,0 +1 @@
+.so man3/matchpathcon.3
man/man3/selinux_binary_policy_path.3 +22 -3
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_binary_policy_path.3 libselinux-2.0.71/man/man3/selinux_binary_policy_path.3
@@ -1,6 +1,6 @@
 .TH "selinux_binary_policy_path" "3" "15 November 2004" "[email protected]" "SELinux API Documentation"
 .SH "NAME"
-selinux_policy_root, selinux_binary_policy_path,
+selinux_path, selinux_policy_root, selinux_binary_policy_path,
 selinux_failsafe_context_path, selinux_removable_context_path,
 selinux_default_context_path, selinux_user_contexts_path,
 selinux_file_context_path, selinux_media_context_path,
@@ -11,6 +11,8 @@
 .B #include <selinux/selinux.h>
 .sp
 
+extern const char *selinux_path(void);
+
 extern const char *selinux_policy_root(void);
 
 extern const char *selinux_binary_policy_path(void);
@@ -23,6 +25,10 @@
 
 extern const char *selinux_user_contexts_path(void);
 
+extern const char *selinux_usersconf_path(void);
+
+extern const char *selinux_x_context_path(void);
+
 extern const char *selinux_file_context_path(void);
 
 extern const char *selinux_media_context_path(void);
@@ -40,10 +46,14 @@
 directories and files based on the settings in /etc/selinux/config.
 
 .sp
+selinux_path() - top-level SELinux configuration directory
+.sp
 selinux_policy_root() - top-level policy directory 
 .sp
 selinux_binary_policy_path() - binary policy file loaded into kernel
 .sp
+selinux_default_type_path - context file mapping roles to default types.
+.sp
 selinux_failsafe_context_path() - failsafe context for emergency logins
 .sp
 selinux_removable_context_path() - filesystem context for removable media
@@ -52,7 +62,17 @@
 .sp
 selinux_user_contexts_path() - directory containing per-user default contexts
 .sp
-selinux_file_context_path() - file contexts configuration
+selinux_usersconf_path() - file containing mapping between Linux Users and SELinux users
+.sp
+selinux_x_context_path() - file containing configuration for XSELinux extension
+.sp
+selinux_netfilter_context_path - default netfilter context 
+.sp
+selinux_file_context_path() - default sysstem file contexts configuration
+.sp
+selinux_file_context_local_path() - local customization file contexts configuration
+.sp
+selinux_file_context_homedir_path() - home directory file contexts configuration
 .sp
 selinux_media_context_path() - file contexts for media device nodes
 .sp
@@ -67,4 +87,3 @@
 
 .SH "SEE ALSO"
 .BR selinux "(8)"
-
man/man3/selinux_default_type_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_default_type_path.3 libselinux-2.0.71/man/man3/selinux_default_type_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_file_context_homedir_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_file_context_homedir_path.3 libselinux-2.0.71/man/man3/selinux_file_context_homedir_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_file_context_local_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_file_context_local_path.3 libselinux-2.0.71/man/man3/selinux_file_context_local_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_getpolicytype.3 +21 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_getpolicytype.3 libselinux-2.0.71/man/man3/selinux_getpolicytype.3
@@ -0,0 +1,21 @@
+.TH "selinux_getpolicytype" "3" "24 Sep 2008" "[email protected]" "SELinux API documentation"
+.SH "NAME"
+selinux_getpolicytype \- get the type of SELinux policy running on the system
+.SH "SYNOPSIS"
+.B #include <selinux/selinux.h>
+.sp
+.B int selinux_getpolicytype();
+
+
+.SH "DESCRIPTION"
+.B selinux_getpolicytype
+Reads the contents of the /etc/selinux/config file to determine the SELinux policy used on the system.
+
+.SH "RETURN VALUE"
+On success, zero is returned.
+On failure, -1 is returned.
+
+.SH "SEE ALSO"
+.BR selinux "(8)"
+
+
man/man3/selinux_homedir_context_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_homedir_context_path.3 libselinux-2.0.71/man/man3/selinux_homedir_context_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_netfilter_context_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_netfilter_context_path.3 libselinux-2.0.71/man/man3/selinux_netfilter_context_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_path.3 libselinux-2.0.71/man/man3/selinux_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_usersconf_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_usersconf_path.3 libselinux-2.0.71/man/man3/selinux_usersconf_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/selinux_x_context_path.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/selinux_x_context_path.3 libselinux-2.0.71/man/man3/selinux_x_context_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
man/man3/set_matchpathcon_flags.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/set_matchpathcon_flags.3 libselinux-2.0.71/man/man3/set_matchpathcon_flags.3
@@ -0,0 +1 @@
+.so man3/matchpathcon.3
man/man3/setkeycreatecon.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/setkeycreatecon.3 libselinux-2.0.71/man/man3/setkeycreatecon.3
@@ -0,0 +1 @@
+.so man3/getkeycreatecon.3
man/man3/setsockcreatecon.3 +1 -0
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man3/setsockcreatecon.3 libselinux-2.0.71/man/man3/setsockcreatecon.3
@@ -0,0 +1 @@
+.so man3/getsockcreatecon.3
#1 lore raw
Quoted 7 lines · Daniel J Walsh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We are still missing the following man pages. Perhaps some of these functions should be removed? selinux_users_path seems to return a bogus directory? Also do not have _raw functions defined in man pages.

This and the other 2 patches were merged in libselinux 2.0.73. I added a Todo page to the wiki (http://userspace.selinuxproject.org/trac/wiki/Todo) and added the man pages below.

Quoted 25 lines

matchpathcon_checkmatches
matchpathcon_filespec_add
matchpathcon_filespec_destroy
matchpathcon_filespec_eval
matchpathcon_index
matchpathcon_init_prefix
print_access_vector
security_canonicalize_context
security_disable
security_set_boolean_list
selinux_check_passwd_access
selinux_customizable_types_path
selinux_file_context_cmp
selinux_file_context_verify
selinux_get_callback
selinux_init_load_policy
selinux_lsetfilecon_default
selinux_mkload_policy
selinux_raw_to_trans_context
selinux_trans_to_raw_context
selinux_translations_path
selinux_users_path
set_selinuxmnt

Quoted 9 lines

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjaOUgACgkQrlYvE4MpobOiewCeJmyth4NPBeNu4rvnvc8fcsMd UxEAn0mDTAiDHVzyhvG2QNaBUKBzemE9
=dElU
-----END PGP SIGNATURE-----

--
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.