Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pkgar
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
pkgar
Commits
8faa4846
Commit
8faa4846
authored
2 years ago
by
Will Angenent
Browse files
Options
Downloads
Patches
Plain Diff
Fix missing suid permissions when building under MacOS
parent
65f43a3b
No related branches found
No related tags found
1 merge request
!12
Fix missing suid permissions when building under MacOS
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkgar/src/transaction.rs
+10
-1
10 additions, 1 deletion
pkgar/src/transaction.rs
with
10 additions
and
1 deletion
pkgar/src/transaction.rs
+
10
−
1
View file @
8faa4846
...
@@ -2,7 +2,7 @@ use std::io;
...
@@ -2,7 +2,7 @@ use std::io;
use
std
::
ffi
::
OsStr
;
use
std
::
ffi
::
OsStr
;
use
std
::
fs
::{
self
,
File
};
use
std
::
fs
::{
self
,
File
};
use
std
::
os
::
unix
::
ffi
::
OsStrExt
;
use
std
::
os
::
unix
::
ffi
::
OsStrExt
;
use
std
::
os
::
unix
::
fs
::{
symlink
,
OpenOptionsExt
};
use
std
::
os
::
unix
::
fs
::{
symlink
,
OpenOptionsExt
,
PermissionsExt
};
use
std
::
path
::{
Path
,
PathBuf
};
use
std
::
path
::{
Path
,
PathBuf
};
use
blake3
::
Hash
;
use
blake3
::
Hash
;
...
@@ -121,6 +121,15 @@ impl Transaction {
...
@@ -121,6 +121,15 @@ impl Transaction {
.open
(
&
tmp_path
)
.open
(
&
tmp_path
)
.chain_err
(||
tmp_path
.as_path
()
)
?
;
.chain_err
(||
tmp_path
.as_path
()
)
?
;
// In MacOS, the setuid bit isn't set when creating a file, in spite
// of being requested to so.
if
cfg!
(
target_os
=
"macos"
)
&&
mode
.perm
()
.bits
()
&
0o6000
==
0o6000
{
let
metadata
=
tmp_file
.metadata
()
?
;
let
mut
permissions
=
metadata
.permissions
();
permissions
.set_mode
(
metadata
.permissions
()
.mode
()
|
0o6000
);
fs
::
set_permissions
(
&
tmp_path
,
permissions
)
?
;
}
copy_and_hash
(
src
.entry_reader
(
entry
),
&
mut
tmp_file
,
&
mut
buf
)
copy_and_hash
(
src
.entry_reader
(
entry
),
&
mut
tmp_file
,
&
mut
buf
)
.chain_err
(||
&
tmp_path
)
.chain_err
(||
&
tmp_path
)
.chain_err
(||
format!
(
"Copying entry to tempfile: '{}'"
,
relative_path
.display
())
)
?
.chain_err
(||
format!
(
"Copying entry to tempfile: '{}'"
,
relative_path
.display
())
)
?
...
...
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