|
From: <ssm...@us...> - 2007-10-15 14:49:15
|
Revision: 2653
http://selinux.svn.sourceforge.net/selinux/?rev=2653&view=rev
Author: ssmalley
Date: 2007-10-15 07:49:13 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Author: Daniel J Walsh
Email: dw...@re...
Subject: Fix semodule option handling
Date: Thu, 11 Oct 2007 16:03:18 -0400
semodule -B lksjdlj
will blow up.
Acked-by: Joshua Brindle <me...@ma...>
Modified Paths:
--------------
trunk/libselinux/src/stringrep.c
trunk/policycoreutils/semodule/semodule.c
Modified: trunk/libselinux/src/stringrep.c
===================================================================
--- trunk/libselinux/src/stringrep.c 2007-10-11 20:35:12 UTC (rev 2652)
+++ trunk/libselinux/src/stringrep.c 2007-10-15 14:49:13 UTC (rev 2653)
@@ -370,8 +370,6 @@
static const char *security_class_to_string_compat(security_class_t tclass)
{
- tclass = unmap_class(tclass);
-
if (tclass > 0 && tclass < NCLASSES)
return class_to_string_data.str + class_to_string[tclass];
@@ -386,9 +384,6 @@
access_vector_t common_base = 0;
unsigned int i;
- av = unmap_perm(tclass, av);
- tclass = unmap_class(tclass);
-
if (!av)
return NULL;
@@ -466,10 +461,11 @@
{
struct discover_class_node *node;
+ tclass = unmap_class(tclass);
+
if (obj_class_compat)
return security_class_to_string_compat(tclass);
- tclass = unmap_class(tclass);
node = get_class_cache_entry_value(tclass);
if (node == NULL)
return security_class_to_string_compat(tclass);
@@ -483,11 +479,12 @@
struct discover_class_node *node;
size_t i;
+ av = unmap_perm(tclass, av);
+ tclass = unmap_class(tclass);
+
if (obj_class_compat)
return security_av_perm_to_string_compat(tclass,av);
- av = unmap_perm(tclass, av);
- tclass = unmap_class(tclass);
node = get_class_cache_entry_value(tclass);
if (av && node)
for (i = 0; i<MAXVECTORS; i++)
Modified: trunk/policycoreutils/semodule/semodule.c
===================================================================
--- trunk/policycoreutils/semodule/semodule.c 2007-10-11 20:35:12 UTC (rev 2652)
+++ trunk/policycoreutils/semodule/semodule.c 2007-10-15 14:49:13 UTC (rev 2653)
@@ -249,11 +249,12 @@
* arguments as args. Will allow 'semodule -i *.pp' to
* work as expected.
*/
- if (commands[num_commands - 1].mode == INSTALL_M) {
+
+ if (commands && commands[num_commands - 1].mode == INSTALL_M) {
mode = INSTALL_M;
- } else if (commands[num_commands - 1].mode == UPGRADE_M) {
+ } else if (commands && commands[num_commands - 1].mode == UPGRADE_M) {
mode = UPGRADE_M;
- } else if (commands[num_commands - 1].mode == REMOVE_M) {
+ } else if (commands && commands[num_commands - 1].mode == REMOVE_M) {
mode = REMOVE_M;
} else {
fprintf(stderr, "unknown additional arguments:\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|