projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4d6442
)
jail: always mount /dev as additional tmpfs
author
Daniel Golle
<daniel@makrotopia.org>
Tue, 14 Apr 2020 14:46:03 +0000
(15:46 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Tue, 14 Apr 2020 14:47:10 +0000
(15:47 +0100)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c
patch
|
blob
|
history
diff --git
a/jail/jail.c
b/jail/jail.c
index 87b671befb4b9a4a2b869647516b33f15a528aff..ca8b832ea219880f40f8076c8286cc103727e896 100644
(file)
--- a/
jail/jail.c
+++ b/
jail/jail.c
@@
-187,6
+187,7
@@
static int build_jail_fs(void)
{
char jail_root[] = "/tmp/ujail-XXXXXX";
char tmpovdir[] = "/tmp/ujail-overlay-XXXXXX";
+ char tmpdevdir[] = "/tmp/ujail-XXXXXX/dev";
char *overlaydir = NULL;
if (mkdtemp(jail_root) == NULL) {
@@
-240,6
+241,11
@@
static int build_jail_fs(void)
return -1;
}
+ snprintf(tmpdevdir, sizeof(tmpdevdir), "%s/dev", jail_root);
+ mkdir_p(tmpdevdir, 0755);
+ if (mount(NULL, tmpdevdir, "tmpfs", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "size=1M"))
+ return -1;
+
if (mount_all(jail_root)) {
ERROR("mount_all() failed\n");
return -1;