/* -*-c-*-
*
- * $Id: become.c,v 1.16 1998/04/23 13:21:04 mdw Exp $
+ * $Id: become.c,v 1.18 1998/06/26 10:32:54 mdw Exp $
*
* Main code for `become'
*
/*----- Revision history --------------------------------------------------*
*
* $Log: become.c,v $
+ * Revision 1.18 1998/06/26 10:32:54 mdw
+ * Cosmetic change: use sizeof(destination) in memcpy.
+ *
+ * Revision 1.17 1998/06/18 15:06:59 mdw
+ * Close log before execing program to avoid leaving a socket open.
+ *
* Revision 1.16 1998/04/23 13:21:04 mdw
* Small tweaks. Support no-network configuration option, and rearrange
* the help text a little.
uname(&u);
if ((he = gethostbyname(u.nodename)) == 0)
die("who am I? (can't resolve `%s')", u.nodename);
- memcpy(&rq.host, he->h_addr, sizeof(struct in_addr));
+ memcpy(&rq.host, he->h_addr, sizeof(rq.host));
}
/* --- Fiddle with group ownerships a bit --- */
/* --- Finally, call the program --- */
fflush(0);
+ closelog();
execve(rq.cmd, todo, env);
die("couldn't exec `%s': %s", rq.cmd, strerror(errno));
return (127);