[1215] in Kerberos-V5-bugs
krb5b4pl3: appl/bsd/krcp.c: use setreuid() properly if we define it
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Mon Mar 20 13:41:03 1995
From: "Jonathan I. Kamens" <jik@cam.ov.com>
Date: Mon, 20 Mar 1995 13:44:07 -0500
To: krb5-bugs@MIT.EDU
appl/bsd/krcp.c defines a setreuid() macro based on setresuid(), for
systems that have the latter but not the former. However, the
subsequent code that uses setreuid() only gets used if HAS_SETREUID is
defined; it should in fact be used if HAS_SETREUID or setreuid is
defined.
(Without this patch, krcp won't compile on HP-UX 9.01; with this
patch, it will.)
--- krcp.c 1995/03/13 00:10:31 1.3
+++ krcp.c 1995/03/20 18:41:05
@@ -448,7 +448,7 @@
if (encryptflag)
send_auth();
}
-#ifdef HAVE_SETREUID
+#if defined(HAVE_SETREUID) || defined(setreuid)
(void) setreuid(0, userid);
sink(1, argv+argc-1);
(void) setreuid(userid, 0);
@@ -467,7 +467,7 @@
buf, 0);
if (rem < 0)
continue;
-#ifdef HAVE_SETREUID
+#if defined(HAVE_SETREUID) || defined(setreuid)
(void) setreuid(0, userid);
sink(1, argv+argc-1);
(void) setreuid(userid, 0);