summaryrefslogtreecommitdiff
path: root/debian/patches/0001-trans-mtab-use-setnullauth-to-drop-privileges.patch
blob: eed98135875899424f2aa8dbc91966ce5c0a2ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 6fd075df8f71c95cff04d58643e5da0d58dbbada Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Sun, 31 Aug 2014 12:46:25 +0200
Subject: [PATCH 1/3] trans/mtab: use setnullauth to drop privileges

* trans/mtab.c (main): Use setnullauth to drop privileges.
---
 trans/mtab.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/trans/mtab.c b/trans/mtab.c
index df03b1d..5207c1e 100644
--- a/trans/mtab.c
+++ b/trans/mtab.c
@@ -27,6 +27,7 @@
 #include <hurd/trivfs.h>
 #include <inttypes.h>
 #include <mntent.h>
+#include <nullauth.h>
 #include <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -221,19 +222,7 @@ main (int argc, char *argv[])
   if (bootstrap != MACH_PORT_NULL)
     {
       /* Started as a translator.  */
-
-      auth_t nullauth;
-      err = auth_makeauth (getauth (),
-			   NULL, MACH_MSG_TYPE_COPY_SEND, 0,
-			   NULL, 0,
-			   NULL, 0,
-			   NULL, 0,
-			   NULL, 0,
-			   &nullauth);
-      if (err)
-        error (3, err, "dropping credentials");
-
-      err = setauth (nullauth);
+      err = setnullauth ();
       if (err)
         error (3, err, "dropping credentials");
 
-- 
2.1.0