sandbox: do not ensure symlink target
This masks EEXIST on target and might clobber filesystems and lead to other confusing behaviour. Create its parent instead. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
b39f3aeb59
commit
33940265a6
@ -303,10 +303,7 @@ func (l *Symlink) apply(*Params) error {
|
||||
}
|
||||
|
||||
target := toSysroot(l[1])
|
||||
if err := ensureFile(target, 0444, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Remove(target); err != nil {
|
||||
if err := os.MkdirAll(path.Dir(target), 0755); err != nil {
|
||||
return msg.WrapErr(err, err.Error())
|
||||
}
|
||||
if err := os.Symlink(l[0], target); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user