Codebase list librelp / upstream/1.2.9
Imported Upstream version 1.2.9 Michael Biebl 8 years ago
7 changed file(s) with 61 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
0 ----------------------------------------------------------------------
1 Version 1.2.9 - 2015-12-15
2 - bugfix: Ignoring return status when handling syslog frames now.
3 Otherwise valid messages in the frame buffer will get lost when the
4 remote connection is closed during meantime.
5 - build bugfix: GnuTLS header was required even if TLS was turned off
6 Thanks to Pedro Alvarez Piedehierro for the patch.
7 - bugfix: correct wrong assert() calls [debug mode only affected]
08 ----------------------------------------------------------------------
19 Version 1.2.8 - 2014-09-07
210 - bugfix: segfault if KEEPALIVE is used
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for librelp 1.2.8.
2 # Generated by GNU Autoconf 2.69 for librelp 1.2.9.
33 #
44 # Report bugs to <rgerhards@adiscon.com>.
55 #
589589 # Identity of this package.
590590 PACKAGE_NAME='librelp'
591591 PACKAGE_TARNAME='librelp'
592 PACKAGE_VERSION='1.2.8'
593 PACKAGE_STRING='librelp 1.2.8'
592 PACKAGE_VERSION='1.2.9'
593 PACKAGE_STRING='librelp 1.2.9'
594594 PACKAGE_BUGREPORT='rgerhards@adiscon.com'
595595 PACKAGE_URL=''
596596
13221322 # Omit some internal or obsolete options to make the list less imposing.
13231323 # This message is too long to be a string in the A/UX 3.1 sh.
13241324 cat <<_ACEOF
1325 \`configure' configures librelp 1.2.8 to adapt to many kinds of systems.
1325 \`configure' configures librelp 1.2.9 to adapt to many kinds of systems.
13261326
13271327 Usage: $0 [OPTION]... [VAR=VALUE]...
13281328
13921392
13931393 if test -n "$ac_init_help"; then
13941394 case $ac_init_help in
1395 short | recursive ) echo "Configuration of librelp 1.2.8:";;
1395 short | recursive ) echo "Configuration of librelp 1.2.9:";;
13961396 esac
13971397 cat <<\_ACEOF
13981398
15071507 test -n "$ac_init_help" && exit $ac_status
15081508 if $ac_init_version; then
15091509 cat <<\_ACEOF
1510 librelp configure 1.2.8
1510 librelp configure 1.2.9
15111511 generated by GNU Autoconf 2.69
15121512
15131513 Copyright (C) 2012 Free Software Foundation, Inc.
20332033 This file contains any messages produced by compilers while
20342034 running configure, to aid debugging if configure makes a mistake.
20352035
2036 It was created by librelp $as_me 1.2.8, which was
2036 It was created by librelp $as_me 1.2.9, which was
20372037 generated by GNU Autoconf 2.69. Invocation command line was
20382038
20392039 $ $0 $@
28962896
28972897 # Define the identity of the package.
28982898 PACKAGE='librelp'
2899 VERSION='1.2.8'
2899 VERSION='1.2.9'
29002900
29012901
29022902 cat >>confdefs.h <<_ACEOF
30103010
30113011 # Define the identity of the package.
30123012 PACKAGE='librelp'
3013 VERSION='1.2.8'
3013 VERSION='1.2.9'
30143014
30153015
30163016 cat >>confdefs.h <<_ACEOF
1334113341 # report actual input values of CONFIG_FILES etc. instead of their
1334213342 # values after options handling.
1334313343 ac_log="
13344 This file was extended by librelp $as_me 1.2.8, which was
13344 This file was extended by librelp $as_me 1.2.9, which was
1334513345 generated by GNU Autoconf 2.69. Invocation command line was
1334613346
1334713347 CONFIG_FILES = $CONFIG_FILES
1340713407 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1340813408 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1340913409 ac_cs_version="\\
13410 librelp config.status 1.2.8
13410 librelp config.status 1.2.9
1341113411 configured by $0, generated by GNU Autoconf 2.69,
1341213412 with options \\"\$ac_cs_config\\"
1341313413
11 # Process this file with autoconf to produce a configure script.
22
33 AC_PREREQ(2.61)
4 AC_INIT([librelp], [1.2.8], [rgerhards@adiscon.com])
4 AC_INIT([librelp], [1.2.9], [rgerhards@adiscon.com])
55 AM_INIT_AUTOMAKE
66 AM_INIT_AUTOMAKE
77 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
989989 * at the top of the list!
990990 */
991991 if(!strcmp((char*)pFrame->cmd, "syslog")) {
992 CHKRet(relpSCSyslog(pFrame, pSess));
992 /* When processing Syslog frames, we ignore return code.
993 * Otherwise valid messages in the frame buffer will be
994 * discarded. And it's better to have duplicated messages
995 * instead of losing them.
996 */
997 relpSCSyslog(pFrame, pSess);
993998 } else if(!strcmp((char*)pFrame->cmd, "rsp")) {
994999 CHKRet(relpSCRsp(pFrame, pSess));
9951000 } else if(!strcmp((char*)pFrame->cmd, "open")) {
298298 ENTER_RELPFUNC;
299299 RELPOBJ_assert(pThis, Sess);
300300
301 CHKRet(relpSendqSend(pThis->pSendq, pThis->pTcp));
301 if (pThis->sessState != eRelpSessState_BROKEN) {
302 CHKRet(relpSendqSend(pThis->pSendq, pThis->pTcp));
303 }
302304
303305 finalize_it:
304306 LEAVE_RELPFUNC;
535537 "fd %d, timeout %d.%d\n", sock, (int) tvSelect.tv_sec,
536538 (int) tvSelect.tv_usec);
537539 nfds = select(sock+1, (fd_set *) &readfds, NULL, NULL, &tvSelect);
538 pThis->pEngine->dbgprint("relpSessWaitRsp select returns, "
539 "nfds %d, errno %d\n", nfds, errno);
540 if(nfds == -1) {
541 if(errno == EINTR) {
542 pThis->pEngine->dbgprint("relpSessWaitRsp select interrupted, continue\n");
543 } else {
544 pThis->pEngine->dbgprint("relpSessWaitRsp select returned error %d\n", errno);
545 ABORT_FINALIZE(RELP_RET_SESSION_BROKEN);
546 }
547 }
548 else
549 pThis->pEngine->dbgprint("relpSessWaitRsp select returns, "
550 "nfds %d, errno %d\n", nfds, errno);
540551 if(relpEngineShouldStop(pThis->pEngine))
541552 break;
542553 /* we don't check if we had a timeout-we give it one last chance*/
552563
553564 finalize_it:
554565 pThis->pEngine->dbgprint("relpSessWaitState returns %d\n", iRet);
555 if(iRet == RELP_RET_TIMED_OUT || relpEngineShouldStop(pThis->pEngine)) {
566 if( iRet == RELP_RET_TIMED_OUT ||
567 iRet == RELP_RET_SESSION_BROKEN ||
568 relpEngineShouldStop(pThis->pEngine)) {
556569 /* the session is broken! */
557570 pThis->sessState = eRelpSessState_BROKEN;
558571 }
9931006 relpSessSetGnuTLSPriString(relpSess_t *pThis, char *pristr)
9941007 {
9951008 ENTER_RELPFUNC;
996 RELPOBJ_assert(pThis, Tcp);
1009 RELPOBJ_assert(pThis, Sess);
9971010
9981011 free(pThis->pristring);
9991012 if(pristr == NULL) {
10101023 relpSessSetCACert(relpSess_t *pThis, char *cert)
10111024 {
10121025 ENTER_RELPFUNC;
1013 RELPOBJ_assert(pThis, Tcp);
1026 RELPOBJ_assert(pThis, Sess);
10141027
10151028 free(pThis->caCertFile);
10161029 if(cert == NULL) {
10271040 relpSessSetOwnCert(relpSess_t *pThis, char *cert)
10281041 {
10291042 ENTER_RELPFUNC;
1030 RELPOBJ_assert(pThis, Tcp);
1043 RELPOBJ_assert(pThis, Sess);
10311044
10321045 free(pThis->ownCertFile);
10331046 if(cert == NULL) {
10441057 relpSessSetPrivKey(relpSess_t *pThis, char *cert)
10451058 {
10461059 ENTER_RELPFUNC;
1047 RELPOBJ_assert(pThis, Tcp);
1060 RELPOBJ_assert(pThis, Sess);
10481061
10491062 free(pThis->privKeyFile);
10501063 if(cert == NULL) {
315315 pEngine = pThis->pEngine;
316316 assert(pAddr != NULL);
317317
318 error = getnameinfo(pAddr, SALEN(pAddr), (char*)szIP, sizeof(szIP), NULL, 0, NI_NUMERICHOST);
319
320 if(error) {
321 pThis->pEngine->dbgprint("Malformed from address %s\n", gai_strerror(error));
318 error = getnameinfo(pAddr, SALEN(pAddr), (char*)szIP, sizeof(szIP), NULL, 0, NI_NUMERICHOST);
319 if(error) {
320 pThis->pEngine->dbgprint("Malformed from address %s\n", gai_strerror(error));
322321 strcpy((char*)szHname, "???");
323322 strcpy((char*)szIP, "???");
324323 ABORT_FINALIZE(RELP_RET_INVALID_HNAME);
325324 }
326325
327326 if(pEngine->bEnableDns) {
328 error = getnameinfo(pAddr, SALEN(pAddr), (char*)szHname, NI_MAXHOST, NULL, 0, NI_NAMEREQD);
327 error = getnameinfo(pAddr, SALEN(pAddr), (char*)szHname, sizeof(szHname), NULL, 0, NI_NAMEREQD);
329328 if(error == 0) {
330329 memset (&hints, 0, sizeof (struct addrinfo));
331330 hints.ai_flags = AI_NUMERICHOST;
684683 RELP_RET_WRN_NO_KEEPALIVE);
685684 }
686685
687 pThis->pEngine->dbgprint("KEEPALIVE enabled for socket %d\n", sock);
686 // pThis->pEngine->dbgprint("KEEPALIVE enabled for socket %d\n", sock);
688687
689688 done:
690689 return;
3333 #define RELPTCP_H_INCLUDED
3434
3535 #include <stdint.h>
36 #include <gnutls/gnutls.h>
36 #ifdef ENABLE_TLS
37 # include <gnutls/gnutls.h>
38 #endif
3739 #include "relp.h"
3840
3941 typedef enum { relpTCP_RETRY_none = 0,
101103 int dhBits; /**< number of bits for Diffie-Hellman key */
102104 char *pristring; /**< priority string for GnuTLS */
103105 relpAuthMode_t authmode;
106 #ifdef ENABLE_TLS
104107 gnutls_anon_client_credentials_t anoncred; /**< client anon credentials */
105108 gnutls_anon_server_credentials_t anoncredSrv; /**< server anon credentials */
109 #endif
106110 tcpPermittedPeers_t permittedPeers;
107111 /* GnuTLS certificat support */
112 #ifdef ENABLE_TLS
108113 gnutls_certificate_credentials_t xcred; /**< certificate credentials */
114 #endif
109115 char *caCertFile;
110116 char *ownCertFile;
111117 char *privKeyFile;
118 #ifdef ENABLE_TLS
112119 gnutls_session_t session;
113120 gnutls_dh_params_t dh_params; /**< server DH parameters for anon mode */
121 #endif
114122 relpTcpRtryState_t rtryOp;
115123 } relpTcp_t;
116124