Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too eager permission check #144

Open
blaggacao opened this issue Jul 26, 2024 · 1 comment
Open

Too eager permission check #144

blaggacao opened this issue Jul 26, 2024 · 1 comment

Comments

@blaggacao
Copy link
Contributor

blaggacao commented Jul 26, 2024

if current.options != nil && !reflect.DeepEqual(current.options.Perms, options.Perms) {
return fmt.Errorf("The file '%s' already exists in the tar with perms %#v but is overridden with perms %#v",
dstPath, current.options.Perms, options.Perms)
}

This function implement a way too eager check on this unit:

layers.json> The file '/bin' already exists in the tar with perms []types.Perm(nil) but is overriden with perms []types.Perm{
  types.Perm{
    Regex:"/home/nobody",
    Mode:"0744",
    Uid:65534,
    Gid:65534,
    Uname:"nobody",
    Gname:"nogroup"
  },
  types.Perm{
    Regex:"/var/lib/frappix/(sites|config).*",
    Mode:"0777",
    Uid:65534,
    Gid:65534,
    Uname:"nobody",
    Gname:"nobody"
  }}

How to produce this unit?

  • coypToRoot = [ pkgs.coreutils ]; (has /bin)
  • root = buildEnv { ... }; with another thing that has /bin, while also using root in perms = [{path = root; regex = "/var/lib/frappix/(sites|config).*"; ... }];
  • coypToRoot += [ root ];
@whs-dot-hk
Copy link

Hit similar error today, any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants