summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-07-27 15:32:05 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-08-28 23:35:12 +0200
commit7075bc11289355478659cd1610632a9299734afc (patch)
tree3d52d094178353fa8c5aace11d8f61945324ce6b
parenta0ac380bb3fd07f61566511c4fdf18da748dcfa9 (diff)
tmpfs: drop privileges in the tmpfs translator
* tmpfs/tmpfs.c (main): Drop privileges.
-rw-r--r--tmpfs/tmpfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c
index 7da3dd58..1872a7df 100644
--- a/tmpfs/tmpfs.c
+++ b/tmpfs/tmpfs.c
@@ -29,6 +29,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <fcntl.h>
#include <hurd.h>
#include <hurd/paths.h>
+#include <nullauth.h>
char *diskfs_server_name = "tmpfs";
char *diskfs_server_version = HURD_VERSION;
@@ -437,6 +438,11 @@ main (int argc, char **argv)
/* We must keep the REALNODE send right to remain the active
translator for the underlying node. */
+ /* Drop all privileges. */
+ err = setnullauth();
+ if (err)
+ error (1, err, "Could not drop privileges");
+
pthread_mutex_unlock (&diskfs_root_node->lock);
/* and so we die, leaving others to do the real work. */