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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Will Angenent
redoxfs
Commits
602a63ac
Verified
Commit
602a63ac
authored
5 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Return EXDEV to tell kernel to resolve cross-scheme links
parent
43533e8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mount/redox/scheme.rs
+4
-5
4 additions, 5 deletions
src/mount/redox/scheme.rs
with
4 additions
and
5 deletions
src/mount/redox/scheme.rs
+
4
−
5
View file @
602a63ac
...
...
@@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use
std
::
time
::{
SystemTime
,
UNIX_EPOCH
};
use
syscall
::
data
::{
Map
,
Stat
,
StatVfs
,
TimeSpec
};
use
syscall
::
error
::{
Error
,
Result
,
EACCES
,
EEXIST
,
EISDIR
,
ENOTDIR
,
ENOTEMPTY
,
EPERM
,
ENOENT
,
EBADF
,
ELOOP
,
EINVAL
};
use
syscall
::
error
::{
Error
,
Result
,
EACCES
,
EEXIST
,
EISDIR
,
ENOTDIR
,
ENOTEMPTY
,
EPERM
,
ENOENT
,
EBADF
,
ELOOP
,
EINVAL
,
EXDEV
};
use
syscall
::
flag
::{
O_CREAT
,
O_DIRECTORY
,
O_STAT
,
O_EXCL
,
O_TRUNC
,
O_ACCMODE
,
O_RDONLY
,
O_WRONLY
,
O_RDWR
,
MODE_PERM
,
O_SYMLINK
,
O_NOFOLLOW
};
use
syscall
::
scheme
::
Scheme
;
...
...
@@ -37,7 +37,7 @@ impl<D: Disk> FileScheme<D> {
fn
resolve_symlink
(
&
self
,
fs
:
&
mut
FileSystem
<
D
>
,
uid
:
u32
,
gid
:
u32
,
url
:
&
[
u8
],
node
:
(
u64
,
Node
),
nodes
:
&
mut
Vec
<
(
u64
,
Node
)
>
)
->
Result
<
Vec
<
u8
>>
{
let
mut
node
=
node
;
for
_
in
1
..
10
{
// XXX What should the limit be?
for
_
in
0
..
32
{
// XXX What should the limit be?
let
mut
buf
=
[
0
;
4096
];
let
count
=
fs
.read_node
(
node
.0
,
0
,
&
mut
buf
)
?
;
let
scheme
=
format!
(
"{}:"
,
&
self
.name
);
...
...
@@ -50,8 +50,7 @@ impl<D: Disk> FileScheme<D> {
nodes
.push
(
next_node
);
return
Ok
(
canon
[
scheme
.len
()
..
]
.to_vec
());
}
else
{
// TODO: Find way to support symlink to another scheme
return
Err
(
Error
::
new
(
ENOENT
));
return
Err
(
Error
::
new
(
EXDEV
));
}
}
node
=
next_node
;
...
...
@@ -218,7 +217,7 @@ impl<D: Disk> Scheme for FileScheme<D> {
}
else
{
Box
::
new
(
DirResource
::
new
(
path
.to_string
(),
node
.0
,
None
,
uid
))
}
}
else
if
node
.1
.is_symlink
()
&&
!
(
flags
&
O_STAT
==
O_STAT
&&
flags
&
O_NOFOLLOW
==
O_NOFOLLOW
)
&&
flags
&
O_SYMLINK
!=
O_SYMLINK
{
}
else
if
node
.1
.is_symlink
()
&&
!
(
flags
&
O_STAT
==
O_STAT
&&
flags
&
O_NOFOLLOW
==
O_NOFOLLOW
)
&&
flags
&
O_SYMLINK
!=
O_SYMLINK
{
let
mut
resolve_nodes
=
Vec
::
new
();
let
resolved
=
self
.resolve_symlink
(
&
mut
fs
,
uid
,
gid
,
url
,
node
,
&
mut
resolve_nodes
)
?
;
drop
(
fs
);
...
...
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