]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- windows port fixes, no AF_LOCAL, no chown, no chmod(grp).
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 23 Jan 2015 15:23:58 +0000 (15:23 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 23 Jan 2015 15:23:58 +0000 (15:23 +0000)
git-svn-id: file:///svn/unbound/trunk@3319 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
daemon/remote.c
daemon/unbound.c
doc/Changelog
services/listen_dnsport.c
util/config_file.c

index 1f06ee81d9c4d77f7a40df5c4005825f1ae1849a..c36d4b98b0f7523d15efabcac99052f88282e457 100644 (file)
@@ -42,7 +42,7 @@
 /* Whether the C compiler accepts the "unused" attribute */
 #undef HAVE_ATTR_UNUSED
 
-/* Define to 1 if your system has a working `chown' function. */
+/* Define to 1 if you have the `chown' function. */
 #undef HAVE_CHOWN
 
 /* Define to 1 if you have the `chroot' function. */
 #define ARG_LL "%I64"
 #endif
 
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+
 
  
 #ifdef HAVE_ATTR_FORMAT
index 6a9c1e9822c4ee08fb2769a17edeed2181b012ac..26e3e8296b692b1f0371a8b42ec01447b135d7d5 100755 (executable)
--- a/configure
+++ b/configure
@@ -17958,7 +17958,7 @@ if test "$ac_res" != no; then :
 
 fi
 
-for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent
+for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
index cc59727e54b235ce8d4c2ec46928c3f4cd6dfe97..8d496ce9bbf1dd00cfb0d7dfa39a5310a192e5f0 100644 (file)
@@ -978,7 +978,7 @@ AC_INCLUDES_DEFAULT
 #endif
 ])
 AC_SEARCH_LIBS([setusercontext], [util])
-AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
+AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
 AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
 AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])])
 
@@ -1215,6 +1215,10 @@ dnl includes
 #else
 #define ARG_LL "%I64"
 #endif
+
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
 ]
 
 AHX_CONFIG_FORMAT_ATTRIBUTE
index a5be6d68c88252f5e237ff7836f91d3a0697ed73..7a8fdb75e75b19cafa411536bd7c0934558f2287 100644 (file)
@@ -327,9 +327,13 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
                 * group as the user we run as.
                 */
                if(fd != -1) {
+#ifdef HAVE_CHOWN
                        if (cfg->username && cfg->username[0])
                                chown(ip, cfg->uid, cfg->gid);
                        chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
+#else
+                       (void)cfg;
+#endif
                }
        } else {
                hints.ai_socktype = SOCK_STREAM;
index a31b0392ffdb24a38f4a32c72ebb18f8b393d1cc..f6bd924a57b9f7ff254d0560f0d4d02b99999c33 100644 (file)
@@ -504,16 +504,18 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
        if(cfg->pidfile && cfg->pidfile[0]) {
                writepid(daemon->pidfile, getpid());
                if(cfg->username && cfg->username[0]) {
+#  ifdef HAVE_CHOWN
                        if(chown(daemon->pidfile, cfg->uid, cfg->gid) == -1) {
                                log_err("cannot chown %u.%u %s: %s",
                                        (unsigned)cfg->uid, (unsigned)cfg->gid,
                                        daemon->pidfile, strerror(errno));
                        }
+#  endif /* HAVE_CHOWN */
                }
        }
 #else
        (void)daemon;
-#endif
+#endif /* HAVE_KILL */
 
        /* Set user context */
 #ifdef HAVE_GETPWNAM
index 80d0f7181580c1e96e798f25da340c7bc831f250..17e97c62c4317560c5fbe9d1cff8e21f10c4589d 100644 (file)
@@ -1,3 +1,6 @@
+23 January 2015: Wouter
+       - windows port fixes, no AF_LOCAL, no chown, no chmod(grp).
+
 16 January 2015: Wouter
        - unit test for local unix connection.  Documentation and log_addr
          does not inspect port for AF_LOCAL.
index fc0085a54036934840540bc672a8c120b79487f0..ef9a4acf5dabfa42db3262d8c545a91f9ae90af5 100644 (file)
@@ -641,6 +641,7 @@ create_local_accept_sock(const char *path, int* noproto)
        (void)noproto; /*unused*/
        return s;
 #else
+       (void)path;
        log_err("Local sockets are not supported");
        *noproto = 1;
        return -1;
index 3554e3fa05058632d0f9165f3ae3f44fbcc8b747..f8f80306724b7ec4a49f1c1cb13caa8fb6040f43 100644 (file)
@@ -1205,6 +1205,8 @@ void config_lookup_uid(struct config_file* cfg)
                cfg->uid = pwd->pw_uid;
                cfg->gid = pwd->pw_gid;
        }
+#else
+       (void)cfg;
 #endif
 }