summary refs log tree commit diff
path: root/pkgs/tools/networking/openssh/dont_create_privsep_path.patch
diff options
context:
space:
mode:
authorRickard Nilsson <rickynils@gmail.com>2016-07-16 10:08:29 +0200
committerRickard Nilsson <rickynils@gmail.com>2016-07-16 10:15:58 +0200
commit4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605 (patch)
tree4fa9ab4925d28bd8689a3edae2e516a5279f6316 /pkgs/tools/networking/openssh/dont_create_privsep_path.patch
parent3a8067e6ded9cb0a1a7931141821ed5ee6502e64 (diff)
downloadnixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.tar
nixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.tar.gz
nixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.tar.bz2
nixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.tar.lz
nixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.tar.xz
nixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.tar.zst
nixpkgs-4f8f1c30cbfb3e5e346a7ad1a699d3c8b3a46605.zip
openssh: Use the default privilege separation dir (/var/empty)
(This is a rewritten version of the reverted commit
a927709a35cee56f878f0f57a932e1a6e2ebe23b, that disables the creation of
/var/empty during build so that sandboxed builds also works. For more
context, see https://github.com/NixOS/nixpkgs/pull/16966)

If running NixOS inside a container where the host's root-owned files
and directories have been mapped to some other uid (like nobody), the
ssh daemon fails to start, producing this error message:

fatal: /nix/store/...-openssh-7.2p2/empty must be owned by root and not group or world-writable.

The reason for this is that when openssh is built, we explicitly set
`--with-privsep-path=$out/empty`. This commit removes that flag which
causes the default directory /var/empty to be used instead. Since NixOS'
activation script correctly sets up that directory, the ssh daemon now
also works within containers that have a non-root-owned nix store.
Diffstat (limited to 'pkgs/tools/networking/openssh/dont_create_privsep_path.patch')
-rw-r--r--pkgs/tools/networking/openssh/dont_create_privsep_path.patch11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/tools/networking/openssh/dont_create_privsep_path.patch b/pkgs/tools/networking/openssh/dont_create_privsep_path.patch
new file mode 100644
index 00000000000..b6d432d5c5d
--- /dev/null
+++ b/pkgs/tools/networking/openssh/dont_create_privsep_path.patch
@@ -0,0 +1,11 @@
+diff -ur openssh-7.2p2_orig/Makefile.in openssh-7.2p2/Makefile.in
+--- openssh-7.2p2_orig/Makefile.in	2016-03-09 19:04:48.000000000 +0100
++++ openssh-7.2p2/Makefile.in	2016-07-16 09:56:05.643903293 +0200
+@@ -301,7 +301,6 @@
+ 	$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5
+ 	$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8
+ 	$(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir)
+-	(umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH))
+ 	$(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT)
+ 	$(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT)
+ 	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT)