From e81ae3f79451a0afa06fb7c9cb3d0f951c4459b5 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Thu, 21 Dec 2023 12:56:48 +0100 Subject: [PATCH] Fix selinux policy permissions in setup --- cmd/setup_linux.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/setup_linux.go b/cmd/setup_linux.go index ed7f3cb..8d486e6 100644 --- a/cmd/setup_linux.go +++ b/cmd/setup_linux.go @@ -39,6 +39,16 @@ func setupPolkit() { panic(err) } + command3 := exec.Command("sudo", "chcon", "system_u:object_r:usr_t:s0", "/usr/share/polkit-1/actions/com.quexten.goldwarden.policy") + err = command3.Run() + if err != nil { + fmt.Println("failed setting selinux context") + fmt.Println(err.Error()) + } else { + fmt.Println("Set selinux context successfully") + fmt.Println("Might require a reboot to take effect!") + } + fmt.Println("Polkit setup successfully") }