Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
106
Merge Requests
106
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
1e7e575a
Commit
1e7e575a
authored
Oct 23, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
602eece1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
software/ors-amarisoft/ru/capdo.c
software/ors-amarisoft/ru/capdo.c
+3
-3
No files found.
software/ors-amarisoft/ru/capdo.c
View file @
1e7e575a
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
// See COPYING file for full licensing terms.
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// See https://www.nexedi.com/licensing for rationale and options.
// `capdo prog ...` executes prog with inherited capabilities.
//
Program
`capdo prog ...` executes prog with inherited capabilities.
// It is used as trampoline to run script under setcap environment.
// It is used as trampoline to run script
s
under setcap environment.
#include <errno.h>
#include <errno.h>
#include <stdarg.h>
#include <stdarg.h>
...
@@ -58,7 +58,7 @@ int main(int argc, const char *argv[]) {
...
@@ -58,7 +58,7 @@ int main(int argc, const char *argv[]) {
}
}
cap_set_proc
(
caps
)
&&
die_err
(
"cap_set_proc"
);
cap_set_proc
(
caps
)
&&
die_err
(
"cap_set_proc"
);
// raise ambient capabities to what is permitted/inheritable
// raise ambient capabi
li
ties to what is permitted/inheritable
for
(
cap
=
0
;
cap
<=
CAP_LAST_CAP
;
cap
++
)
{
for
(
cap
=
0
;
cap
<=
CAP_LAST_CAP
;
cap
++
)
{
if
(
capbits
&
(
1ULL
<<
cap
))
if
(
capbits
&
(
1ULL
<<
cap
))
prctl
(
PR_CAP_AMBIENT
,
PR_CAP_AMBIENT_RAISE
,
cap
,
0
,
0
)
&&
die_err
(
"prctl ambient raise"
);
prctl
(
PR_CAP_AMBIENT
,
PR_CAP_AMBIENT_RAISE
,
cap
,
0
,
0
)
&&
die_err
(
"prctl ambient raise"
);
...
...
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