Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
redox-os
relibc
Commits
509c4520
Commit
509c4520
authored
6 months ago
by
Jeremy Soller
Browse files
Options
Downloads
Plain Diff
Merge branch 'umask' into 'master'
Preserve umask across execv. See merge request
!512
parents
47f44ee1
ec216e56
No related branches found
No related tags found
1 merge request
!512
Preserve umask across execv.
Pipeline
#16318
passed
6 months ago
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
redox-rt/src/proc.rs
+5
-0
5 additions, 0 deletions
redox-rt/src/proc.rs
src/platform/auxv_defs.rs
+3
-0
3 additions, 0 deletions
src/platform/auxv_defs.rs
src/platform/mod.rs
+9
-0
9 additions, 0 deletions
src/platform/mod.rs
src/platform/redox/exec.rs
+1
-0
1 addition, 0 deletions
src/platform/redox/exec.rs
with
18 additions
and
0 deletions
redox-rt/src/proc.rs
+
5
−
0
View file @
509c4520
...
@@ -51,6 +51,8 @@ pub struct ExtraInfo<'a> {
...
@@ -51,6 +51,8 @@ pub struct ExtraInfo<'a> {
pub
sigignmask
:
u64
,
pub
sigignmask
:
u64
,
// POSIX also states that the sigprocmask must be preserved across execs.
// POSIX also states that the sigprocmask must be preserved across execs.
pub
sigprocmask
:
u64
,
pub
sigprocmask
:
u64
,
/// File mode creation mask (POSIX)
pub
umask
:
u32
,
}
}
pub
fn
fexec_impl
<
A
,
E
>
(
pub
fn
fexec_impl
<
A
,
E
>
(
...
@@ -422,6 +424,9 @@ where
...
@@ -422,6 +424,9 @@ where
push
(
extrainfo
.sigprocmask
as
usize
)
?
;
push
(
extrainfo
.sigprocmask
as
usize
)
?
;
push
(
AT_REDOX_INHERITED_SIGPROCMASK
)
?
;
push
(
AT_REDOX_INHERITED_SIGPROCMASK
)
?
;
push
(
extrainfo
.umask
as
usize
)
?
;
push
(
AT_REDOX_UMASK
);
push
(
0
)
?
;
push
(
0
)
?
;
for
env
in
envs
{
for
env
in
envs
{
...
...
This diff is collapsed.
Click to expand it.
src/platform/auxv_defs.rs
+
3
−
0
View file @
509c4520
...
@@ -45,3 +45,6 @@ pub const AT_REDOX_INHERITED_SIGPROCMASK_HI: usize = 37;
...
@@ -45,3 +45,6 @@ pub const AT_REDOX_INHERITED_SIGPROCMASK_HI: usize = 37;
pub
const
AT_REDOX_INITIAL_DEFAULT_SCHEME_PTR
:
usize
=
38
;
pub
const
AT_REDOX_INITIAL_DEFAULT_SCHEME_PTR
:
usize
=
38
;
#[cfg(target_os
=
"redox"
)]
#[cfg(target_os
=
"redox"
)]
pub
const
AT_REDOX_INITIAL_DEFAULT_SCHEME_LEN
:
usize
=
39
;
pub
const
AT_REDOX_INITIAL_DEFAULT_SCHEME_LEN
:
usize
=
39
;
#[cfg(target_os
=
"redox"
)]
pub
const
AT_REDOX_UMASK
:
usize
=
40
;
This diff is collapsed.
Click to expand it.
src/platform/mod.rs
+
9
−
0
View file @
509c4520
...
@@ -287,6 +287,10 @@ pub fn get_auxv(auxvs: &[[usize; 2]], key: usize) -> Option<usize> {
...
@@ -287,6 +287,10 @@ pub fn get_auxv(auxvs: &[[usize; 2]], key: usize) -> Option<usize> {
pub
unsafe
fn
init
(
auxvs
:
Box
<
[[
usize
;
2
]]
>
)
{
pub
unsafe
fn
init
(
auxvs
:
Box
<
[[
usize
;
2
]]
>
)
{
redox_rt
::
initialize
();
redox_rt
::
initialize
();
use
syscall
::
MODE_PERM
;
use
crate
::
header
::
sys_stat
::
S_ISVTX
;
use
self
::
auxv_defs
::
*
;
use
self
::
auxv_defs
::
*
;
if
let
(
Some
(
cwd_ptr
),
Some
(
cwd_len
))
=
(
if
let
(
Some
(
cwd_ptr
),
Some
(
cwd_len
))
=
(
...
@@ -320,6 +324,11 @@ pub unsafe fn init(auxvs: Box<[[usize; 2]]>) {
...
@@ -320,6 +324,11 @@ pub unsafe fn init(auxvs: Box<[[usize; 2]]>) {
inherited_sigprocmask
|
=
(
mask
as
u64
)
<<
32
;
inherited_sigprocmask
|
=
(
mask
as
u64
)
<<
32
;
}
}
redox_rt
::
signal
::
set_sigmask
(
Some
(
inherited_sigprocmask
),
None
)
.unwrap
();
redox_rt
::
signal
::
set_sigmask
(
Some
(
inherited_sigprocmask
),
None
)
.unwrap
();
if
let
Some
(
umask
)
=
get_auxv
(
&
auxvs
,
AT_REDOX_UMASK
)
{
let
_
=
redox_rt
::
sys
::
swap_umask
((
umask
as
u32
)
&
u32
::
from
(
MODE_PERM
)
&
!
(
S_ISVTX
as
u32
));
}
}
}
#[cfg(not(target_os
=
"redox"
))]
#[cfg(not(target_os
=
"redox"
))]
pub
fn
init
(
auxvs
:
Box
<
[[
usize
;
2
]]
>
)
{}
pub
fn
init
(
auxvs
:
Box
<
[[
usize
;
2
]]
>
)
{}
This diff is collapsed.
Click to expand it.
src/platform/redox/exec.rs
+
1
−
0
View file @
509c4520
...
@@ -317,6 +317,7 @@ pub fn execve(
...
@@ -317,6 +317,7 @@ pub fn execve(
default_scheme
:
Some
(
&
default_scheme
),
default_scheme
:
Some
(
&
default_scheme
),
sigignmask
:
0
,
sigignmask
:
0
,
sigprocmask
,
sigprocmask
,
umask
:
redox_rt
::
sys
::
get_umask
(),
};
};
fexec_impl
(
fexec_impl
(
exec_fd_guard
,
exec_fd_guard
,
...
...
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