Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
85031935
Commit
85031935
authored
Dec 28, 2007
by
Rémi Denis-Courmont
Browse files
Be on the safe side of memory protection for now: use PROT_WRITE.
parent
2509ec68
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/access/file.c
View file @
85031935
...
...
@@ -208,7 +208,14 @@ static int Open( vlc_object_t *p_this )
/* Autodetect mmap() support */
if
(
p_sys
->
b_pace_control
&&
S_ISREG
(
st
.
st_mode
)
&&
(
st
.
st_size
>
0
))
{
void
*
addr
=
mmap
(
NULL
,
1
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
);
/* TODO: Do not allow PROT_WRITE, we should not need it.
* However, this far, "block" ownership seems such that whoever
* "receives" a block can freely modify its content. Hence we _may_
* need PROT_WRITE not to default memory protection.
* NOTE: With MAP_PRIVATE, changes are not committed to the underlying
* file, write open permission is not required.
*/
void
*
addr
=
mmap
(
NULL
,
1
,
PROT_READ
|
PROT_WRITE
,
MAP_PRIVATE
,
fd
,
0
);
if
(
addr
!=
MAP_FAILED
)
{
/* Does the file system support mmap? */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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