fix: gpg encrypted key not detected correctly
This commit is contained in:
parent
0f558b3314
commit
668627c467
2 changed files with 6 additions and 10 deletions
|
|
@ -75,10 +75,10 @@ func (d *Dataset) loadPermissions() error {
|
|||
return errors.WrapPrefix(err, fmt.Sprintf("cannot obtain permission list for zfs dataset %s", d.Name), 0)
|
||||
}
|
||||
pattern := regexp.MustCompile(`^\s*user ` + currentUser.Username + ` ([\w-]+(,[\w-]+)*)$`)
|
||||
script.Echo(string(output)).FilterLine(func(line string) string {
|
||||
_ = script.Echo(string(output)).FilterLine(func(line string) string {
|
||||
match := pattern.FindStringSubmatch(line)
|
||||
if match != nil {
|
||||
for _, perm := range strings.Split(match[1], ",") {
|
||||
for perm := range strings.SplitSeq(match[1], ",") {
|
||||
switch perm {
|
||||
case "mount":
|
||||
permissions.Mount = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue