diff -r -u pptpd-1.0.1.orig/defaults.h pptpd-1.0.1.syspath/defaults.h --- pptpd-1.0.1.orig/defaults.h Mon Jul 31 18:28:52 2000 +++ pptpd-1.0.1.syspath/defaults.h Tue Jul 3 15:33:10 2001 @@ -58,5 +58,6 @@ #define IPXNETS_KEYWORD "ipxnets" #define LISTEN_KEYWORD "listen" #define PIDFILE_KEYWORD "pidfile" +#define SYSPATH_KEYWORD "syspath" #endif /* !_PPTPD_DEFAULTS_H */ diff -r -u pptpd-1.0.1.orig/pptpctrl.c pptpd-1.0.1.syspath/pptpctrl.c --- pptpd-1.0.1.orig/pptpctrl.c Sun Sep 24 18:29:23 2000 +++ pptpd-1.0.1.syspath/pptpctrl.c Tue Jul 3 15:24:35 2001 @@ -54,6 +54,8 @@ /* Globals because i'm lazy -tmk */ static char speed[32]; static char pppdxfig[256]; +/* path to custom config */ +static char syspath[256]; /* * Global to handle dying @@ -130,6 +132,8 @@ GETARG(pppLocal); GETARG(pppRemote); GETARG(ipx); + *syspath=0; + GETARG(syspath); if (pptpctrl_debug) { if (*pppLocal) @@ -140,6 +144,7 @@ syslog(LOG_DEBUG, "CTRL: pppd speed = %s", speed); if (*pppdxfig) syslog(LOG_DEBUG, "CTRL: pppd options file = %s", pppdxfig); + syslog(LOG_DEBUG,"CTRL: pppd syspath = %s",*syspath==0 ? "(default)" : syspath ); } addrlen = sizeof(addr); @@ -687,8 +692,20 @@ } #endif + if(*syspath) { + pppd_argv[an++] = "syspath"; + pppd_argv[an++] = syspath; + } + /* argv arrays must always be NULL terminated */ pppd_argv[an] = NULL; + + { + int i; + for(i=0;pppd_argv[i]!=NULL;i++) { + syslog(LOG_DEBUG,"CTRL: pppd_argv[%d] = %s",i,pppd_argv[i]); + } + } execvp(pppd_argv[0], pppd_argv); /* execvp() failed */ syslog(LOG_ERR, "CTRL (PPPD Launcher): Failed to launch PPP daemon."); diff -r -u pptpd-1.0.1.orig/pptpd.c pptpd-1.0.1.syspath/pptpd.c --- pptpd-1.0.1.orig/pptpd.c Mon Jul 31 18:28:52 2000 +++ pptpd-1.0.1.syspath/pptpd.c Tue Jul 3 15:35:27 2001 @@ -51,6 +51,7 @@ /* command line arg variables */ char *pppdoptstr = NULL; +char *ppp_syspath = NULL; char *speedstr = NULL; char *bindaddr = NULL; int pptp_debug = 0; @@ -95,6 +96,7 @@ printf(" [-s] [--speed baud] Specifies the baud speed for the PPP daemon\n"); printf(" (default is 115200).\n"); #endif + printf(" [-S] [--syspath path] Specify syspath for pppd.\n"); printf(" [-v] [--version] Displays the PoPToP version number.\n"); printf("\n\nLogs and debugging go to syslog as DAEMON."); @@ -140,11 +142,12 @@ {"option", 1, 0, 0}, {"pidfile", 1, 0, 0}, {"speed", 1, 0, 0}, + {"syspath", 1, 0, 0}, {"version", 0, 0, 0}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "c:dfhl:o:p:s:v", long_options, &option_index); + c = getopt_long(argc, argv, "c:dfhl:o:p:s:S:v", long_options, &option_index); if (c == -1) break; /* convert long options to short form */ @@ -206,6 +209,10 @@ speedstr = strdup(optarg); break; + case 'S': + if(ppp_syspath!=NULL) free(ppp_syspath); + ppp_syspath=strdup(optarg); + case 'c': { FILE *f; @@ -259,6 +266,10 @@ } pppdoptstr = strdup(tmp); } + + if (!ppp_syspath && read_config_file(configFile, SYSPATH_KEYWORD, tmp) > 0) + ppp_syspath = strdup(tmp); + if (!pid_file) pid_file = strdup((read_config_file(configFile, PIDFILE_KEYWORD, tmp) > 0) ? tmp : PIDFILE_DEFAULT); diff -r -u pptpd-1.0.1.orig/pptpmanager.c pptpd-1.0.1.syspath/pptpmanager.c --- pptpd-1.0.1.orig/pptpmanager.c Mon Jul 31 18:28:52 2000 +++ pptpd-1.0.1.syspath/pptpmanager.c Tue Jul 3 15:32:38 2001 @@ -56,6 +56,7 @@ extern char *pppdoptstr; extern char *speedstr; extern char *bindaddr; +extern char *ppp_syspath; extern int pptp_debug; #if !defined(PPPD_IP_ALLOC) @@ -312,7 +313,7 @@ /* * Launch the CTRL manager binary; we send it some information such as - * speed and option file on the command line. + * speed, option file, and syspath on the command line. */ ctrl_argv[pptpctrl_argc++] = PPTP_CTRL_BIN " "; @@ -357,6 +358,16 @@ } else ctrl_argv[pptpctrl_argc++] = strdup("0"); #endif + + ctrl_argv[pptpctrl_argc++] = strdup("1"); + + /* A sanity check - + if this is ever null it means there's a problem somewhere + with ppp_syspath being overwitten. + */ + if(ppp_syspath == NULL) { syslog(LOG_DEBUG,"MGR: BUG!! ppp_syspath == NULL\n"); } + ctrl_argv[pptpctrl_argc++] = strdup(ppp_syspath); + /* terminate argv array with a NULL */ ctrl_argv[pptpctrl_argc] = NULL; pptpctrl_argc++;