pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

jabberd: update to 1.6.1.1



Module Name:	pkgsrc-wip
Committed By:	Frédéric Fauberteau <frederic%fauberteau.org@localhost>
Pushed By:	frederic
Date:		Mon Oct 28 17:46:35 2019 +0100
Changeset:	3f0c82872f9b0f1dea49692c17e0d4cfaac8c791

Added Files:
	jabberd14/DESCR
	jabberd14/Makefile
	jabberd14/PLIST
	jabberd14/TODO
	jabberd14/buildlink3.mk
	jabberd14/distinfo
	jabberd14/files/jabberd.sh
	jabberd14/patches/patch-Makefile.am
	jabberd14/patches/patch-configure.ac
	jabberd14/patches/patch-jsm_sessions.cc

Log Message:
jabberd: update to 1.6.1.1

pkgsrc changes:
---------------
Version 1.6.1.1 - 2007-07-22

Only bugfixes.

Version 1.6.1 - 2007-07-17

Changes in administration of the server
    * jabberd14 is now using the GnuTLS library instead of OpenSSL
    * Support for wildcards in certificates
    * Support for TLS 1.1
    * Support for TLS 1.2 (if supported by your GnuTLS version)
    * Support for DH key exchanges also when being the server side
    * Support for stream compression in the TLS layer
    * Support for loading certificate revocation lists
    * Support for OpenPGP keys
    * mod_filter has to be removed from the JSM configuration (it was already
      just an empty dummy implementation in jabberd14 1.6.0)

Version 1.6.0 - 2006-12-24

New features and changes visible to the user
    * Support for Privacy Lists (RFC3921 and XEP-0016)
    * jabberd14 can localize the messages it sends to users to different
      languages
    * SASL authentication is possible if jabberd14 is used together with
      jadc2s (at least the following mechanisms should be supported:
      CRAM-MD5, PLAIN, GSSAPI, DIGEST-MD5, NTLM, SRP, OTP, KERBEROS_V4)
    * Support for Flexible Offline Message Retrieval (XEP-0013)
    * Support for XMPP Ping (XEP-0199)
    * jabberd14 now handles XML namespaces
    * jabberd14 now handles xml:lang attributes defined on the stream root
      element, declaring the default language of the stream. If a stanza does
      not redeclare the language, this language is passed along with the
      stanza.
    * The full stanza that requests subscription to a user is passed
      to this user, even if it has been stored offline. In addition the
      request is stamped if the time of the request, if it is delivered
      from offline storage.
    * FIX: Handling of presences with negative priority had bugs, e.g.
      messages were not delivered when changing from negative to
      non-negative priority.

Changes in administration of the server
    * Easier integration of jabberd14 into web projects, by having additional
      data available in the database (e.g. presence information can now
      be read by a web page with a single SQL SELECT statement)
    * New base handler base_dir that can periodically check a directory for
      *.stanza files. These files are read, parsed, the content is
      processed as a stanza, and the file is deleted afterwards. This can
      be useful to inject messages and other stanzas to the server.
      Stanzas sent to the handler are written as files using the *.out
      extension. The directories for reading and writing are configured
      using the <in/> and <out/> elements inside the <dir/> element.
    * jabberd14 does not cache passwords in the session manager anymore,
      you can now just update passwords in SQL and they are used instantly.
      You can also just insert a password in your SQL database to create a
      new account for a user.
    * It is possible to block account names from being registered and
      to enforce minimum and maximum lengths of the username on
      registration of new accounts
    * After an account has been deleted by the user, the JabberID is blocked
      against reregistrations for half a year.
    * jabberd14 can now easily migrate from old filespools (xdb_file) to
      newer storage handlers by reconfiguring the server and then importing
      the old data (-I command line option)
    * The session manager of jabberd14 can no be restarted without users
      sessions being dropped. This allows reconfiguring of the session manager
      while it is serving users.
    * Jabberd14 now understands the protocol between c2s and session manager
      components of jabberd2. This allows development and usage of
      c2s components for both server implementations.
    * Settings in the dialback component configuration for disabling
      xmpp streams or disabling tls now also affect subdomains of the
      configured host. It is now also possible to require s2s connections
      to some or all other hosts to be encrypted.
    * Jabberd14 now supports SASL EXTERNAL authentication using TLS
      certificates on s2s links.
    * xdb_sql can be configured to execute an SQL query just after a
      connection to the database server has been established or reestablished.
      This is useful for example if you are using MySQL 4.1+ and want to
      set your used charset ("SET NAMES utf8").
    * jabberd14 now uses libpopt for command line parsing.
    * jabberd14 now detects stale pidfiles, and ignores them.
    * The list of online sessions has to be fetched using service discovery
      instead of browsing now.
    * Removed support for the jabber:iq:admin namespace.
    * Disabled support for the jabber:iq:agent and jabber:iq:agents in the
      default configuration file.
    * Removed support for the jabber:iq:filter namespace (which had already
      been disabled in the default configuration of jabberd14 1.4.4).
    * Removed the mod_groups module.
    * jabberd14 automatically generates the list of supported features for
      a reply to a service discovery request. There is no need anymore to
      configure a disco result in the configuration file.

