fst/sandbox: do not create /etc in advance
This is now handled by the setup op. This also gets rid of the hardcoded /etc path. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
971c79bb80
commit
c326c3f97d
@ -245,9 +245,7 @@ func (s *SandboxConfig) ToContainer(sys SandboxSys, uid, gid *int) (*sandbox.Par
|
|||||||
if etcPath == "" {
|
if etcPath == "" {
|
||||||
etcPath = "/etc"
|
etcPath = "/etc"
|
||||||
}
|
}
|
||||||
container.
|
container.Bind(etcPath, Tmp+"/etc", 0)
|
||||||
Bind(etcPath, Tmp+"/etc", 0).
|
|
||||||
Mkdir("/etc", 0700)
|
|
||||||
|
|
||||||
// link host /etc contents to prevent dropping passwd/group bind mounts
|
// link host /etc contents to prevent dropping passwd/group bind mounts
|
||||||
if d, err := sys.ReadDir(etcPath); err != nil {
|
if d, err := sys.ReadDir(etcPath); err != nil {
|
||||||
|
@ -124,7 +124,6 @@ var testCasesNixos = []sealTestCase{
|
|||||||
Bind("/run/opengl-driver", "/run/opengl-driver", 0).
|
Bind("/run/opengl-driver", "/run/opengl-driver", 0).
|
||||||
Bind("/dev/dri", "/dev/dri", sandbox.BindDevice|sandbox.BindWritable|sandbox.BindOptional).
|
Bind("/dev/dri", "/dev/dri", sandbox.BindDevice|sandbox.BindWritable|sandbox.BindOptional).
|
||||||
Bind("/etc", fst.Tmp+"/etc", 0).
|
Bind("/etc", fst.Tmp+"/etc", 0).
|
||||||
Mkdir("/etc", 0700).
|
|
||||||
Link(fst.Tmp+"/etc/alsa", "/etc/alsa").
|
Link(fst.Tmp+"/etc/alsa", "/etc/alsa").
|
||||||
Link(fst.Tmp+"/etc/bashrc", "/etc/bashrc").
|
Link(fst.Tmp+"/etc/bashrc", "/etc/bashrc").
|
||||||
Link(fst.Tmp+"/etc/binfmt.d", "/etc/binfmt.d").
|
Link(fst.Tmp+"/etc/binfmt.d", "/etc/binfmt.d").
|
||||||
|
@ -67,7 +67,6 @@ var testCasesPd = []sealTestCase{
|
|||||||
Tmpfs("/run/user/1971", 8192, 0755).
|
Tmpfs("/run/user/1971", 8192, 0755).
|
||||||
Tmpfs("/run/dbus", 8192, 0755).
|
Tmpfs("/run/dbus", 8192, 0755).
|
||||||
Bind("/etc", fst.Tmp+"/etc", 0).
|
Bind("/etc", fst.Tmp+"/etc", 0).
|
||||||
Mkdir("/etc", 0700).
|
|
||||||
Link(fst.Tmp+"/etc/alsa", "/etc/alsa").
|
Link(fst.Tmp+"/etc/alsa", "/etc/alsa").
|
||||||
Link(fst.Tmp+"/etc/bashrc", "/etc/bashrc").
|
Link(fst.Tmp+"/etc/bashrc", "/etc/bashrc").
|
||||||
Link(fst.Tmp+"/etc/binfmt.d", "/etc/binfmt.d").
|
Link(fst.Tmp+"/etc/binfmt.d", "/etc/binfmt.d").
|
||||||
@ -288,7 +287,6 @@ var testCasesPd = []sealTestCase{
|
|||||||
Tmpfs("/run/user/1971", 8192, 0755).
|
Tmpfs("/run/user/1971", 8192, 0755).
|
||||||
Tmpfs("/run/dbus", 8192, 0755).
|
Tmpfs("/run/dbus", 8192, 0755).
|
||||||
Bind("/etc", fst.Tmp+"/etc", 0).
|
Bind("/etc", fst.Tmp+"/etc", 0).
|
||||||
Mkdir("/etc", 0700).
|
|
||||||
Link(fst.Tmp+"/etc/alsa", "/etc/alsa").
|
Link(fst.Tmp+"/etc/alsa", "/etc/alsa").
|
||||||
Link(fst.Tmp+"/etc/bashrc", "/etc/bashrc").
|
Link(fst.Tmp+"/etc/bashrc", "/etc/bashrc").
|
||||||
Link(fst.Tmp+"/etc/binfmt.d", "/etc/binfmt.d").
|
Link(fst.Tmp+"/etc/binfmt.d", "/etc/binfmt.d").
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
urandom = fs "42001b6" null null;
|
urandom = fs "42001b6" null null;
|
||||||
zero = fs "42001b6" null null;
|
zero = fs "42001b6" null null;
|
||||||
} null;
|
} null;
|
||||||
etc = fs "800001c0" {
|
etc = fs "800001ed" {
|
||||||
".clean" = fs "80001ff" null null;
|
".clean" = fs "80001ff" null null;
|
||||||
".updated" = fs "80001ff" null null;
|
".updated" = fs "80001ff" null null;
|
||||||
"NIXOS" = fs "80001ff" null null;
|
"NIXOS" = fs "80001ff" null null;
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
urandom = fs "42001b6" null null;
|
urandom = fs "42001b6" null null;
|
||||||
zero = fs "42001b6" null null;
|
zero = fs "42001b6" null null;
|
||||||
} null;
|
} null;
|
||||||
etc = fs "800001c0" {
|
etc = fs "800001ed" {
|
||||||
".clean" = fs "80001ff" null null;
|
".clean" = fs "80001ff" null null;
|
||||||
".updated" = fs "80001ff" null null;
|
".updated" = fs "80001ff" null null;
|
||||||
"NIXOS" = fs "80001ff" null null;
|
"NIXOS" = fs "80001ff" null null;
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
urandom = fs "42001b6" null null;
|
urandom = fs "42001b6" null null;
|
||||||
zero = fs "42001b6" null null;
|
zero = fs "42001b6" null null;
|
||||||
} null;
|
} null;
|
||||||
etc = fs "800001c0" {
|
etc = fs "800001ed" {
|
||||||
".clean" = fs "80001ff" null null;
|
".clean" = fs "80001ff" null null;
|
||||||
".updated" = fs "80001ff" null null;
|
".updated" = fs "80001ff" null null;
|
||||||
"NIXOS" = fs "80001ff" null null;
|
"NIXOS" = fs "80001ff" null null;
|
||||||
|
Loading…
Reference in New Issue
Block a user