Merge pull request #792 from safing/feature/signed-updates

Add support for signed updates
This commit is contained in:
Daniel Hovie
2022-09-29 14:50:14 +02:00
committed by GitHub
18 changed files with 652 additions and 362 deletions

View File

@@ -3,7 +3,6 @@ package main
import (
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"os/user"
@@ -32,7 +31,7 @@ func checkAndCreateInstanceLock(path, name string, perUser bool) (pid int32, err
}
// read current pid file
data, err := ioutil.ReadFile(lockFilePath)
data, err := os.ReadFile(lockFilePath)
if err != nil {
if os.IsNotExist(err) {
// create new lock
@@ -93,7 +92,7 @@ func createInstanceLock(lockFilePath string) error {
// create lock file
// TODO: Investigate required permissions.
err = ioutil.WriteFile(lockFilePath, []byte(fmt.Sprintf("%d", os.Getpid())), 0o0666) //nolint:gosec
err = os.WriteFile(lockFilePath, []byte(fmt.Sprintf("%d", os.Getpid())), 0o0666) //nolint:gosec
if err != nil {
return err
}