#undef GETHOSTBYADDRRSTYLE
#undef GETHOSTBYNAMERSTYLE
+/* style of ctime_r function */
+#define POSIXSTYLE 1
+#define SOLARISSTYLE 2
+#undef CTIMERSTYLE
+
/* Do we have the crypt function ? */
#undef HAVE_CRYPT
-# From configure.in Revision: 1.189
+# From configure.in Revision: 1.190
RADIUSD_MAJOR_VERSION=1
RADIUSD_MINOR_VERSION=0.0-pre0
RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
echo "configure: warning: ****** BSD-style gethostbyname might NOT be thread-safe! ****** " 1>&2
fi
+ctimerstyle=""
+echo $ac_n "checking ctime_r() syntax""... $ac_c" 1>&6
+echo "configure:8278: checking ctime_r() syntax" >&5
+cat > conftest.$ac_ext <<EOF
+#line 8280 "configure"
+#include "confdefs.h"
+
+#include <time.h>
+
+int main() {
+ ctime_r(NULL, NULL, 0)
+; return 0; }
+EOF
+if { (eval echo configure:8289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+
+ cat >> confdefs.h <<\EOF
+#define CTIMERSTYLE SOLARISSTYLE
+EOF
+
+ ctimerstyle="SOLARIS"
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+if test "x$ctimerstyle" = "x"; then
+ cat > conftest.$ac_ext <<EOF
+#line 8305 "configure"
+#include "confdefs.h"
+
+#include <time.h>
+
+int main() {
+ ctime_r(NULL, NULL)
+; return 0; }
+EOF
+if { (eval echo configure:8314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+
+ cat >> confdefs.h <<\EOF
+#define CTIMERSTYLE POSIXSTYLE
+EOF
+
+ ctimerstyle="POSIX"
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+fi
+
+if test "x$ctimerstyle" = "x"; then
+ echo "$ac_t""none! It must not exist, here." 1>&6
+else
+ echo "$ac_t""${ctimerstyle}-style" 1>&6
+fi
+
+
if test x"$rad_enable_largefiles" = xyes ; then
echo $ac_n "checking for largefile linkage""... $ac_c" 1>&6
-echo "configure:8278: checking for largefile linkage" >&5
+echo "configure:8339: checking for largefile linkage" >&5
case "$host" in
*-aix4.01*)
echo "$ac_t""no" 1>&6
# Extract the first word of "getconf", so it can be a program name with args.
set dummy getconf; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8315: checking for $ac_word" >&5
+echo "configure:8376: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GETCONF'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
fi
+dnl check for non-posix solaris ctime_r (extra buflen int arg)
+ctimerstyle=""
+AC_MSG_CHECKING([ctime_r() syntax])
+AC_TRY_LINK([
+#include <time.h>
+], [ ctime_r(NULL, NULL, 0) ], [
+ AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
+ ctimerstyle="SOLARIS"
+])
+if test "x$ctimerstyle" = "x"; then
+ AC_TRY_LINK([
+#include <time.h>
+], [ ctime_r(NULL, NULL) ], [
+ AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
+ ctimerstyle="POSIX"
+ ])
+fi
+
+if test "x$ctimerstyle" = "x"; then
+ AC_MSG_RESULT([none! It must not exist, here.])
+else
+ AC_MSG_RESULT([${ctimerstyle}-style])
+fi
+
+
dnl If configuring with large file support, determine the right flags to
dnl use based on the platform. This is the wrong approach; autoconf 2.50
dnl comes with a macro that takes the right approach. But this works well
#undef GETHOSTBYADDRRSTYLE
#undef GETHOSTBYNAMERSTYLE
+/* style of ctime_r function */
+#define POSIXSTYLE 1
+#define SOLARISSTYLE 2
+#undef CTIMERSTYLE
+
/* Do we have the crypt function ? */
#undef HAVE_CRYPT
/*#define dict_valget dict_valbyattr almost but not quite*/
#endif
+/* get around diffrent ctime_r styles */
+#ifdef CTIMERSTYLE
+#if CTIMERSTYLE == SOLARISSTYLE
+#define CTIME_R(a,b,c) ctime_r(a,b,c)
+#else
+#define CTIME_R(a,b,c) ctime_r(a,b)
+#endif
+#else
+#define CTIME_R(a,b,c) ctime_r(a,b)
+#endif
+
/* md5.c */
void librad_md5_calc(u_char *, u_char *, u_int);
time_t timeval;
timeval = time(NULL);
- ctime_r(&timeval, buffer);
+ CTIME_R(&timeval, buffer, 8192);
s = lrad_int2str(levels, (lvl & ~L_CONS), ": ");
p++;
break;
case 't': /* request timestamp */
- ctime_r(&request->timestamp, q);
+ CTIME_R(&request->timestamp, q, freespace);
q += strlen(q);
p++;
break;
* Post a timestamp
*/
fseek(outfp, 0L, SEEK_END);
- fputs(ctime_r(&request->timestamp, buffer), outfp);
+ fputs(CTIME_R(&request->timestamp, buffer, DIRLEN), outfp);
/* Write each attribute/value to the log file */
while (pair) {