diff -urN bind-8.2.2_P5.org/src/bin/named/ns_config.c bind-8.2.2_P5/src/bin/named/ns_config.c --- bind-8.2.2_P5.org/src/bin/named/ns_config.c Tue Nov 9 00:09:42 1999 +++ bind-8.2.2_P5/src/bin/named/ns_config.c Wed Feb 2 17:30:14 2000 @@ -1445,8 +1445,10 @@ return (NULL); } + /* If file isn't our or named is running as root */ + if ((geteuid() == 0) || (geteuid() != sb.st_uid)) (void)unlink(filename); - fd = open(filename, O_WRONLY|O_CREAT|O_EXCL, + fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (fd < 0) return (NULL);