From a507f61c7c9a5947ea046805b51e12b6f3ca5197 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 17 Aug 2022 15:30:21 +0800 Subject: [PATCH] fix bug --- smx509/root_unix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smx509/root_unix.go b/smx509/root_unix.go index 797a462..b31fb5f 100644 --- a/smx509/root_unix.go +++ b/smx509/root_unix.go @@ -78,9 +78,9 @@ func loadSystemRoots() (*CertPool, error) { return nil, firstErr } -// readUniqueDirectoryEntries is like ioutil.ReadDir but omits +// readUniqueDirectoryEntries is like os.ReadDir but omits // symlinks that point within the directory. -func readUniqueDirectoryEntries(dir string) ([]os.FileInfo, error) { +func readUniqueDirectoryEntries(dir string) ([]fs.DirEntry, error) { files, err := os.ReadDir(dir) if err != nil { return nil, err @@ -94,6 +94,7 @@ func readUniqueDirectoryEntries(dir string) ([]os.FileInfo, error) { return uniq, nil } + // isSameDirSymlink reports whether fi in dir is a symlink with a // target not containing a slash. func isSameDirSymlink(f fs.DirEntry, dir string) bool {