diff -urNp -x '*.orig' amanda-3.5.1.org/amandad-src/amandad.c amanda-3.5.1/amandad-src/amandad.c --- amanda-3.5.1.org/amandad-src/amandad.c 2017-12-01 14:26:32.000000000 +0100 +++ amanda-3.5.1/amandad-src/amandad.c 2021-05-08 10:23:15.193461026 +0200 @@ -476,6 +476,11 @@ main( exit_on_qlength = 1; } + /* krb5 require the euid to be 0 */ + if (strcasecmp(auth, "krb5") == 0) { + if(seteuid((uid_t)0) != 0) { error("Can't set euid to 0"); }; + } + #ifndef SINGLE_USERID if (getuid() == 0) { if (strcasecmp(auth, "krb5") != 0) { @@ -510,11 +515,6 @@ main( dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n")); } - /* krb5 require the euid to be 0 */ - if (strcasecmp(auth, "krb5") == 0) { - if(seteuid((uid_t)0) != 0) { error("Can't set euid to 0"); }; - } - /* * Schedule to call protocol_accept() when new security handles * are created on stdin.