X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Ffixperms.go;h=57c081171ed3b71b9ce2937e309874e7ca5d3000;hb=b93e20c0f845841143e13ca421f1c9d4b79304b7;hp=47e4fb96484db645402ad9cbdb60676e04a041bc;hpb=713cde4bd701dd53ed46d01f43c9e9e7b82dc514;p=safcm%2Fsafcm.git 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 }