Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Ruderich
passt-mac
Commits
06305643
Commit
06305643
authored
Apr 12, 2016
by
Simon Ruderich
Browse files
slsm: add casts
parent
1f12bf86
Changes
3
Hide whitespace changes
Inline
Side-by-side
security/slsm/lsm.c
View file @
06305643
...
...
@@ -104,7 +104,7 @@ static int passt_bprm_set_creds(struct linux_binprm *bprm) {
/* buffer freed below, name is pointer into buffer */
name
=
passt_get_path
(
&
bprm
->
file
->
f_path
,
&
buffer
);
if
(
IS_ERR
(
name
))
{
error
=
PTR_ERR
(
name
);
error
=
(
int
)
PTR_ERR
(
name
);
name
=
bprm
->
filename
;
goto
audit
;
}
...
...
@@ -175,7 +175,7 @@ static int passt_path_common(const struct path *path, const struct cred *cred,
name
=
passt_get_path
(
path
,
&
buffer
);
if
(
IS_ERR
(
name
))
{
error
=
PTR_ERR
(
name
);
error
=
(
int
)
PTR_ERR
(
name
);
goto
cleanup
;
}
...
...
@@ -223,14 +223,14 @@ static int passt_path_link(struct dentry *old_dentry, struct path *new_dir,
target_name
=
passt_get_path
(
&
target
,
&
target_buffer
);
if
(
IS_ERR
(
target_name
))
{
ret
=
PTR_ERR
(
target_name
);
ret
=
(
int
)
PTR_ERR
(
target_name
);
goto
cleanup
;
}
perms
=
slsm_query_perms
(
target_name
,
pt
->
label
);
link_name
=
passt_get_path
(
&
link
,
&
link_buffer
);
if
(
IS_ERR
(
link_name
))
{
ret
=
PTR_ERR
(
link_name
);
ret
=
(
int
)
PTR_ERR
(
link_name
);
goto
cleanup
;
}
would_get
=
slsm_query_perms
(
link_name
,
pt
->
label
);
...
...
security/slsm/passtfs.c
View file @
06305643
...
...
@@ -136,7 +136,7 @@ static int __init create_passtfs(void)
passtfs_dir
=
securityfs_create_dir
(
"slsm"
,
NULL
);
if
(
IS_ERR
(
passtfs_dir
))
{
printk
(
KERN_ERR
"slsm: unable to create securityfs dir
\n
"
);
return
PTR_ERR
(
passtfs_dir
);
return
(
int
)
PTR_ERR
(
passtfs_dir
);
}
passtfs_profiles
=
securityfs_create_file
(
"profiles"
,
0600
,
passtfs_dir
,
...
...
@@ -144,7 +144,7 @@ static int __init create_passtfs(void)
if
(
IS_ERR
(
passtfs_profiles
))
{
securityfs_remove
(
passtfs_dir
);
printk
(
KERN_ERR
"slsm: unable to create securityfs file
\n
"
);
return
PTR_ERR
(
passtfs_profiles
);
return
(
int
)
PTR_ERR
(
passtfs_profiles
);
}
return
0
;
...
...
security/slsm/tree.c
View file @
06305643
...
...
@@ -57,7 +57,7 @@ static const char *next_path_component(const char **path, size_t *length) {
const
char
*
start
=
*
path
;
const
char
*
next
=
strchr
(
*
path
,
'/'
);
if
(
next
)
{
*
length
=
next
-
start
;
*
length
=
(
size_t
)(
next
-
start
)
;
next
++
;
/* skip '/' */
}
else
{
*
length
=
strlen
(
start
);
...
...
Write
Preview
Supports
Markdown
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