fst/config: autoetc read custom path
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
1f173a469c
commit
fc26659ea1
@ -153,14 +153,14 @@ func (s *SandboxConfig) Bwrap(os linux.System) (*bwrap.Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s.AutoEtc {
|
if s.AutoEtc {
|
||||||
if s.Etc == "" {
|
etc := s.Etc
|
||||||
conf.Bind("/etc", Tmp+"/etc")
|
if etc == "" {
|
||||||
} else {
|
etc = "/etc"
|
||||||
conf.Bind(s.Etc, Tmp+"/etc")
|
|
||||||
}
|
}
|
||||||
|
conf.Bind(etc, Tmp+"/etc")
|
||||||
|
|
||||||
// link host /etc contents to prevent passwd/group from being overwritten
|
// 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
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
for _, ent := range d {
|
for _, ent := range d {
|
||||||
|
Loading…
Reference in New Issue
Block a user