aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst/config.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2024-12-27 18:57:44 +0900
committerOphestra <cat@gensokyo.uk>2024-12-27 18:57:44 +0900
commitfc26659ea11fea8f41fc2551d6d39d30fe3a49e7 (patch)
tree9b9e1d1b507d0c85ae775b3b7376f2c4062efee9 /fst/config.go
parent1f173a469c8f16e9cf890a5f0d88bd61440f96f2 (diff)
fst/config: autoetc read custom path
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'fst/config.go')
-rw-r--r--fst/config.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/fst/config.go b/fst/config.go
index 73809a86..19e17660 100644
--- a/fst/config.go
+++ b/fst/config.go
@@ -153,14 +153,14 @@ func (s *SandboxConfig) Bwrap(os linux.System) (*bwrap.Config, error) {
}
if s.AutoEtc {
- if s.Etc == "" {
- conf.Bind("/etc", Tmp+"/etc")
- } else {
- conf.Bind(s.Etc, Tmp+"/etc")
+ etc := s.Etc
+ if etc == "" {
+ etc = "/etc"
}
+ conf.Bind(etc, Tmp+"/etc")
// link host /etc contents to prevent passwd/group from being overwritten
- if d, err := os.ReadDir("/etc"); err != nil {
+ if d, err := os.ReadDir(etc); err != nil {
return nil, err
} else {
for _, ent := range d {