/*
This file is part of GNUnet.
- Copyright (C) 2010, 2011, 2012 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010, 2011, 2012 GNUnet e.V.
Copyright (c) 2007, 2008, Andy Green <andy@warmcat.com>
Copyright Copyright (C) 2009 Thomas d'Otreppe
int stdin_open;
struct MessageStreamTokenizer *stdin_mst;
int raw_eno;
- uid_t uid;
/* assert privs so we can modify the firewall rules! */
- uid = getuid ();
-#ifdef HAVE_SETRESUID
- if (0 != setresuid (uid, 0, 0))
{
- fprintf (stderr, "Failed to setresuid to root: %s\n", strerror (errno));
- return 254;
- }
+#ifdef HAVE_SETRESUID
+ uid_t uid = getuid ();
+
+ if (0 != setresuid (uid, 0, 0))
+ {
+ fprintf (stderr,
+ "Failed to setresuid to root: %s\n",
+ strerror (errno));
+ return 254;
+ }
#else
- if (0 != seteuid (0))
- {
- fprintf (stderr, "Failed to seteuid back to root: %s\n", strerror (errno));
- return 254;
- }
+ if (0 != seteuid (0))
+ {
+ fprintf (stderr,
+ "Failed to seteuid back to root: %s\n", strerror (errno));
+ return 254;
+ }
#endif
+ }
/* make use of SGID capabilities on POSIX */
memset (&dev, 0, sizeof (dev));