nlewo/nix2container

Too eager permission check

blaggacao opened this issue · 1 comments

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 ];

Hit similar error today, any workaround?