]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
fix libs and flags
[ppp.git] / pppd / main.c
index d5dd4767f4b00d3fa3eaae4c085b135ee4e11f31..e4624209e5155ef57083639270428be0d32c96e3 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.37 1996/09/26 06:21:59 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.39 1996/10/08 06:43:49 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -52,6 +52,10 @@ static char rcsid[] = "$Id: main.c,v 1.37 1996/09/26 06:21:59 paulus Exp $";
 #include "pathnames.h"
 #include "patchlevel.h"
 
+#ifdef CBCP_SUPPORT
+#include "cbcp.h"
+#endif
+
 #if defined(SUNOS4)
 extern char *strerror();
 #endif
@@ -133,6 +137,9 @@ struct protent *protocols[] = {
     &lcp_protent,
     &pap_protent,
     &chap_protent,
+#ifdef CBCP_SUPPORT
+    &cbcp_protent,
+#endif
     &ipcp_protent,
     &ccp_protent,
 #ifdef IPX_CHANGE
@@ -171,7 +178,7 @@ main(argc, argv)
 #endif
 
     if (gethostname(hostname, MAXNAMELEN) < 0 ) {
-       syslog(LOG_ERR, "couldn't get hostname: %m");
+       option_error("Couldn't get hostname: %m");
        die(1);
     }
     hostname[MAXNAMELEN-1] = 0;
@@ -202,6 +209,15 @@ main(argc, argv)
        exit(1);
     }
 
+    /*
+     * Check that we are running as root.
+     */
+    if (geteuid() != 0) {
+       option_error("must be root to run %s, since it is not setuid-root",
+                    argv[0]);
+       die(1);
+    }
+
     /*
      * Check that the options given are valid and consistent.
      */