Version 1.4.4 - 2005-04-16

Changes in compiling and installing jabberd
    * Jabberd14 now uses an automake/autoconf build environment, so you
      will use "make install" after compiling jabberd and after that
      you can now delete the source.
    * Jabberd14 now requires at least openssl version 0.9.7 to be build with
      support for SSL/TLS.

Changes in administration of the server
    * Jabberd14 now supports encrypted connections using the STARTTLS
      stream feature of XMPP.
    * The activation of debugging output has been changed: you can either
      activate debugging in the configuration file or in the command line
      using the -D option (that now takes an argument). You can even change
      the debugging settings at the configuration file while jabberd is
      running. After you changed them send a HUP signal to jabberd and
      it will reread them from the configuration.
    * The size of the files handled by xdb_file can be limited. This prevents
      spool files from getting to big if a user subscribes to a feed and stops
      using his account. Incoming messages will get bounced with an error if
      the spool file of this user is full.
    * The xdb_file module allows two directory layouts. The classic jabberd14
      layout with one big directory containing all files for one domain, and
      the layout adopted from wpjabber, where the files are distributed over
      256 * 256 different directories, improoving performance on filesystems,
      that are not well suited for large directories.
    * There is a small utility xdbfiletool that helps accessing xdb_file's
      new directory layout and that can convert old spools to the new
      format.
    * jabberd14 has a new xdb module for storing data in SQL databases,
      currently mysql and postgresql are supported
    * Support for legacy jabberd 1.0 server to server connections is now
      removed completely as this old protocol allowed spoofing of sender
      addresses. You should not need this protocol anymore anyway.
    * Jabberd14 will now try to establish s2s connections not only on the
      first IPv4/IPv6 address it finds in DNS but on any IPv4/IPv6 address,
      that can be found for the first matching service. (It will not fall
      back to pure AAAA or A records if there has been a SRV record for
      any configured service.)
      This will now allow a jabberd14, that has been configured with
      --enable-ipv6, to be used on systems without IPv6 routing as well.
    * Jabberd14 now supports clustering of the s2s component. The distribution
      among the components for incoming connections has to be managed using
      DNS records. For outgoing connections the DNS resolver (dnsrv) is
      responsible for distributing the connections among the components.
    * The logging of s2s failures has been improved.
    * Jabberd14 is now able to send log messages to the syslog.
    * The welcome and the auto-reply message in the jabberd14 configuration
      file can be configured in additional languages and an XMPP compatible
      client will display the appropriate version.
    * New base handler <unsubscribe/> which bounces messages and iqs and sends
      unsubscribes/unsubscribeds as reply to presence stanzas. Intended to be
      used as a replacement for deinstalled transports.
    * Presence information can be stored in xdb and therefore (using xdb_sql)
      in an SQL table. The stored presence information is not used by
      jabberd itself, but can be used by other applications.
    * Messages can be dumped to xdb storage, this can be used to implement
      logging of exchanged messages.
    * It can be configured which types of messages are to be stored offline,
      e.g. an server administrator can decide not to store headline messages
      in offline storage.
    * It can be configured which ciphers and versions of SSL/TLS jabberd is
      allowed to use.

