From c7ca9dd6c87d69c73706ddc5d739dd9d71314b62 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 24 Apr 2015 19:41:19 +0000 Subject: Revert "Revert "Remove now-unusable 'setcon' command."" This reverts commit b862bd00a4192d48c3ae82156d8c35b32283e9e4. This change was fine but an earlier change it depended on was broken. That change has been fixed and resubmitted. Bug: http://b/19702273 Change-Id: I17e565721026e48e2a73526f729f2481d4d6edb5 --- init/builtins.cpp | 9 --------- init/init_parser.cpp | 1 - init/keywords.h | 2 -- init/readme.txt | 5 ----- 4 files changed, 17 deletions(-) diff --git a/init/builtins.cpp b/init/builtins.cpp index 3bbaf83..4567b04 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -515,15 +515,6 @@ int do_swapon_all(int nargs, char **args) return ret; } -int do_setcon(int nargs, char **args) { - if (is_selinux_enabled() <= 0) - return 0; - if (setcon(args[1]) < 0) { - return -errno; - } - return 0; -} - int do_setprop(int nargs, char **args) { const char *name = args[1]; diff --git a/init/init_parser.cpp b/init/init_parser.cpp index ff31093..b76b04e 100644 --- a/init/init_parser.cpp +++ b/init/init_parser.cpp @@ -184,7 +184,6 @@ static int lookup_keyword(const char *s) case 's': if (!strcmp(s, "eclabel")) return K_seclabel; if (!strcmp(s, "ervice")) return K_service; - if (!strcmp(s, "etcon")) return K_setcon; if (!strcmp(s, "etenv")) return K_setenv; if (!strcmp(s, "etprop")) return K_setprop; if (!strcmp(s, "etrlimit")) return K_setrlimit; diff --git a/init/keywords.h b/init/keywords.h index 059dde1..37f01b8 100644 --- a/init/keywords.h +++ b/init/keywords.h @@ -20,7 +20,6 @@ int do_restorecon(int nargs, char **args); int do_restorecon_recursive(int nargs, char **args); int do_rm(int nargs, char **args); int do_rmdir(int nargs, char **args); -int do_setcon(int nargs, char **args); int do_setprop(int nargs, char **args); int do_setrlimit(int nargs, char **args); int do_start(int nargs, char **args); @@ -76,7 +75,6 @@ enum { KEYWORD(rmdir, COMMAND, 1, do_rmdir) KEYWORD(seclabel, OPTION, 0, 0) KEYWORD(service, SECTION, 0, 0) - KEYWORD(setcon, COMMAND, 1, do_setcon) KEYWORD(setenv, OPTION, 2, 0) KEYWORD(setprop, COMMAND, 2, do_setprop) KEYWORD(setrlimit, COMMAND, 3, do_setrlimit) diff --git a/init/readme.txt b/init/readme.txt index 84afd11..6b9c42d 100644 --- a/init/readme.txt +++ b/init/readme.txt @@ -252,11 +252,6 @@ rm rmdir Calls rmdir(2) on the given path. -setcon - Set the current process security context to the specified string. - This is typically only used from early-init to set the init context - before any other process is started. - setprop Set system property to . Properties are expanded within . -- cgit v1.1