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
aefbc1c9
Commit
aefbc1c9
authored
Apr 17, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the helper function to higher level
parent
c37a2e61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
19 deletions
+1
-19
misc.c
misc.c
+0
-16
su.c
su.c
+1
-1
su.h
su.h
+0
-2
No files found.
misc.c
View file @
aefbc1c9
...
@@ -13,22 +13,6 @@
...
@@ -13,22 +13,6 @@
#include "magisk.h"
#include "magisk.h"
#include "su.h"
#include "su.h"
int
quit_signals
[]
=
{
SIGALRM
,
SIGABRT
,
SIGHUP
,
SIGPIPE
,
SIGQUIT
,
SIGTERM
,
SIGINT
,
0
};
void
setup_sighandlers
(
void
(
*
handler
)(
int
))
{
struct
sigaction
act
;
// Install the termination handlers
// Note: we're assuming that none of these signal handlers are already trapped.
// If they are, we'll need to modify this code to save the previous handler and
// call it after we restore stdin to its previous state.
memset
(
&
act
,
0
,
sizeof
(
act
));
act
.
sa_handler
=
handler
;
for
(
int
i
=
0
;
quit_signals
[
i
];
++
i
)
{
sigaction
(
quit_signals
[
i
],
&
act
,
NULL
);
}
}
void
set_identity
(
unsigned
uid
)
{
void
set_identity
(
unsigned
uid
)
{
/*
/*
* Set effective uid back to root, otherwise setres[ug]id will fail
* Set effective uid back to root, otherwise setres[ug]id will fail
...
...
su.c
View file @
aefbc1c9
...
@@ -214,7 +214,7 @@ int su_daemon_main(int argc, char **argv) {
...
@@ -214,7 +214,7 @@ int su_daemon_main(int argc, char **argv) {
.
database_path
=
APPLICATION_DATA_PATH
REQUESTOR_DATABASE_PATH
,
.
database_path
=
APPLICATION_DATA_PATH
REQUESTOR_DATABASE_PATH
,
.
base_path
=
APPLICATION_DATA_PATH
REQUESTOR
.
base_path
=
APPLICATION_DATA_PATH
REQUESTOR
},
},
.
umask
=
umask
(
02
7
),
.
umask
=
umask
(
02
2
),
};
};
su_ctx
=
&
ctx
;
su_ctx
=
&
ctx
;
...
...
su.h
View file @
aefbc1c9
...
@@ -103,7 +103,6 @@ typedef enum {
...
@@ -103,7 +103,6 @@ typedef enum {
}
policy_t
;
}
policy_t
;
extern
int
from_uid
,
from_pid
;
extern
int
from_uid
,
from_pid
;
extern
int
quit_signals
[];
// su.c
// su.c
...
@@ -127,7 +126,6 @@ policy_t database_check(struct su_context *ctx);
...
@@ -127,7 +126,6 @@ policy_t database_check(struct su_context *ctx);
// misc.c
// misc.c
void
setup_sighandlers
(
void
(
*
handler
)(
int
));
void
set_identity
(
unsigned
uid
);
void
set_identity
(
unsigned
uid
);
char
*
get_command
(
const
struct
su_request
*
to
);
char
*
get_command
(
const
struct
su_request
*
to
);
int
fork_zero_fucks
();
int
fork_zero_fucks
();
...
...
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