Changes in features visible to the user
    * Better XMPP compatibility: JIDs are prepared by the applicable
      stringprep profiles; internationalized domain names (IDNs) are
      supported; subscription state changes are only made if allowed, contacts
      cannot push themself on a user's roster; correct stanza errors are
      created.
    * Jabberd14 now handles negative priorities and won't consider sessions
      with negative priority for default delivery.
    * The server will now unsubscribe all subscriptions when an user
      unregisters his account.
    * If a stanza could not delivered to the recipient, the error message
      that is sent back to the user will contain more information on why
      this happened.

Problem fixes:
    * earlier version of jabberd14 sent out two presences for a user
      that came online, this is fixed - as well as that presences got
      stamped several times if the user was online with multiple resources.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3f0c82872f9b0f1dea49692c17e0d4cfaac8c791

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 jabberd14/DESCR                         |  7 ++++
 jabberd14/Makefile                      | 64 +++++++++++++++++++++++++++++++++
 jabberd14/PLIST                         | 37 +++++++++++++++++++
 jabberd14/TODO                          |  1 +
 jabberd14/buildlink3.mk                 | 14 ++++++++
 jabberd14/distinfo                      |  9 +++++
 jabberd14/files/jabberd.sh              | 21 +++++++++++
 jabberd14/patches/patch-Makefile.am     | 50 ++++++++++++++++++++++++++
 jabberd14/patches/patch-configure.ac    | 15 ++++++++
 jabberd14/patches/patch-jsm_sessions.cc | 57 +++++++++++++++++++++++++++++
 10 files changed, 275 insertions(+)

