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

nixos/davfs2: wrap {,u}mount.davfs with setuid=true #122455

Merged
merged 1 commit into from Jun 8, 2021
Merged

Conversation

ju1m
Copy link
Contributor

@ju1m ju1m commented May 10, 2021

Motivation for this change

Enabling davfs2 and setting a davfs mount point in /etc/fstab:

services.davfs2.enable = true;
fileSystems."/home/julm/mnt/example/julm" = {
  device = "https://nextcloud.example.org/remote.php/dav/files/julm/";
  fsType = "davfs";
  options =
    let conf = pkgs.writeText "davfs2.conf" ''
      backup_dir /home/julm/.backup/davfs2/example/julm
      cache_dir /home/julm/.cache/davfs2/example/julm
    ''; in
    [ "conf=${conf}" "user" "noexec" "nosuid" "noauto" ];
};

Currently leads to:

$ mount ~/mnt/example/julm
/run/current-system/sw/bin/mount.davfs: program is not setuid root

This PR makes mount.davfs and umount.davfs setuid root to make it work.
Note also that fba4c99 (mentioned in #103683) is required for umount to also work.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@flokli
Copy link
Contributor

flokli commented Jun 8, 2021

This seems reasonable, and what Debian does as well:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573241

@flokli flokli merged commit ea4e872 into NixOS:master Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants