+* [Bug 542] Tolerate missing directory separator at EO statsdir.
* [Bug 812] ntpd should drop supplementary groups.
* [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6.
* [Bug 740] Fix kernel/daemon startup drift anomaly.
conf \
html \
libisc \
+ m4 \
ports \
\
bincheck.mf \
esac
AMU_OS_CFLAGS
+NTP_DIR_SEP
# NTP has (so far) been relying on leading-edge autogen.
# Therefore, by default:
--- /dev/null
+dnl ######################################################################
+dnl What directory path separator do we use?
+AC_DEFUN([NTP_DIR_SEP], [
+AC_CACHE_CHECK([for directory path separator], ac_cv_dir_sep,
+[
+ case "$ac_cv_dir_sep" in
+ '')
+ case "$target_os" in
+ *djgpp | *mingw32* | *emx*) ac_cv_dir_sep='"\\"' ;;
+ *) ac_cv_dir_sep='"/"' ;;
+ esac
+ ;;
+ esac
+])
+AC_DEFINE_UNQUOTED(DIR_SEP,$ac_cv_dir_sep,dnl
+ [Directory separator, usually / or \\])dnl
+])
+dnl ======================================================================
break;
case STATS_STATSDIR:
+ /* HMS: the following test is insufficient:
+ * - value may be missing the DIR_SEP
+ * - we still need the filename after it
+ */
if (strlen(value) >= sizeof(statsdir)) {
msyslog(LOG_ERR,
"value for statsdir too long (>%d, sigh)",
(int)sizeof(statsdir)-1);
} else {
l_fp now;
+ int add_dir_sep;
+ int value_l = strlen(value);
+
+ /* We do not want a DIR_SEP if we have no prefix */
+ if (value_l == 0)
+ add_dir_sep = 0;
+ else
+ add_dir_sep = strcmp(DIR_SEP,
+ value + value_l - strlen(DIR_SEP));
+
+ if (add_dir_sep)
+ snprintf(statsdir, sizeof(statsdir),
+ "%s%s", value, DIR_SEP);
+ else
+ snprintf(statsdir, sizeof(statsdir),
+ "%s", value);
get_systime(&now);
- strcpy(statsdir,value);
if(peerstats.prefix == &statsdir[0] &&
peerstats.fp != NULL) {
fclose(peerstats.fp);
/*
* The type of the socklen_t defined for getnameinfo() and getaddrinfo()
- * is int for VS compilers on Windows but the type is already declared
+ * is int for VS compilers on Windows but the type is already declared
*/
#define GETSOCKNAME_SOCKLEN_TYPE socklen_t
/*
/* Prevent inclusion of winsock.h in windows.h */
#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_
+#define _WINSOCKAPI_
#endif
#ifndef __RPCASYNC_H__
#endif
#define OPEN_BCAST_SOCKET 1 /* for ntp_io.c */
-#define TYPEOF_IP_MULTICAST_LOOP BOOL
+#define TYPEOF_IP_MULTICAST_LOOP BOOL
#define SETSOCKOPT_ARG_CAST (const char *)
-#define HAVE_RANDOM
+#define HAVE_RANDOM
#define MAXHOSTNAMELEN 64
#define AUTOKEY
# define REFCLOCK /* from ntpd.mak */
# define CLOCK_LOCAL /* from ntpd.mak */
-//# define CLOCK_PARSE
+//# define CLOCK_PARSE
/* # define CLOCK_ATOM */
/* # define CLOCK_SHM */ /* from ntpd.mak */
# define CLOCK_HOPF_SERIAL /* device 38, hopf DCF77/GPS serial line receiver */
# define NTP_POSIX_SOURCE
# define SYSLOG_FILE /* from libntp.mak */
-# define SYSV_TIMEOFDAY /* for ntp_unixtime.h */
+# define SYSV_TIMEOFDAY /* for ntp_unixtime.h */
# define SIZEOF_SIGNED_CHAR 1
# define SIZEOF_INT 4 /* for ntp_types.h */
# define NEED_S_CHAR_TYPEDEF
-# define USE_PROTOTYPES /* for ntp_types.h */
+# define USE_PROTOTYPES /* for ntp_types.h */
+
+/* Directory separator, usually / or \ */
+#define DIR_SEP "\\"
#define ULONG_CONST(a) a ## UL