From b93e20c0f845841143e13ca421f1c9d4b79304b7 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 4 Apr 2021 10:40:13 +0200 Subject: [PATCH] fixperms: use safcm-remote.sync's OpenFileNoFollow() --- cmd/safcm/fixperms.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/safcm/fixperms.go b/cmd/safcm/fixperms.go index 47e4fb9..57c0811 100644 --- a/cmd/safcm/fixperms.go +++ b/cmd/safcm/fixperms.go @@ -23,8 +23,8 @@ import ( "log" "os" "path/filepath" - "syscall" + "ruderich.org/simon/safcm/cmd/safcm-remote/sync" "ruderich.org/simon/safcm/cmd/safcm/config" ) @@ -101,8 +101,7 @@ func fixpermsWalkDirFunc(path string, d fs.DirEntry, err error) error { // chmodNoFollow works like os.Chmod but doesn't follow symlinks. func chmodNoFollow(path string, mode fs.FileMode) error { - x, err := os.OpenFile(path, - os.O_RDONLY|syscall.O_NOFOLLOW|syscall.O_NONBLOCK, 0) + x, err := sync.OpenFileNoFollow(path) if err != nil { return err } -- 2.45.2