Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
719507f3
Commit
719507f3
authored
Jul 13, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add config_IsSafe() internal helper
parent
98f81c29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
src/config/core.c
src/config/core.c
+6
-0
src/libvlc.h
src/libvlc.h
+1
-0
src/misc/variables.c
src/misc/variables.c
+5
-9
No files found.
src/config/core.c
View file @
719507f3
...
@@ -89,6 +89,12 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
...
@@ -89,6 +89,12 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
return
i_type
;
return
i_type
;
}
}
bool
config_IsSafe
(
const
char
*
name
)
{
module_config_t
*
p_config
=
config_FindConfig
(
NULL
,
name
);
return
p_config
!=
NULL
&&
p_config
->
b_safe
;
}
#undef config_GetInt
#undef config_GetInt
/*****************************************************************************
/*****************************************************************************
* config_GetInt: get the value of an int variable
* config_GetInt: get the value of an int variable
...
...
src/libvlc.h
View file @
719507f3
...
@@ -235,6 +235,7 @@ extern const size_t libvlc_config_count;
...
@@ -235,6 +235,7 @@ extern const size_t libvlc_config_count;
* Variables stuff
* Variables stuff
*/
*/
void
var_OptionParse
(
vlc_object_t
*
,
const
char
*
,
bool
trusted
);
void
var_OptionParse
(
vlc_object_t
*
,
const
char
*
,
bool
trusted
);
bool
config_IsSafe
(
const
char
*
);
/*
/*
...
...
src/misc/variables.c
View file @
719507f3
...
@@ -1034,16 +1034,12 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option,
...
@@ -1034,16 +1034,12 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option,
(
!
psz_value
||
!*
psz_value
)
)
goto
cleanup
;
/* Invalid value */
(
!
psz_value
||
!*
psz_value
)
)
goto
cleanup
;
/* Invalid value */
/* check if option is unsafe */
/* check if option is unsafe */
if
(
!
trusted
)
if
(
!
trusted
&&
!
config_IsSafe
(
psz_name
)
)
{
{
module_config_t
*
p_config
=
config_FindConfig
(
p_obj
,
psz_name
);
msg_Err
(
p_obj
,
"unsafe option
\"
%s
\"
has been ignored for "
if
(
!
p_config
||
!
p_config
->
b_safe
)
"security reasons"
,
psz_name
);
{
free
(
psz_name
);
msg_Err
(
p_obj
,
"unsafe option
\"
%s
\"
has been ignored for "
return
;
"security reasons"
,
psz_name
);
free
(
psz_name
);
return
;
}
}
}
/* Create the variable in the input object.
/* Create the variable in the input object.
...
...
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