helper/bwrap: format mode in octal

Bubblewrap expects an octal representation of mode.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-10-14 13:47:50 +09:00
parent aaed5080f4
commit a0db19b9ad
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 2 additions and 2 deletions

View File

@ -259,7 +259,7 @@ func (p PermConfig[T]) Value(arg string) (args []string) {
// max possible size // max possible size
if p.Mode != nil { if p.Mode != nil {
args = make([]string, 0, 6) args = make([]string, 0, 6)
args = append(args, "--perms", strconv.Itoa(int(*p.Mode))) args = append(args, "--perms", strconv.FormatInt(int64(*p.Mode), 8))
} else { } else {
args = make([]string, 0, 4) args = make([]string, 0, 4)
} }

View File

@ -47,7 +47,7 @@ func (c *Config) pairArgs() (n [pairC][][2]string) {
n[Chmod] = make([][2]string, 0, len(c.Chmod)) n[Chmod] = make([][2]string, 0, len(c.Chmod))
for path, octal := range c.Chmod { for path, octal := range c.Chmod {
n[Chmod] = append(n[Chmod], [2]string{strconv.Itoa(int(octal)), path}) n[Chmod] = append(n[Chmod], [2]string{strconv.FormatInt(int64(octal), 8), path})
} }
return return