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
85031935
Commit
85031935
authored
Dec 28, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be on the safe side of memory protection for now: use PROT_WRITE.
parent
2509ec68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
modules/access/file.c
modules/access/file.c
+8
-1
No files found.
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
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