Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
d50c1f39
Commit
d50c1f39
authored
Mar 15, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make context option NOP
parent
ef6b25b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
su.c
su.c
+3
-9
su.h
su.h
+0
-1
No files found.
su.c
View file @
d50c1f39
...
@@ -442,7 +442,6 @@ static void usage(int status) {
...
@@ -442,7 +442,6 @@ static void usage(int status) {
"Options:
\n
"
"Options:
\n
"
" --daemon start the su daemon agent
\n
"
" --daemon start the su daemon agent
\n
"
" -c, --command COMMAND pass COMMAND to the invoked shell
\n
"
" -c, --command COMMAND pass COMMAND to the invoked shell
\n
"
" --context context Change SELinux context
\n
"
" -h, --help display this help message and exit
\n
"
" -h, --help display this help message and exit
\n
"
" -, -l, --login pretend the shell to be a login shell
\n
"
" -, -l, --login pretend the shell to be a login shell
\n
"
" -m, -p,
\n
"
" -m, -p,
\n
"
...
@@ -540,12 +539,8 @@ static __attribute__ ((noreturn)) void allow(struct su_context *ctx) {
...
@@ -540,12 +539,8 @@ static __attribute__ ((noreturn)) void allow(struct su_context *ctx) {
arg0
,
PARG
(
0
),
PARG
(
1
),
PARG
(
2
),
PARG
(
3
),
PARG
(
4
),
PARG
(
5
),
arg0
,
PARG
(
0
),
PARG
(
1
),
PARG
(
2
),
PARG
(
3
),
PARG
(
4
),
PARG
(
5
),
(
ctx
->
to
.
optind
+
6
<
ctx
->
to
.
argc
)
?
" ..."
:
""
);
(
ctx
->
to
.
optind
+
6
<
ctx
->
to
.
argc
)
?
" ..."
:
""
);
if
(
ctx
->
to
.
context
)
{
setexeccon
(
"u:r:su:s0"
);
setexeccon
(
ctx
->
to
.
context
);
}
else
{
setexeccon
(
"u:r:su:s0"
);
}
ctx
->
to
.
argv
[
--
argc
]
=
arg0
;
ctx
->
to
.
argv
[
--
argc
]
=
arg0
;
execvp
(
binary
,
ctx
->
to
.
argv
+
argc
);
execvp
(
binary
,
ctx
->
to
.
argv
+
argc
);
err
=
errno
;
err
=
errno
;
...
@@ -691,7 +686,6 @@ int su_main_nodaemon(int argc, char **argv) {
...
@@ -691,7 +686,6 @@ int su_main_nodaemon(int argc, char **argv) {
.
keepenv
=
0
,
.
keepenv
=
0
,
.
shell
=
NULL
,
.
shell
=
NULL
,
.
command
=
NULL
,
.
command
=
NULL
,
.
context
=
NULL
,
.
argv
=
argv
,
.
argv
=
argv
,
.
argc
=
argc
,
.
argc
=
argc
,
.
optind
=
0
,
.
optind
=
0
,
...
@@ -761,7 +755,7 @@ int su_main_nodaemon(int argc, char **argv) {
...
@@ -761,7 +755,7 @@ int su_main_nodaemon(int argc, char **argv) {
}
}
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
case
'z'
:
case
'z'
:
ctx
.
to
.
context
=
optarg
;
// Do nothing, placed here for legacy support :)
break
;
break
;
default:
default:
/* Bionic getopt_long doesn't terminate its error output by newline */
/* Bionic getopt_long doesn't terminate its error output by newline */
...
...
su.h
View file @
d50c1f39
...
@@ -95,7 +95,6 @@ struct su_request {
...
@@ -95,7 +95,6 @@ struct su_request {
int
login
;
int
login
;
int
keepenv
;
int
keepenv
;
char
*
shell
;
char
*
shell
;
char
*
context
;
char
*
command
;
char
*
command
;
char
**
argv
;
char
**
argv
;
int
argc
;
int
argc
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment