mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
test(compat): harden fixture containment cleanup
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
1 parent
92a1cc76be
commit
be9af6fcb3
4 files changed
+91
No files matched your search
@@ -70,6 +70,11 @@ func (root AgentRoot) newPath(relative string, destructive bool) (AgentPath, err
|
||||
if err := ensureRealParentDirectories(root.absolute, nativeRelative); err != nil {
|
||||
return AgentPath{}, err
|
||||
}
|
||||
if info, err := os.Lstat(absolute); err == nil && info.Mode()&os.ModeSymlink != 0 {
|
||||
return AgentPath{}, rejectPath(PathRejectionSymlinkFinal)
|
||||
} else if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return AgentPath{}, fmt.Errorf("inspect agent fixture path: %w", err)
|
||||
}
|
||||
return AgentPath{absolute: absolute, relative: nativeRelative}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user