chiark / gitweb /
Cosmetic change: use sizeof(destination) in memcpy.
[become] / src / become.c
index 67eec160860e857a0b23734712f76288f2bfbe50..c5df906e2e52d208bdf31f6a600d27266a1a78a7 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-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.
@@ -952,7 +958,7 @@ done_options:
     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 --- */
@@ -1521,6 +1527,7 @@ done_options:
   /* --- Finally, call the program --- */
 
   fflush(0);
+  closelog();
   execve(rq.cmd, todo, env);
   die("couldn't exec `%s': %s", rq.cmd, strerror(errno));
   return (127);