mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-24 19:52:56 +03:00
Handle os.chmod errors
This commit is contained in:
parent
2c60429724
commit
0de0edafb8
3 changed files with 59 additions and 16 deletions
10
util/util.go
10
util/util.go
|
@ -4,8 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/ngoduykhanh/wireguard-ui/store"
|
||||
"golang.org/x/mod/sumdb/dirhash"
|
||||
"io"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
|
@ -19,6 +17,9 @@ import (
|
|||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/ngoduykhanh/wireguard-ui/store"
|
||||
"golang.org/x/mod/sumdb/dirhash"
|
||||
|
||||
externalip "github.com/glendc/go-external-ip"
|
||||
"github.com/labstack/gommon/log"
|
||||
"github.com/ngoduykhanh/wireguard-ui/model"
|
||||
|
@ -540,3 +541,8 @@ func RandomString(length int) string {
|
|||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func ManagePerms(path string) error {
|
||||
err := os.Chmod(path, 0600)
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue