Extensive modifications to handle netgroups. Also sanitise user and group
[become] / src / daemon.c
index 3f1fa93..d2bf8df 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: daemon.c,v 1.2 1997/08/04 10:24:21 mdw Exp $
+ * $Id: daemon.c,v 1.3 1997/08/07 09:49:39 mdw Exp $
  *
  * Running a `become' daemon
  *
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: daemon.c,v $
+ * Revision 1.3  1997/08/07 09:49:39  mdw
+ * Extensive modifications to handle netgroups.  Also sanitise user and group
+ * names before adding them to the symbol table.
+ *
  * Revision 1.2  1997/08/04 10:24:21  mdw
  * Sources placed under CVS control.
  *
@@ -71,6 +75,7 @@
 #include "idea.h"
 #include "lexer.h"
 #include "name.h"
+#include "netg.h"
 #include "parser.h"
 #include "rule.h"
 #include "tx.h"
@@ -79,7 +84,7 @@
 
 /*----- Arbitrary constants -----------------------------------------------*/
 
-#define daemon__awakeEvery (5 * 60)    /* Awaken this often to rescan */
+#define daemon__awakeEvery (30 * 60)   /* Awaken this often to rescan */
 
 /*----- Static variables --------------------------------------------------*/
 
@@ -286,7 +291,7 @@ void daemon_init(const char *cf, int port)
    * user wants me to start on a funny port.
    */
 
-  seteuid(getuid());
+  setuid(getuid());
 
   /* --- Initialise bits of the program --- */
 
@@ -295,6 +300,7 @@ void daemon_init(const char *cf, int port)
   userdb_init();
   userdb_local();
   userdb_yp();
+  netg_init();
   name_init();
   rule_init();
   openlog(quis(), 0, LOG_DAEMON);
@@ -423,6 +429,7 @@ void daemon_init(const char *cf, int port)
        userdb_reinit();
        userdb_local();
        userdb_yp();
+       netg_reinit();
        rule_reinit();
        name_reinit();
        if (daemon__readConfig(cf))