X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fmain.c;h=203202fe6ed6ffcbc21cbcf7cd102c58e5b3a9a9;hb=4e2c49755175d05f7f4a3c1c70a42d2eef9d7839;hp=099c0505a4217ff942e75ffe3fb419996a0e7b57;hpb=c58bf2e8023dd846683f09cb00e15d64143dac8c;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index 099c050..203202f 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -66,6 +66,10 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -120,7 +124,7 @@ /* interface vars */ -char ifname[MAXIFNAMELEN]; /* Interface name */ +char ifname[IFNAMSIZ]; /* Interface name */ int ifunit; /* Interface unit number */ struct channel *the_channel; @@ -293,6 +297,9 @@ main(int argc, char *argv[]) struct protent *protp; char numbuf[16]; + strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); + strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); + link_stats_valid = 0; new_phase(PHASE_INITIALIZE); @@ -763,8 +770,7 @@ detach(void) /* update pid files if they have been written already */ if (pidfilename[0]) create_pidfile(pid); - if (linkpidfile[0]) - create_linkpidfile(pid); + create_linkpidfile(pid); exit(0); /* parent dies */ } setsid(); @@ -1640,7 +1646,7 @@ device_script(char *program, int in, int out, int dont_wait) if (log_to_fd >= 0) errfd = log_to_fd; else - errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0600); + errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0644); ++conn_running; pid = safe_fork(in, out, errfd);