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
1a1c1fd0
Commit
1a1c1fd0
authored
Nov 01, 2015
by
Pierre-Hugues Husson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename trust function to attr, to be more generic
parent
370951ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
sepolicy-inject.c
sepolicy-inject.c
+6
-7
No files found.
sepolicy-inject.c
View file @
1a1c1fd0
...
@@ -348,7 +348,7 @@ int load_policy(char *filename, policydb_t *policydb, struct policy_file *pf) {
...
@@ -348,7 +348,7 @@ int load_policy(char *filename, policydb_t *policydb, struct policy_file *pf) {
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
char
*
policy
=
NULL
,
*
source
=
NULL
,
*
target
=
NULL
,
*
class
=
NULL
,
*
perm
=
NULL
;
char
*
policy
=
NULL
,
*
source
=
NULL
,
*
target
=
NULL
,
*
class
=
NULL
,
*
perm
=
NULL
;
char
*
fcon
=
NULL
,
*
outfile
=
NULL
,
*
permissive
=
NULL
,
*
trust
=
NULL
,
*
filetrans
=
NULL
;
char
*
fcon
=
NULL
,
*
outfile
=
NULL
,
*
permissive
=
NULL
,
*
attr
=
NULL
,
*
filetrans
=
NULL
;
policydb_t
policydb
;
policydb_t
policydb
;
struct
policy_file
pf
,
outpf
;
struct
policy_file
pf
,
outpf
;
sidtab_t
sidtab
;
sidtab_t
sidtab
;
...
@@ -358,7 +358,7 @@ int main(int argc, char **argv)
...
@@ -358,7 +358,7 @@ int main(int argc, char **argv)
struct
option
long_options
[]
=
{
struct
option
long_options
[]
=
{
{
"
trust
"
,
required_argument
,
NULL
,
'a'
},
{
"
attr
"
,
required_argument
,
NULL
,
'a'
},
{
"source"
,
required_argument
,
NULL
,
's'
},
{
"source"
,
required_argument
,
NULL
,
's'
},
{
"target"
,
required_argument
,
NULL
,
't'
},
{
"target"
,
required_argument
,
NULL
,
't'
},
{
"class"
,
required_argument
,
NULL
,
'c'
},
{
"class"
,
required_argument
,
NULL
,
'c'
},
...
@@ -375,7 +375,7 @@ int main(int argc, char **argv)
...
@@ -375,7 +375,7 @@ int main(int argc, char **argv)
while
((
ch
=
getopt_long
(
argc
,
argv
,
"a:f:g:s:t:c:p:P:o:Z:z:"
,
long_options
,
NULL
))
!=
-
1
)
{
while
((
ch
=
getopt_long
(
argc
,
argv
,
"a:f:g:s:t:c:p:P:o:Z:z:"
,
long_options
,
NULL
))
!=
-
1
)
{
switch
(
ch
)
{
switch
(
ch
)
{
case
'a'
:
case
'a'
:
trust
=
optarg
;
attr
=
optarg
;
break
;
break
;
case
'f'
:
case
'f'
:
fcon
=
optarg
;
fcon
=
optarg
;
...
@@ -414,7 +414,7 @@ int main(int argc, char **argv)
...
@@ -414,7 +414,7 @@ int main(int argc, char **argv)
}
}
}
}
if
(((
!
source
||
!
target
||
!
class
||
!
perm
)
&&
!
permissive
&&
!
fcon
&&
!
trust
&&!
filetrans
)
||
!
policy
)
if
(((
!
source
||
!
target
||
!
class
||
!
perm
)
&&
!
permissive
&&
!
fcon
&&
!
attr
&&!
filetrans
)
||
!
policy
)
usage
(
argv
[
0
]);
usage
(
argv
[
0
]);
if
(
!
outfile
)
if
(
!
outfile
)
...
@@ -448,9 +448,8 @@ int main(int argc, char **argv)
...
@@ -448,9 +448,8 @@ int main(int argc, char **argv)
add_file_transition
(
source
,
fcon
,
target
,
class
,
filetrans
,
&
policydb
);
add_file_transition
(
source
,
fcon
,
target
,
class
,
filetrans
,
&
policydb
);
}
else
if
(
fcon
)
{
}
else
if
(
fcon
)
{
add_transition
(
source
,
fcon
,
target
,
class
,
&
policydb
);
add_transition
(
source
,
fcon
,
target
,
class
,
&
policydb
);
}
else
if
(
trust
)
{
}
else
if
(
attr
)
{
add_type
(
trust
,
"mlstrustedobject"
,
&
policydb
);
add_type
(
source
,
attr
,
&
policydb
);
add_type
(
trust
,
"mlstrustedsubject"
,
&
policydb
);
}
else
{
}
else
{
create_domain
(
source
,
&
policydb
);
create_domain
(
source
,
&
policydb
);
if
(
add_rule
(
source
,
target
,
class
,
perm
,
&
policydb
))
{
if
(
add_rule
(
source
,
target
,
class
,
perm
,
&
policydb
))
{
...
...
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