summaryrefslogtreecommitdiff
path: root/init/init_parser.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-06-02 11:11:02 -0700
committerMark Salyzyn <salyzyn@google.com>2015-06-02 15:17:52 -0700
commit17fff893c04971b519d25d52b07f51111353cba5 (patch)
treebcd727357959e02a0e4e97af7edf385265bdaa8e /init/init_parser.cpp
parent3ef730c57f88ac24b0d6b021e43fc344d602fe36 (diff)
init: change exec parsing to make SECLABEL optional
Allow SECLABEL to be - to denote default Change-Id: I58cdc6c805dc6e50dc42b7e13e72d0eaf4864f11
Diffstat (limited to 'init/init_parser.cpp')
-rw-r--r--init/init_parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/init/init_parser.cpp b/init/init_parser.cpp
index df049edeb..f975b6c0b 100644
--- a/init/init_parser.cpp
+++ b/init/init_parser.cpp
@@ -664,6 +664,7 @@ int action_queue_empty()
service* make_exec_oneshot_service(int nargs, char** args) {
// Parse the arguments: exec [SECLABEL [UID [GID]*] --] COMMAND ARGS...
+ // SECLABEL can be a - to denote default
int command_arg = 1;
for (int i = 1; i < nargs; ++i) {
if (strcmp(args[i], "--") == 0) {
@@ -689,7 +690,7 @@ service* make_exec_oneshot_service(int nargs, char** args) {
return NULL;
}
- if (command_arg > 2) {
+ if ((command_arg > 2) && strcmp(args[1], "-")) {
svc->seclabel = args[1];
}
if (command_arg > 3) {