Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
redoxfs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anand Sundararaj
redoxfs
Commits
dc5bd707
Unverified
Commit
dc5bd707
authored
7 years ago
by
Ian Douglas Scott
Browse files
Options
Downloads
Patches
Plain Diff
futimens: do not require O_RWONLY/O_RDWR
parent
fc0af50b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mount/redox/resource.rs
+7
-3
7 additions, 3 deletions
mount/redox/resource.rs
mount/redox/scheme.rs
+2
-2
2 additions, 2 deletions
mount/redox/scheme.rs
with
9 additions
and
5 deletions
mount/redox/resource.rs
+
7
−
3
View file @
dc5bd707
...
@@ -131,15 +131,17 @@ pub struct FileResource {
...
@@ -131,15 +131,17 @@ pub struct FileResource {
block
:
u64
,
block
:
u64
,
flags
:
usize
,
flags
:
usize
,
seek
:
u64
,
seek
:
u64
,
uid
:
u32
,
}
}
impl
FileResource
{
impl
FileResource
{
pub
fn
new
(
path
:
String
,
block
:
u64
,
flags
:
usize
,
seek
:
u64
)
->
FileResource
{
pub
fn
new
(
path
:
String
,
block
:
u64
,
flags
:
usize
,
seek
:
u64
,
uid
:
u32
)
->
FileResource
{
FileResource
{
FileResource
{
path
:
path
,
path
:
path
,
block
:
block
,
block
:
block
,
flags
:
flags
,
flags
:
flags
,
seek
:
seek
,
seek
:
seek
,
uid
:
uid
,
}
}
}
}
}
}
...
@@ -151,6 +153,7 @@ impl Resource for FileResource {
...
@@ -151,6 +153,7 @@ impl Resource for FileResource {
block
:
self
.block
,
block
:
self
.block
,
flags
:
self
.flags
,
flags
:
self
.flags
,
seek
:
self
.seek
,
seek
:
self
.seek
,
uid
:
self
.uid
,
}))
}))
}
}
...
@@ -246,9 +249,10 @@ impl Resource for FileResource {
...
@@ -246,9 +249,10 @@ impl Resource for FileResource {
}
}
fn
utimens
(
&
mut
self
,
times
:
&
[
TimeSpec
],
fs
:
&
mut
FileSystem
)
->
Result
<
usize
>
{
fn
utimens
(
&
mut
self
,
times
:
&
[
TimeSpec
],
fs
:
&
mut
FileSystem
)
->
Result
<
usize
>
{
if
self
.flags
&
O_ACCMODE
==
O_RDWR
||
self
.flags
&
O_ACCMODE
==
O_WRONLY
{
let
mut
node
=
fs
.node
(
self
.block
)
?
;
if
node
.1
.uid
==
self
.uid
||
self
.uid
==
0
{
if
let
Some
(
mtime
)
=
times
.get
(
1
)
{
if
let
Some
(
mtime
)
=
times
.get
(
1
)
{
let
mut
node
=
fs
.node
(
self
.block
)
?
;
node
.1
.mtime
=
mtime
.tv_sec
as
u64
;
node
.1
.mtime
=
mtime
.tv_sec
as
u64
;
node
.1
.mtime_nsec
=
mtime
.tv_nsec
as
u32
;
node
.1
.mtime_nsec
=
mtime
.tv_nsec
as
u32
;
...
...
This diff is collapsed.
Click to expand it.
mount/redox/scheme.rs
+
2
−
2
View file @
dc5bd707
...
@@ -253,7 +253,7 @@ impl Scheme for FileScheme {
...
@@ -253,7 +253,7 @@ impl Scheme for FileScheme {
0
0
};
};
Box
::
new
(
FileResource
::
new
(
path
.to_string
(),
node
.0
,
flags
,
seek
))
Box
::
new
(
FileResource
::
new
(
path
.to_string
(),
node
.0
,
flags
,
seek
,
uid
))
},
},
None
=>
if
flags
&
O_CREAT
==
O_CREAT
{
None
=>
if
flags
&
O_CREAT
==
O_CREAT
{
let
mut
last_part
=
String
::
new
();
let
mut
last_part
=
String
::
new
();
...
@@ -293,7 +293,7 @@ impl Scheme for FileScheme {
...
@@ -293,7 +293,7 @@ impl Scheme for FileScheme {
0
0
};
};
Box
::
new
(
FileResource
::
new
(
path
.to_string
(),
node
.0
,
flags
,
seek
))
Box
::
new
(
FileResource
::
new
(
path
.to_string
(),
node
.0
,
flags
,
seek
,
uid
))
}
}
}
else
{
}
else
{
return
Err
(
Error
::
new
(
EPERM
));
return
Err
(
Error
::
new
(
EPERM
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment