diff -ur posadis-0.60.0/ChangeLog posadis-0.60.0-patch-01/ChangeLog --- posadis-0.60.0/ChangeLog 2003-07-31 00:12:34.000000000 +0200 +++ posadis-0.60.0-patch-01/ChangeLog 2003-08-02 19:01:26.000000000 +0200 @@ -3,6 +3,16 @@ ----------------- Stable CVS + * FreeBSD build fixes + * Fixed libfam error messages that should have been info's and info's that + should have been errors + * Made FAM shutdown along with Posadis better (for some reason, it did that + automagically on Linux but not on FreeBSD) + * Reduced FAM polling interval to one second + * Fixed mentions of "Pos6" in the posadis-config script. + * Ditched deprecated malloc.h and sys/dir.h headers. + +Posadis 0.60.0 * Re-branding from Pos6 to Posadis * Fixed build failure when libltdl was not installed * In Posask, default to "ptr" query type if domain is in a reverse-mapping diff -ur posadis-0.60.0/INSTALL posadis-0.60.0-patch-01/INSTALL --- posadis-0.60.0/INSTALL 2003-01-17 19:30:33.000000000 +0100 +++ posadis-0.60.0-patch-01/INSTALL 2003-08-02 21:02:48.000000000 +0200 @@ -1,3 +1,24 @@ +Platform-specific build notes +============================= + +Linux +----- + +To use the FAM module, install the fam and fam development packages for your +disitribution. You might need to make sure fam starts at startup if you get +messages that Posadis is unable to connect to the FAM server. + +FreeBSD +------- + +If you want to use the FAM module on FreeBSD, you can install the FAM port from +the FreeBSD ports collection, it is in devel/fam. If the configure script still +can't locate the fam header (which occured to me on FreeBSD 4.3), you should +create a symbolic link to /usr/local/include/fam. in /usr/include, and create +symbolic links to the libfam* libraries in /usr/local/lib in /usr/lib. Also, +you will need to configure FAM to boot at startup, though I can't give you +instructions on how to do that. + Basic Installation ================== diff -ur posadis-0.60.0/Makefile.in posadis-0.60.0-patch-01/Makefile.in --- posadis-0.60.0/Makefile.in 2003-07-30 23:44:52.000000000 +0200 +++ posadis-0.60.0-patch-01/Makefile.in 2003-08-02 19:33:16.000000000 +0200 @@ -143,7 +143,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = pos6 libltdl tools +SUBDIRS = libltdl pos6 tools EXTRA_DIST = pos6.kdevprj AUTHORS COPYING ChangeLog INSTALL README TODO \ posadis-config.in posadis.1 posadisrc.5 posadisrc diff -ur posadis-0.60.0/TODO posadis-0.60.0-patch-01/TODO --- posadis-0.60.0/TODO 2003-07-31 12:59:54.000000000 +0200 +++ posadis-0.60.0-patch-01/TODO 2003-08-01 23:41:47.000000000 +0200 @@ -1,5 +1,6 @@ SHORT TERM - * nothing :) + * make RPM not overwrite posadisrc (or make an rpmsave) + * make RPM _stop_ posadis LONGER TERM (0.60.1, 0.70.*) * implement 'restart' functionality (&remove all modules?) diff -ur posadis-0.60.0/configure posadis-0.60.0-patch-01/configure --- posadis-0.60.0/configure 2003-07-30 23:44:54.000000000 +0200 +++ posadis-0.60.0-patch-01/configure 2003-08-02 19:33:18.000000000 +0200 @@ -8576,8 +8576,7 @@ fi - -for ac_header in nameser.h resolv.h +for ac_header in nameser.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -8719,10 +8718,65 @@ done +echo "$as_me:$LINENO: checking for resolv.h" >&5 +echo $ECHO_N "checking for resolv.h... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + #ifdef HAVE_NAMESER_H + #include + #endif + #include + #include + #include + #include + #include -subdirs="$subdirs libltdl" +int +main () +{ +int x = _res.retry; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_RESOLV_H 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + + +subdirs="$subdirs libltdl" all_libraries="$all_libraries $USER_LDFLAGS" diff -ur posadis-0.60.0/pos6/configuration.cpp posadis-0.60.0-patch-01/pos6/configuration.cpp --- posadis-0.60.0/pos6/configuration.cpp 2003-07-31 00:07:56.000000000 +0200 +++ posadis-0.60.0-patch-01/pos6/configuration.cpp 2003-08-02 20:02:43.000000000 +0200 @@ -148,26 +148,20 @@ void set_setting(setting_fn fn, void *u1, void *u2, const char *_ptr) { char *ptr = (char *)_ptr; bool more; - bool iserr = false; stl_string i2; - try { - while (1) { + while (1) { + try { i2 = read_entry(ptr); - try { - if (i2[i2.size() - 1] == ',') { - i2[i2.size() - 1] = 0; - more = true; - } else { - more = false; - } - fn(u1, u2, i2.c_str()); - if (!more) break; - } catch (PException p) { - iserr = true; - throw p; - } + } catch (PException p) { break; } + if (i2[i2.size() - 1] == ',') { + i2[i2.size() - 1] = 0; + more = true; + } else { + more = false; } - } catch (PException p) { if (iserr) throw p; } + fn(u1, u2, i2.c_str()); + if (!more) break; + } } void zone_set(Zone *z, char *setting, const char *value) { diff -ur posadis-0.60.0/pos6/fam/fam.cpp posadis-0.60.0-patch-01/pos6/fam/fam.cpp --- posadis-0.60.0/pos6/fam/fam.cpp 2003-07-23 15:30:46.000000000 +0200 +++ posadis-0.60.0-patch-01/pos6/fam/fam.cpp 2003-08-02 17:51:59.000000000 +0200 @@ -142,7 +142,7 @@ ret = FAMOpen2(&fam, "Posadis libfam"); if (ret != 0) { - pos_log(context_server, log_info, "log_error: could not connect to FAM server: %d:%d", ret, FAMErrno); + pos_log(context_server, log_error, "log_error: could not connect to FAM server: %d:%d", ret, FAMErrno); return NULL; } @@ -158,10 +158,10 @@ while(1) { FD_ZERO(&famset); FD_SET(fd, &famset); - tv.tv_sec = 4; + tv.tv_sec = 1; tv.tv_usec = 0; - if (select(fd + 1, &famset, NULL, NULL, &tv) < 0) { - pos_log(context_server, log_error, "libfam: closing down"); + if (pos_quitting() || select(fd + 1, &famset, NULL, NULL, &tv) < 0) { + pos_log(context_server, log_info, "libfam: closing down"); FAMCancelMonitor(&fam, &req); FAMClose(&fam); return NULL; diff -ur posadis-0.60.0/pos6/main.cpp posadis-0.60.0-patch-01/pos6/main.cpp --- posadis-0.60.0/pos6/main.cpp 2003-07-30 17:38:33.000000000 +0200 +++ posadis-0.60.0-patch-01/pos6/main.cpp 2003-08-02 19:19:45.000000000 +0200 @@ -150,6 +150,7 @@ int x; char fname[PATH_MAX]; char pidfile[PATH_MAX] = ""; + FILE *pidf = NULL; #ifdef _WIN32 HKEY hkey; DWORD valuetype = 16; @@ -385,6 +386,12 @@ pos_log(context_conf, log_warning, "Could not open log file %s for writing!\n", logfile); } } + if (pidfile[0]) { + pidf = try_fopen(pidfile, "w"); + if (!pidf) { + throw PException(true, "Could not open pidfile %s for writing!", pidfile); + } + } #ifndef _WIN32 if (username[0]) { struct passwd *pwinfo; @@ -413,12 +420,9 @@ #endif /* write pid */ if (pidfile[0]) { - FILE *pidf = try_fopen(pidfile, "w"); - if (!pidf) { - throw PException(true, "Could not open pidfile %s for writing!", pidfile); - } fprintf(pidf, "%d", getpid()); fclose(pidf); + pidf = NULL; } end_setting(); @@ -431,8 +435,8 @@ signal(SIGINT, cleanup); signal(SIGTERM, cleanup); - signal(SIGUSR1, querylog); #ifndef _WIN32 + signal(SIGUSR1, querylog); signal(SIGHUP, sighup); #endif @@ -444,6 +448,7 @@ posserver_run(); #endif } catch (PException p) { + if (pidf) { fclose(pidf); pidf = NULL; } printf("Fatal error: %s\n", p.message); ret = 1; } @@ -456,6 +461,7 @@ #endif /* every destruction process that uses shared libraries should be placed here to prevent it from being called before dlexit */ + if (pidf) { fclose(pidf); pidf = NULL; } pthread_mutex_lock(&m_auth_zones); if (auth_root_zone) auth_root_zone->deletefn(auth_root_zone); auth_root_zone = NULL; diff -ur posadis-0.60.0/pos6/pbl.cpp posadis-0.60.0-patch-01/pos6/pbl.cpp --- posadis-0.60.0/pos6/pbl.cpp 2003-03-21 23:48:55.000000000 +0100 +++ posadis-0.60.0-patch-01/pos6/pbl.cpp 2003-08-02 19:00:47.000000000 +0200 @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include "pbl.h" diff -ur posadis-0.60.0/pos6/pbl.h posadis-0.60.0-patch-01/pos6/pbl.h --- posadis-0.60.0/pos6/pbl.h 2003-03-21 23:48:55.000000000 +0100 +++ posadis-0.60.0-patch-01/pos6/pbl.h 2003-08-02 19:00:02.000000000 +0200 @@ -49,7 +49,7 @@ #include #include #else - #include + #include #endif /*****************************************************************************/ diff -ur posadis-0.60.0/posadis-config.h.in posadis-0.60.0-patch-01/posadis-config.h.in --- posadis-0.60.0/posadis-config.h.in 2003-07-30 23:45:37.000000000 +0200 +++ posadis-0.60.0-patch-01/posadis-config.h.in 2003-08-02 19:35:10.000000000 +0200 @@ -28,7 +28,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NAMESER_H -/* Define to 1 if you have the header file. */ +/* Defines whether resolv.h works */ #undef HAVE_RESOLV_H /* Define to 1 if you have the header file. */ diff -ur posadis-0.60.0/posadis-config.in posadis-0.60.0-patch-01/posadis-config.in --- posadis-0.60.0/posadis-config.in 2003-07-23 17:30:43.000000000 +0200 +++ posadis-0.60.0-patch-01/posadis-config.in 2003-08-02 17:54:10.000000000 +0200 @@ -1,7 +1,7 @@ #!/bin/sh # -# Pos6 configure script +# Posadis configure script # # Copyright (C) Meilof Veeningen, 2003 # @@ -13,12 +13,12 @@ usage() { cat < /dev/null 2>&1 if [ $? != 0 ] ; then diff -ur posadis-0.60.0/tools/posask.cpp posadis-0.60.0-patch-01/tools/posask.cpp --- posadis-0.60.0/tools/posask.cpp 2003-07-28 22:56:43.000000000 +0200 +++ posadis-0.60.0-patch-01/tools/posask.cpp 2003-08-02 20:01:04.000000000 +0200 @@ -27,6 +27,10 @@ #ifdef HAVE_NAMESER_H #include #endif +#include +#include +#include +#include #include #endif