Imported Upstream version 3.1.0
[debian/amanda] / common-src / krb5-security.c
index dcf778e6567df9d2e062cfa866d37668675d9663..8a11ad675ad0afc8821ac02a432b01eae4e052b7 100644 (file)
 #include "util.h"
 #include "event.h"
 #include "packet.h"
-#include "queue.h"
 #include "security.h"
 #include "security-util.h"
 #include "stream.h"
-#include "version.h"
 #include "sockaddr-util.h"
 
 #ifdef KRB5_HEIMDAL_INCLUDES
@@ -551,7 +549,6 @@ gss_server(
     gss_name_t gss_name;
     gss_cred_id_t gss_creds;
     char *p, *realm, *msg;
-    uid_t euid;
     int rval = -1;
     int rvalue;
     char errbuf[256];
@@ -566,16 +563,9 @@ gss_server(
      * out of the default keytab.  We also need to be root in
      * gss_accept_context() thanks to the replay cache code.
      */
-    euid = geteuid();
-    if (getuid() != 0) {
-       g_snprintf(errbuf, SIZEOF(errbuf),
-           _("real uid is %ld, needs to be 0 to read krb5 host key"),
-           (long)getuid());
-       goto out;
-    }
     if (!set_root_privs(0)) {
        g_snprintf(errbuf, SIZEOF(errbuf),
-           _("can't seteuid to uid 0: %s"), strerror(errno));
+           _("can't take root privileges to read krb5 host key: %s"), strerror(errno));
        goto out;
     }