aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-25 23:03:10 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-25 23:03:10 +0000
commit984cd842482b352da2969233f134b8c8ee565b71 (patch)
treeeefed9415245aedeebc731426fa7382fe0589062 /src/util
parentada56a89ad483fd450dbcdecba7de2f2a9d4f60c (diff)
downloadgnunet-984cd842482b352da2969233f134b8c8ee565b71.tar.gz
gnunet-984cd842482b352da2969233f134b8c8ee565b71.zip
-allow binaries without SUID if we are root
Diffstat (limited to 'src/util')
-rw-r--r--src/util/os_installation.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index ee4257ca5..ddd40fc00 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -494,6 +494,12 @@ GNUNET_OS_check_helper_binary (const char *binary)
494 GNUNET_free (p); 494 GNUNET_free (p);
495 return GNUNET_SYSERR; 495 return GNUNET_SYSERR;
496 } 496 }
497 if (0 == getuid ())
498 {
499 /* as we run as root, we don't insist on SUID */
500 GNUNET_free (p);
501 return GNUNET_OK;
502 }
497 if (0 != STAT (p, &statbuf)) 503 if (0 != STAT (p, &statbuf))
498 { 504 {
499 LOG (GNUNET_ERROR_TYPE_WARNING, _("stat (%s) failed: %s\n"), p, 505 LOG (GNUNET_ERROR_TYPE_WARNING, _("stat (%s) failed: %s\n"), p,
@@ -507,8 +513,9 @@ GNUNET_OS_check_helper_binary (const char *binary)
507 GNUNET_free (p); 513 GNUNET_free (p);
508 return GNUNET_YES; 514 return GNUNET_YES;
509 } 515 }
516 /* binary exists, but not SUID */
510 GNUNET_free (p); 517 GNUNET_free (p);
511 return GNUNET_SYSERR; 518 return GNUNET_NO;
512#else 519#else
513 GNUNET_free (p); 520 GNUNET_free (p);
514 rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP); 521 rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);