use os.*Root instead of os to prevent filesystem traversal bugs and security leaks

This commit is contained in:
2026-05-06 22:22:41 -06:00
parent 3505f0e059
commit 2ae5ee8285
6 changed files with 45 additions and 41 deletions
+5 -1
View File
@@ -48,7 +48,11 @@ func main() {
os.Exit(1)
}
c := cache.NewCache(cfg.CacheRoot, cfg.MirrorURLs, cfg.MirroredRepos)
c, err := cache.NewCache(cfg.CacheRoot, cfg.MirrorURLs, cfg.MirroredRepos)
if err != nil {
slog.Error("failed to create cache", "err", err)
os.Exit(1)
}
srv := &Server{
cfg: cfg,
c: c,