Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Meißner
Scripts
Commits
40dd04af
Commit
40dd04af
authored
Feb 21, 2023
by
Florian Meißner
Browse files
Options
Downloads
Patches
Plain Diff
add keepass-diff wrapper (w/o networking and only first two parameters bound R/O into jail)
parent
27a23148
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bubblewrap/keepass-diff.sh
+54
-0
54 additions, 0 deletions
bubblewrap/keepass-diff.sh
with
54 additions
and
0 deletions
bubblewrap/keepass-diff.sh
0 → 100755
+
54
−
0
View file @
40dd04af
#!/usr/bin/env fish
# https://github.com/containers/bubblewrap/blob/main/demos/bubblewrap-shell.sh
[
(
count
$argv
)
-ge
2
]
||
begin
;
echo
Atleast
'<db1> <db2>'
required
;
return
;
end
;
exec
bwrap
--ro-bind
/usr /usr
\
--dir
/tmp
\
--dir
/var
\
--symlink
../tmp var/tmp
\
--proc
/proc
\
--dev
/dev
\
#
# no networking wanted
# --ro-bind /etc/resolv.conf /etc/resolv.conf \
#
--symlink
usr/lib /lib
\
--symlink
usr/lib64 /lib64
\
--symlink
usr/bin /bin
\
--symlink
usr/sbin /sbin
\
# --chdir / \
--unshare-all
\
#
# no networking wanted
# --share-net \
#
--die-with-parent
\
--dir
/run/user/
$(
id
-u
)
\
--setenv
XDG_RUNTIME_DIR
"/run/user/
`
id
-u
`
"
\
--setenv
PS1
"bwrap-demo
\$
"
\
--chdir
/run/user/
$(
id
-u
)
\
--file
11 /etc/passwd
\
--file
12 /etc/group
\
11<
(
getent passwd
$UID
65534 | psub
)
\
12<
(
getent group
(
id
-g
)
65534 | psub
)
\
#
#
#############
# new stuff #
#############
#
# get executable
--ro-bind
~/software/keepass-diff/target/release/keepass-diff /keepass-diff
\
#
# get dbs into runtime dir r/o, rename to avoid collisions
--ro-bind
$argv
[
1] /run/user/
$(
id
-u
)
/left_
(
basename
$argv
[
1]
)
\
--ro-bind
$argv
[
2] /run/user/
$(
id
-u
)
/right_
(
basename
$argv
[
2]
)
\
#
# execute keepass-diff w/ modified paths
/keepass-diff left_
(
basename
$argv
[
1]
)
right_
(
basename
$argv
[
2]
)
$argv
[
3..]
#
######
#
# shell for testing
--setenv
argv
"
$argv
"
--
fish
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