mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Prevent races on resovlconf generation as well by adding a lock.
This commit is contained in:
parent
b45babaeb5
commit
d97ff036ab
@ -116,9 +116,12 @@ function system_resolvconf_generate($dynupdate = false) {
|
||||
}
|
||||
}
|
||||
|
||||
$dnslock = lock('resolvconf', LOCK_EX);
|
||||
|
||||
$fd = fopen("{$g['varetc_path']}/resolv.conf", "w");
|
||||
if (!$fd) {
|
||||
printf("Error: cannot open resolv.conf in system_resolvconf_generate().\n");
|
||||
unlock($dnslock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -148,7 +151,9 @@ function system_resolvconf_generate($dynupdate = false) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unlock($dnslock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user