From 876404086ff52e926bc5a9bbe73452a265f36693 Mon Sep 17 00:00:00 2001 From: Simon Bengtsson Date: Mon, 7 Oct 2024 13:55:28 +0200 Subject: [PATCH] Fixed HasZFSCommand exec logic --- zfs/ZfsExecutor.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zfs/ZfsExecutor.go b/zfs/ZfsExecutor.go index 72672be..db72b3f 100644 --- a/zfs/ZfsExecutor.go +++ b/zfs/ZfsExecutor.go @@ -1,7 +1,6 @@ package zfs import ( - "errors" "fmt" "os" "os/exec" @@ -33,9 +32,9 @@ func (z *executorImpl) HasZFSCommand() error { if stat, err := os.Stat(z.zfsCommandName); err == nil { // Is executable by others if stat.Mode()&0001 != 0 { - return errors.New("ZFS command is not executable") + return nil } - return nil + return fmt.Errorf("ZFS command %s is not executable", z.zfsCommandName) } return fmt.Errorf("ZFS command %s not found", z.zfsCommandName) }