about summary refs log tree commit diff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-08-20T15·22+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-08-20T15·22+0000
commite77fbe0fa2f7c2cfaee734dba049f0d8dd3dae15 (patch)
tree614c425a989b33c357387c04155e613db47b7f4a /src/Makefile.am
parent2d35116c13e0c11210cb712f9ce6e8a38058f350 (diff)
* On systems that have the setresuid() and setresgid() system calls to
  set the real uid and gid to the effective uid and gid, the Nix
  binaries can be installed as owned by the Nix user and group instead
  of root, so no root involvement of any kind is necessary.

  Linux and FreeBSD have these functions.

Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 6c3e5ee209ae..5637382172a2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,5 +4,10 @@ SUBDIRS = bin2c boost libutil libstore libmain nix-store nix-hash \
 SETUID_PROGS = nix-store nix-instantiate nix-env
 install-exec-hook:
 if SETUID_HACK
+if HAVE_SETRESUID
+	cd $(DESTDIR)$(bindir) && chown @NIX_USER@ $(SETUID_PROGS) \
+	  && chgrp @NIX_GROUP@ $(SETUID_PROGS) && chmod ug+s $(SETUID_PROGS)
+else
 	cd $(DESTDIR)$(bindir) && chown root $(SETUID_PROGS) && chmod u+s $(SETUID_PROGS)
 endif
+endif