summaryrefslogtreecommitdiff
path: root/trans/null.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-07-27 15:32:04 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-08-28 23:35:02 +0200
commita0ac380bb3fd07f61566511c4fdf18da748dcfa9 (patch)
tree2a9bc78d74cb9f76ce15777d33b3d2fdb50d0165 /trans/null.c
parent4c28f07bf1fbfbcee9dcd47e8ee124567c40f5e5 (diff)
trans: drop privileges in the null translator
* trans/null.c (main): Drop privileges.
Diffstat (limited to 'trans/null.c')
-rw-r--r--trans/null.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/trans/null.c b/trans/null.c
index 1f985b39..8b3b4e0f 100644
--- a/trans/null.c
+++ b/trans/null.c
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <limits.h>
#include <argp.h>
+#include <nullauth.h>
const char *argp_program_version = STANDARD_HURD_VERSION (null);
@@ -78,6 +79,10 @@ main (int argc, char **argv)
if (err)
error(3, err, "Contacting parent");
+ err = setnullauth ();
+ if (err)
+ error(4, err, "Dropping privileges");
+
/* Launch. */
ports_manage_port_operations_multithread (fsys->pi.bucket, trivfs_demuxer,
2 * 60 * 1000, 0, 0);