Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix parser for symlinks
  • Loading branch information
LordRalex committed Jun 27, 2022
1 parent 6470486 commit 3e8417e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion files.go
Expand Up @@ -43,7 +43,7 @@ func EnsureAccess(source string, prefix string) bool {
if err != nil && !os.IsNotExist(err) {
return false
}
replacement, err = filepath.Abs(source)
replacement, err = filepath.Abs(replacement)
if err != nil {
return false
}
Expand Down
8 changes: 7 additions & 1 deletion groups_linux.go
Expand Up @@ -14,6 +14,7 @@
package pufferpanel

import (
"fmt"
"os/user"
)

Expand All @@ -23,18 +24,23 @@ func UserInGroup(groups ...string) bool {

u, err := user.Current()
if err != nil {
fmt.Println(err.Error())
return false
}

allowedIds := make([]string, 0)
for _, v := range groups {
if rootGroup, err := user.LookupGroup(v); err == nil {
rootGroup, err := user.LookupGroup(v)
if err != nil {
fmt.Println(err.Error())
} else {
allowedIds = append(allowedIds, rootGroup.Gid)
}
}

g, err := u.GroupIds()
if err != nil {
fmt.Println(err.Error())
return false
}

Expand Down

0 comments on commit 3e8417e

Please sign in to comment.