Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Remove getsebool/setsebool from init and toolbox.
Browse files Browse the repository at this point in the history
These were leftovers from the SELinux boolean support that
was originally merged.  Since Android prohibits SELinux policy
booleans, we can just drop it.

Change-Id: I02f646a7d8db65e153702205b082b87a73f60d73
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
  • Loading branch information
stephensmalley committed Mar 13, 2015
1 parent bd518bc commit d4b2d89
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 187 deletions.
28 changes: 0 additions & 28 deletions init/builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,34 +854,6 @@ int do_restorecon_recursive(int nargs, char **args) {
return ret;
}

int do_setsebool(int nargs, char **args) {
const char *name = args[1];
const char *value = args[2];
SELboolean b;
int ret;

if (is_selinux_enabled() <= 0)
return 0;

b.name = name;
if (!strcmp(value, "1") || !strcasecmp(value, "true") || !strcasecmp(value, "on"))
b.value = 1;
else if (!strcmp(value, "0") || !strcasecmp(value, "false") || !strcasecmp(value, "off"))
b.value = 0;
else {
ERROR("setsebool: invalid value %s\n", value);
return -EINVAL;
}

if (security_set_boolean_list(1, &b, 0) < 0) {
ret = -errno;
ERROR("setsebool: could not set %s to %s\n", name, value);
return ret;
}

return 0;
}

int do_loglevel(int nargs, char **args) {
int log_level;
char log_level_str[PROP_VALUE_MAX] = "";
Expand Down
1 change: 0 additions & 1 deletion init/init_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ static int lookup_keyword(const char *s)
if (!strcmp(s, "etkey")) return K_setkey;
if (!strcmp(s, "etprop")) return K_setprop;
if (!strcmp(s, "etrlimit")) return K_setrlimit;
if (!strcmp(s, "etsebool")) return K_setsebool;
if (!strcmp(s, "ocket")) return K_socket;
if (!strcmp(s, "tart")) return K_start;
if (!strcmp(s, "top")) return K_stop;
Expand Down
2 changes: 0 additions & 2 deletions init/keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ int do_setcon(int nargs, char **args);
int do_setkey(int nargs, char **args);
int do_setprop(int nargs, char **args);
int do_setrlimit(int nargs, char **args);
int do_setsebool(int nargs, char **args);
int do_start(int nargs, char **args);
int do_stop(int nargs, char **args);
int do_swapon_all(int nargs, char **args);
Expand Down Expand Up @@ -87,7 +86,6 @@ enum {
KEYWORD(setkey, COMMAND, 0, do_setkey)
KEYWORD(setprop, COMMAND, 2, do_setprop)
KEYWORD(setrlimit, COMMAND, 3, do_setrlimit)
KEYWORD(setsebool, COMMAND, 2, do_setsebool)
KEYWORD(socket, OPTION, 0, 0)
KEYWORD(start, COMMAND, 1, do_start)
KEYWORD(stop, COMMAND, 1, do_stop)
Expand Down
4 changes: 0 additions & 4 deletions init/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,6 @@ setprop <name> <value>
setrlimit <resource> <cur> <max>
Set the rlimit for a resource.

setsebool <name> <value>
Set SELinux boolean <name> to <value>.
<value> may be 1|true|on or 0|false|off

start <service>
Start a service running if it is not already running.

Expand Down
2 changes: 0 additions & 2 deletions toolbox/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ OUR_TOOLS := \
df \
getevent \
getprop \
getsebool \
iftop \
ioctl \
ionice \
Expand All @@ -64,7 +63,6 @@ OUR_TOOLS := \
schedtop \
sendevent \
setprop \
setsebool \
smd \
start \
stop \
Expand Down
104 changes: 0 additions & 104 deletions toolbox/getsebool.c

This file was deleted.

46 changes: 0 additions & 46 deletions toolbox/setsebool.c

This file was deleted.

0 comments on commit d4b2d89

Please sign in to comment.