aboutsummaryrefslogtreecommitdiff
path: root/net/dnrd/files/patch-main.c
diff options
context:
space:
mode:
authorWill Andrews <will@FreeBSD.org>2001-03-10 19:33:51 +0000
committerWill Andrews <will@FreeBSD.org>2001-03-10 19:33:51 +0000
commitff049e43e41fa444ef0d5c27a750e9df6975a1f3 (patch)
tree26caa95d13648cc127d1260153e6228b40688b3c /net/dnrd/files/patch-main.c
parent7281bf7499d0a62266124cdf07b00cb38875174c (diff)
downloadports-ff049e43e41fa444ef0d5c27a750e9df6975a1f3.tar.gz
ports-ff049e43e41fa444ef0d5c27a750e9df6975a1f3.zip
Add dnrd 2.9, a proxy DNS daemon.
PR: 24107 Submitted by: George Reid <greid@ukug.uk.freebsd.org>
Notes
Notes: svn path=/head/; revision=39455
Diffstat (limited to 'net/dnrd/files/patch-main.c')
-rw-r--r--net/dnrd/files/patch-main.c83
1 files changed, 83 insertions, 0 deletions
diff --git a/net/dnrd/files/patch-main.c b/net/dnrd/files/patch-main.c
new file mode 100644
index 000000000000..09f5612abf43
--- /dev/null
+++ b/net/dnrd/files/patch-main.c
@@ -0,0 +1,83 @@
+--- main.c.orig Thu Jan 4 14:40:42 2001
++++ main.c Sat Jan 6 15:06:31 2001
+@@ -18,6 +18,7 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <sys/types.h>
+ #include "relay.h"
+ #include "cache.h"
+ #include "common.h"
+@@ -26,7 +27,6 @@
+ #include "master.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+@@ -170,20 +170,20 @@
+ * Change our root and current working directories to /etc/dnrd.
+ * Also, so some sanity checking on that directory first.
+ */
+- dirp = opendir("/etc/dnrd");
++ dirp = opendir("%%PREFIX%%/etc/dnrd");
+ if (!dirp) {
+- log_msg(LOG_ERR, "The directory /etc/dnrd must be created before "
++ log_msg(LOG_ERR, "The directory %%PREFIX%%/etc/dnrd must be created before "
+ "dnrd will run");
+ }
+
+- rslt = stat("/etc/dnrd", &st);
++ rslt = stat("%%PREFIX%%/etc/dnrd", &st);
+ if (st.st_uid != 0) {
+- log_msg(LOG_ERR, "The /etc/dnrd directory must be owned by root");
++ log_msg(LOG_ERR, "The %%PREFIX%%/dnrd directory must be owned by root");
+ cleanexit(-1);
+ }
+ if ((st.st_mode & (S_IWGRP | S_IWOTH)) != 0) {
+ log_msg(LOG_ERR,
+- "The /etc/dnrd directory should only be user writable");
++ "The %%PREFIX%%/etc/dnrd directory should only be user writable");
+ cleanexit(-1);
+ }
+
+@@ -198,31 +198,31 @@
+
+ if (rslt) continue;
+ if (S_ISDIR(st.st_mode)) {
+- log_msg(LOG_ERR, "The /etc/dnrd directory must not contain "
++ log_msg(LOG_ERR, "The %%PREFIX%%/etc/dnrd directory must not contain "
+ "subdirectories");
+ cleanexit(-1);
+ }
+ if ((st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH|S_IWGRP|S_IWOTH)) != 0) {
+- log_msg(LOG_ERR, "A file in /etc/dnrd has either execute "
++ log_msg(LOG_ERR, "A file in %%PREFIX%%/etc/dnrd has either execute "
+ "permissions or non-user write permission. Please do a "
+ "\"chmod a-x,go-w\" on all files in this directory");
+ cleanexit(-1);
+ }
+ if (st.st_uid != 0) {
+- log_msg(LOG_ERR, "All files in /etc/dnrd must be owned by root");
++ log_msg(LOG_ERR, "All files in %%PREFIX%%/etc/dnrd must be owned by root");
+ cleanexit(-1);
+ }
+ }
+ closedir(dirp);
+
+- if (chdir("/etc/dnrd")) {
++ if (chdir("%%PREFIX%%/etc/dnrd")) {
+ log_msg(LOG_ERR, "couldn't chdir to %s, %s",
+- "/etc/dnrd", strerror(errno));
++ "%%PREFIX%%/etc/dnrd", strerror(errno));
+ cleanexit(-1);
+ }
+- if (chroot("/etc/dnrd")) {
++ if (chroot("%%PREFIX%%/etc/dnrd")) {
+ log_msg(LOG_ERR, "couldn't chroot to %s, %s",
+- "/etc/dnrd", strerror(errno));
++ "%%PREFIX%%/etc/dnrd", strerror(errno));
+ cleanexit(-1);
+ }
+