From: <ssm...@us...> - 2007-02-23 18:24:17
|
Revision: 2268 http://svn.sourceforge.net/selinux/?rev=2268&view=rev Author: ssmalley Date: 2007-02-23 10:24:15 -0800 (Fri, 23 Feb 2007) Log Message: ----------- Author: Stephen Smalley Email: sd...@ty... Subject: Remove init_context_translations() from libselinux Date: Fri, 23 Feb 2007 07:43:49 -0500 On Thu, 2007-02-22 at 10:53 -0600, Darrel Goeddel wrote: > Daniel J Walsh wrote: > > Stephen Smalley wrote: > >> I think we've talked about this before, but never followed through. > >> Is there any reason to retain the init_context_translations() function > >> in libselinux, which sends a SETRANS_INIT message to mcstransd, gets a > >> response, and discards it? Can we drop it and the call to it from the > >> library constructor/initializer? > >> > >> > > Ok with me. > > Removal looks OK to me. It used to be that a failure would cause > translations to be disabled, but it is now vestigial. On second look, we need to retain the function to set mls_enabled for later use, but we can drop the part that communicates with mcstransd. Patch below. Signed-off-by: Stephen Smalley <sd...@ty...> Modified Paths: -------------- trunk/libselinux/src/setrans_client.c trunk/libselinux/src/setrans_internal.h Modified: trunk/libselinux/src/setrans_client.c =================================================================== --- trunk/libselinux/src/setrans_client.c 2007-02-22 16:11:13 UTC (rev 2267) +++ trunk/libselinux/src/setrans_client.c 2007-02-23 18:24:15 UTC (rev 2268) @@ -213,29 +213,8 @@ hidden int init_context_translations(void) { - int ret, fd; - int32_t ret_val; - char *out = NULL; - mls_enabled = is_selinux_mls_enabled(); - if (!mls_enabled) - return 0; - - fd = setransd_open(); - if (fd < 0) - return fd; - - ret = send_request(fd, SETRANS_INIT, NULL, NULL); - if (ret) - goto out; - - ret = receive_response(fd, SETRANS_INIT, &out, &ret_val); - free(out); - if (!ret) - ret = ret_val; - out: - close(fd); - return ret; + return 0; } int selinux_trans_to_raw_context(security_context_t trans, Modified: trunk/libselinux/src/setrans_internal.h =================================================================== --- trunk/libselinux/src/setrans_internal.h 2007-02-22 16:11:13 UTC (rev 2267) +++ trunk/libselinux/src/setrans_internal.h 2007-02-23 18:24:15 UTC (rev 2268) @@ -2,7 +2,6 @@ #define SETRANS_UNIX_SOCKET "/var/run/setrans/.setrans-unix" -#define SETRANS_INIT 1 #define RAW_TO_TRANS_CONTEXT 2 #define TRANS_TO_RAW_CONTEXT 3 #define MAX_DATA_BUF 8192 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |