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

Bad permissions on /tmp in disk images we build #28055

Closed
copumpkin opened this issue Aug 9, 2017 · 4 comments
Closed

Bad permissions on /tmp in disk images we build #28055

copumpkin opened this issue Aug 9, 2017 · 4 comments
Labels
0.kind: regression Something that worked before working no longer 6.topic: nixos

Comments

@copumpkin
Copy link
Member

copumpkin commented Aug 9, 2017

Say I build an image on master (b48ffa3) with the following configuration:

{ pkgs, lib, modulesPath, config, ... }:

{
  imports = [ "${modulesPath}/profiles/minimal.nix" ];
  environment.systemPackages = lib.mkForce [];

  fileSystems."/" = {
    device     = "/dev/disk/by-label/nixos";
    autoResize = true;
  };

  boot.loader.grub.device = "/dev/sda";

  system.build.image = import "${pkgs.path}/nixos/lib/make-disk-image.nix" {
    name = "test";
    inherit pkgs lib config;
    partitioned = true;
    diskSize = 1024;   
  };
}

And build it as follows:

$ nix-build $PATH_TO_NIXPKGS/nixos -A config.system.build.image --argstr configuration $PWD/configuration.nix

The /tmp on that image will have permissions as follows:

drwxr-xr-t  3 root root  4096 Aug  9 02:27 tmp

(instead of 0777)

This may well be my fault from all the image reshuffling stuff I did. I'll look into it and fix before 17.09, unless someone else gets to it before I do.

Might also be related to #22413

@copumpkin copumpkin added 0.kind: regression Something that worked before working no longer 6.topic: nixos labels Aug 9, 2017
@copumpkin
Copy link
Member Author

Looks like the culprit is cptofs in LKL. I opened an issue there (lkl/linux#364) and will see what they say, or fix it myself if nobody bites.

@dezgeg
Copy link
Contributor

dezgeg commented Aug 9, 2017

nixos/modules/system/boot/stage-2-init.sh already attempts to correct the situation:

mkdir -m 01777 -p /tmp

among other stuff. But IIRC mkdir doesn't change the permissions if the directory already exists (sigh).

@copumpkin
Copy link
Member Author

Makes sense. LKL just merged the upstream fix so I'll just bump that package and this should be fixed.

@copumpkin
Copy link
Member Author

See ed55bdb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer 6.topic: nixos
Projects
None yet
Development

No branches or pull requests

2 participants