Don't attempt to fputs(NULL, fp) when ``enable dns'' is given and
there's no resolv.conf. Use a umask of 022 when creating resolv.conf, not 0644 !
This commit is contained in:
parent
d61b89e4b3
commit
7fe0b59209
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60839
@ -367,10 +367,11 @@ ipcp_WriteDNS(struct ipcp *ipcp)
|
||||
ipcp->ns.dns[1].s_addr = INADDR_ANY;
|
||||
}
|
||||
|
||||
mask = umask(0644);
|
||||
mask = umask(022);
|
||||
if ((fp = ID0fopen(_PATH_RESCONF, "w")) != NULL) {
|
||||
umask(mask);
|
||||
fputs(ipcp->ns.resolv_nons, fp);
|
||||
if (ipcp->ns.resolv_nons);
|
||||
fputs(ipcp->ns.resolv_nons, fp);
|
||||
paddr = inet_ntoa(ipcp->ns.dns[0]);
|
||||
log_Printf(LogIPCP, "Primary nameserver set to %s\n", paddr);
|
||||
fprintf(fp, "\nnameserver %s\n", paddr);
|
||||
|
Loading…
Reference in New Issue
Block a user