diffs:
diff --git a/jabberd14/DESCR b/jabberd14/DESCR
new file mode 100644
index 0000000000..bb580b9994
--- /dev/null
+++ b/jabberd14/DESCR
@@ -0,0 +1,7 @@
+Jabber is an open XML protocol for real-time exchange of messages and
+presence notification between any two points on the Internet.  The first
+application of Jabber technology is an asynchronous, extensible instant
+messaging platform, and an IM network that offers functionality similar
+to legacy IM systems such as AIM, ICQ, MSN, and Yahoo.
+
+This version of jabberd is very very old and no longer maintained.
diff --git a/jabberd14/Makefile b/jabberd14/Makefile
new file mode 100644
index 0000000000..af2bd9a3fd
--- /dev/null
+++ b/jabberd14/Makefile
@@ -0,0 +1,64 @@
+# $NetBSD: Makefile,v 1.44 2019/07/30 18:41:58 gdt Exp $
+
+DISTNAME=		jabberd-1.6.1.1
+CATEGORIES=		chat
+MASTER_SITES=		${MASTER_SITE_GITHUB:=mawis/}
+GITHUB_TAG=		b2b871eaf3f6455d7d37113ce23d6bc59c8da70f
+
+MAINTAINER=		pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=		https://jabberd.org/
+COMMENT=		Instant messaging server
+LICENSE=		gnu-gpl-v2
+
+CONFLICTS=		jabberd2-[0-9]*
+
+BUILD_DEPENDS+=		gettext-m4-[0-9]*:../../devel/gettext-m4
+TOOL_DEPENDS+=		libtool-base-[0-9]*:../../devel/libtool-base
+
+WRKSRC=			${WRKDIR}/jabberd-${GITHUB_TAG}/jabberd14
+
+GNU_CONFIGURE=		yes
+USE_LIBTOOL=		yes
+USE_TOOLS+=		aclocal autoconf automake gettext gmake pkg-config
+USE_LANGUAGES=		c c++11
+
+BUILD_DEFS+=		JABBERD_PIDDIR JABBERD_SPOOLDIR
+
+PKG_GROUPS=		${JABBERD_GROUP}
+PKG_USERS=		${JABBERD_USER}:${JABBERD_GROUP}
+PKG_USERS_VARS+=	JABBERD_USER
+PKG_GROUPS_VARS+=	JABBERD_GROUP
+
+FILES_SUBST+=		JABBERD_USER=${JABBERD_USER}
+FILES_SUBST+=		JABBERD_GROUP=${JABBERD_GROUP}
+FILES_SUBST+=		JABBERD_SPOOLDIR=${JABBERD_SPOOLDIR}
+FILES_SUBST+=		JABBERD_PIDDIR=${JABBERD_PIDDIR}
+
+RCD_SCRIPTS=		jabberd
+PKG_SYSCONFSUBDIR=	jabberd
+EGDIR=			${PREFIX}/share/examples/jabberd
+CONF_FILES=		${EGDIR}/cacerts.pem ${PKG_SYSCONFDIR}/cacerts.pem
+CONF_FILES+=		${EGDIR}/jabber.xml ${PKG_SYSCONFDIR}/jabber.xml
+INSTALLATION_DIRS+=	${EGDIR}
+
+SUBST_CLASSES+=		paths
+SUBST_STAGE.paths=	pre-configure
+SUBST_FILES.paths=	Makefile.am
+SUBST_VARS.paths=	EGDIR JABBERD_LOGDIR JABBERD_PIDDIR JABBERD_SPOOLDIR
+SUBST_MESSAGE.paths=	Fixing absolute paths.
+
+pre-configure:
+	set -e; cd ${WRKSRC}; \
+	libtoolize; aclocal; autoheader; automake -a --foreign -i; autoconf
+
+post-install:
+	${RM} -f ${DESTDIR}${PKG_SYSCONFBASEDIR}/jabber.xml.dist
+
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../devel/glibmm/buildlink3.mk"
+.include "../../devel/libidn/buildlink3.mk"
+.include "../../devel/popt/buildlink3.mk"
+.include "../../devel/pth/buildlink3.mk"
+.include "../../security/gnutls/buildlink3.mk"
+.include "../../security/libgcrypt/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/jabberd14/PLIST b/jabberd14/PLIST
new file mode 100644
index 0000000000..16d0776ef9
--- /dev/null
+++ b/jabberd14/PLIST
@@ -0,0 +1,37 @@
+@comment $NetBSD$
+bin/jabberd
+bin/xdbfiletool
+include/base64.hh
+include/crc32.hh
+include/expat.hh
+include/hash.hh
+include/hmac.hh
+include/jabberd.h
+include/jabberid.hh
+include/jid.hh
+include/jpacket.hh
+include/jutil.hh
+include/karma.hh
+include/lwresc.hh
+include/messages.hh
+include/pool.hh
+include/rate.hh
+include/socket.hh
+include/str.hh
+include/xhash.hh
+include/xmlnode.hh
+include/xstream.hh
+lib/libjabberd.la
+lib/libjabberddialback.la
+lib/libjabberddnsrv.la
+lib/libjabberdproxy65.la
+lib/libjabberdpthsock.la
+lib/libjabberdresolver.la
+lib/libjabberdsm.la
+lib/libjabberdxdbfile.la
+lib/libjabberdxdbsql.la
+man/man5/jabber.xml.5
+man/man8/jabberd.8
+share/examples/jabberd/cacerts.pem
+share/examples/jabberd/jabber.xml
+@pkgdir etc
diff --git a/jabberd14/TODO b/jabberd14/TODO
new file mode 100644
index 0000000000..992a36d882
--- /dev/null
+++ b/jabberd14/TODO
@@ -0,0 +1 @@
+* handle option for PostgreSQL or MySQL
diff --git a/jabberd14/buildlink3.mk b/jabberd14/buildlink3.mk
new file mode 100644
index 0000000000..225e3f8ddf
--- /dev/null
+++ b/jabberd14/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.19 2016/03/05 11:27:41 jperkin Exp $
+
+BUILDLINK_TREE+=	jabberd
+
+.if !defined(JABBERD_BUILDLINK3_MK)
+JABBERD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.jabberd+=	jabberd>=1.4.2
+BUILDLINK_ABI_DEPENDS.jabberd+=	jabberd>=1.4.2nb13
+BUILDLINK_PKGSRCDIR.jabberd?=	../../chat/jabberd
+
+.endif # JABBERD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-jabberd
diff --git a/jabberd14/distinfo b/jabberd14/distinfo
new file mode 100644
index 0000000000..98835a47be
--- /dev/null
+++ b/jabberd14/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.11 2015/11/03 01:20:20 agc Exp $
+
+SHA1 (jabberd-1.6.1.1-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f.tar.gz) = 699ff43cc6bb5767fa9806811ad926b74e5dd008
+RMD160 (jabberd-1.6.1.1-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f.tar.gz) = 77b7027db3eb498a8d4d94d4b19ea045f8cc5d80
+SHA512 (jabberd-1.6.1.1-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f.tar.gz) = b62ff5046b6e50491685775fb09d421ec561ad3c64536e80aa29631e9adcdcef23ee9a576ed7621786a3a89abc00bd20b0799041168aca40c7ac9d351969f5d3
+Size (jabberd-1.6.1.1-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f.tar.gz) = 655198 bytes
+SHA1 (patch-Makefile.am) = 928cdb5aa77e80f5b698f08b623484d93d3500ab
+SHA1 (patch-configure.ac) = 0542bf8cebce67fe35d76232110dafc0ff398bbd
+SHA1 (patch-jsm_sessions.cc) = 051bfddb6bbec1684fd89e0c0c0fbc48fa89a568
diff --git a/jabberd14/files/jabberd.sh b/jabberd14/files/jabberd.sh
new file mode 100644
index 0000000000..8809638a5a
--- /dev/null
+++ b/jabberd14/files/jabberd.sh
@@ -0,0 +1,21 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: jabberd.sh,v 1.2 2004/02/21 05:38:29 xtraeme Exp $
+#
+
+# PROVIDE: jabberd
+# REQUIRE: DAEMON LOGIN
+
+. /etc/rc.subr
+
+name="jabberd"
+help_name="jabber"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+required_files="@PKG_SYSCONFDIR@/jabber.xml"
+command_args="-B -c $required_files 2> /dev/null"
+pidfile="@JABBERD_PIDDIR@/${help_name}.pid"
+jabberd_user="@JABBERD_USER@"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/jabberd14/patches/patch-Makefile.am b/jabberd14/patches/patch-Makefile.am
new file mode 100644
index 0000000000..d91933ce6d
--- /dev/null
+++ b/jabberd14/patches/patch-Makefile.am
@@ -0,0 +1,50 @@
+$NetBSD$
+
+Install configuration files to share/examples/jabberd.
+
+--- Makefile.am.orig	2019-09-29 18:37:09.000000000 +0000
++++ Makefile.am
+@@ -7,15 +7,15 @@ ACLOCAL_AMFLAGS = -I m4
+ 
+ sysconf_DATA = jabber.xml.dist
+ 
+-logdir = $(localstatedir)/log/jabberd
++logdir = @JABBERD_LOGDIR@
+ 
+ log_DATA =
+ 
+-spooldir = $(localstatedir)/spool/jabberd
++spooldir = @JABBERD_SPOOLDIR@
+ 
+ spool_DATA =
+ 
+-rundir = $(localstatedir)/run/jabberd
++rundir = @JABBERD_PIDDIR@
+ 
+ run_DATA =
+ 
+@@ -34,17 +34,17 @@ $(sysconf_DATA):
+ install-data-hook:
+ 	@list='$(sysconf_DATA)'; for p in $$list; do \
+ 	    dest=`echo $$p | sed -e s/.dist//`; \
+-	    if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \
+-		echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \
++	    if test -f $(DESTDIR)@EGDIR@/$$dest; then \
++		echo "$@ will not overwrite existing $(DESTDIR)@EGDIR@/$$dest"; \
+ 	    else \
+-		echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest"; \
+-		$(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest; \
++		echo " $(INSTALL_DATA) $$p $(DESTDIR)@EGDIR@/$$dest"; \
++		$(INSTALL_DATA) $$p $(DESTDIR)@EGDIR@/$$dest; \
+ 	    fi; \
+ 	done
+-	@if test -f $(DESTDIR)$(sysconfdir)/cacerts.pem; then \
+-	    echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/cacerts.pem"; \
++	@if test -f $(DESTDIR)@EGDIR@/cacerts.pem; then \
++	    echo "$@ will not overwrite existing $(DESTDIR)@EGDIR@/cacerts.pem"; \
+ 	else \
+-	    cp cacerts.pem $(DESTDIR)$(sysconfdir)/cacerts.pem; \
++	    cp cacerts.pem $(DESTDIR)@EGDIR@/cacerts.pem; \
+ 	fi;
+ 
+ clean-local:
diff --git a/jabberd14/patches/patch-configure.ac b/jabberd14/patches/patch-configure.ac
new file mode 100644
index 0000000000..35e059366d
--- /dev/null
+++ b/jabberd14/patches/patch-configure.ac
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Fix error due 'gcry_thread_cbs' deprecation warning.
+
+--- configure.ac.orig	2019-09-29 18:37:09.000000000 +0000
++++ configure.ac
+@@ -35,7 +35,7 @@ if test x-$developer = "x-yes" ; then
+ else
+     AC_MSG_RESULT(no)
+ fi
+-CPPFLAGS="$CPPFLAGS -Wall -Werror"
++CPPFLAGS="$CPPFLAGS -Wall -Werror -Wno-deprecated-declarations"
+ 
+ dnl Check for programs
+ AC_PROG_CC
diff --git a/jabberd14/patches/patch-jsm_sessions.cc b/jabberd14/patches/patch-jsm_sessions.cc
new file mode 100644
index 0000000000..e5958c422b
--- /dev/null
+++ b/jabberd14/patches/patch-jsm_sessions.cc
@@ -0,0 +1,57 @@
+$NetBSD$
+
+* Add <stdlib.h> for pseudo-random number generator functions.
+* Replace lrand48_r(3) by rand_r(3).
+
+--- jsm/sessions.cc.orig	2019-09-29 18:37:09.000000000 +0000
++++ jsm/sessions.cc
+@@ -37,6 +37,7 @@
+ 
+ #include <messages.hh>
+ #include <namespaces.hh>
++#include <stdlib.h>
+ 
+ /* forward declarations */
+ void _js_session_start(void *arg);
+@@ -103,26 +104,41 @@ void js_session_route(session s, xmlnode
+  */
+ static void _js_create_session_id(char resultbuffer[9], xht existing_sessions) {
+     static int seeded = 0;
++#if defined(__NetBSD__) || defined(__OpenBSD) || defined(__FreeBSD__) || defined(__DragonFly__)
++    static unsigned int seed;
++#else
+     static struct drand48_data rand_state;
++#endif
+     long int rand_value;
+     int tries = 256;
+ 
+     /* seed the random number generator on the first call */
+     if (!seeded) {
+         struct timeval now;
++#if !(defined(__NetBSD__) || defined(__OpenBSD) || defined(__FreeBSD__) || defined(__DragonFly__))
+         unsigned short int seed_data[3];
++#endif
+ 
+         gettimeofday(&now, NULL);
++#if defined(__NetBSD__) || defined(__OpenBSD) || defined(__FreeBSD__) || defined(__DragonFly__)
++        seed = now.tv_usec;
++        srand(seed);
++#else
+         seed_data[0] = now.tv_sec % 0x10000;
+         seed_data[1] = now.tv_sec / 0x10000;
+         seed_data[2] = now.tv_usec % 0x10000;
+         seed48_r(seed_data, &rand_state);
++#endif
+         seeded = 1;
+     }
+ 
+     /* create an ID, that is not already used */
+     while (tries--) {
++#if defined(__NetBSD__) || defined(__FreeBSD__)
++        rand_value = rand_r(&seed);
++#else
+         lrand48_r(&rand_state, &rand_value);
++#endif
+         snprintf(resultbuffer, 9, "%lx", rand_value);
+ 
+         if (existing_sessions == NULL ||


Home | Main Index | Thread Index | Old Index