Imported Upstream version 1.2.9
Michael Biebl
8 years ago
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] | |
0 | 8 | ---------------------------------------------------------------------- |
1 | 9 | Version 1.2.8 - 2014-09-07 |
2 | 10 | - bugfix: segfault if KEEPALIVE is used |
0 | 0 | #! /bin/sh |
1 | 1 | # 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. | |
3 | 3 | # |
4 | 4 | # Report bugs to <rgerhards@adiscon.com>. |
5 | 5 | # |
589 | 589 | # Identity of this package. |
590 | 590 | PACKAGE_NAME='librelp' |
591 | 591 | 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' | |
594 | 594 | PACKAGE_BUGREPORT='rgerhards@adiscon.com' |
595 | 595 | PACKAGE_URL='' |
596 | 596 | |
1322 | 1322 | # Omit some internal or obsolete options to make the list less imposing. |
1323 | 1323 | # This message is too long to be a string in the A/UX 3.1 sh. |
1324 | 1324 | 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. | |
1326 | 1326 | |
1327 | 1327 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1328 | 1328 | |
1392 | 1392 | |
1393 | 1393 | if test -n "$ac_init_help"; then |
1394 | 1394 | 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:";; | |
1396 | 1396 | esac |
1397 | 1397 | cat <<\_ACEOF |
1398 | 1398 | |
1507 | 1507 | test -n "$ac_init_help" && exit $ac_status |
1508 | 1508 | if $ac_init_version; then |
1509 | 1509 | cat <<\_ACEOF |
1510 | librelp configure 1.2.8 | |
1510 | librelp configure 1.2.9 | |
1511 | 1511 | generated by GNU Autoconf 2.69 |
1512 | 1512 | |
1513 | 1513 | Copyright (C) 2012 Free Software Foundation, Inc. |
2033 | 2033 | This file contains any messages produced by compilers while |
2034 | 2034 | running configure, to aid debugging if configure makes a mistake. |
2035 | 2035 | |
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 | |
2037 | 2037 | generated by GNU Autoconf 2.69. Invocation command line was |
2038 | 2038 | |
2039 | 2039 | $ $0 $@ |
2896 | 2896 | |
2897 | 2897 | # Define the identity of the package. |
2898 | 2898 | PACKAGE='librelp' |
2899 | VERSION='1.2.8' | |
2899 | VERSION='1.2.9' | |
2900 | 2900 | |
2901 | 2901 | |
2902 | 2902 | cat >>confdefs.h <<_ACEOF |
3010 | 3010 | |
3011 | 3011 | # Define the identity of the package. |
3012 | 3012 | PACKAGE='librelp' |
3013 | VERSION='1.2.8' | |
3013 | VERSION='1.2.9' | |
3014 | 3014 | |
3015 | 3015 | |
3016 | 3016 | cat >>confdefs.h <<_ACEOF |
13341 | 13341 | # report actual input values of CONFIG_FILES etc. instead of their |
13342 | 13342 | # values after options handling. |
13343 | 13343 | 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 | |
13345 | 13345 | generated by GNU Autoconf 2.69. Invocation command line was |
13346 | 13346 | |
13347 | 13347 | CONFIG_FILES = $CONFIG_FILES |
13407 | 13407 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
13408 | 13408 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
13409 | 13409 | ac_cs_version="\\ |
13410 | librelp config.status 1.2.8 | |
13410 | librelp config.status 1.2.9 | |
13411 | 13411 | configured by $0, generated by GNU Autoconf 2.69, |
13412 | 13412 | with options \\"\$ac_cs_config\\" |
13413 | 13413 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.61) |
4 | AC_INIT([librelp], [1.2.8], [rgerhards@adiscon.com]) | |
4 | AC_INIT([librelp], [1.2.9], [rgerhards@adiscon.com]) | |
5 | 5 | AM_INIT_AUTOMAKE |
6 | 6 | AM_INIT_AUTOMAKE |
7 | 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
989 | 989 | * at the top of the list! |
990 | 990 | */ |
991 | 991 | 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); | |
993 | 998 | } else if(!strcmp((char*)pFrame->cmd, "rsp")) { |
994 | 999 | CHKRet(relpSCRsp(pFrame, pSess)); |
995 | 1000 | } else if(!strcmp((char*)pFrame->cmd, "open")) { |
298 | 298 | ENTER_RELPFUNC; |
299 | 299 | RELPOBJ_assert(pThis, Sess); |
300 | 300 | |
301 | CHKRet(relpSendqSend(pThis->pSendq, pThis->pTcp)); | |
301 | if (pThis->sessState != eRelpSessState_BROKEN) { | |
302 | CHKRet(relpSendqSend(pThis->pSendq, pThis->pTcp)); | |
303 | } | |
302 | 304 | |
303 | 305 | finalize_it: |
304 | 306 | LEAVE_RELPFUNC; |
535 | 537 | "fd %d, timeout %d.%d\n", sock, (int) tvSelect.tv_sec, |
536 | 538 | (int) tvSelect.tv_usec); |
537 | 539 | 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); | |
540 | 551 | if(relpEngineShouldStop(pThis->pEngine)) |
541 | 552 | break; |
542 | 553 | /* we don't check if we had a timeout-we give it one last chance*/ |
552 | 563 | |
553 | 564 | finalize_it: |
554 | 565 | 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)) { | |
556 | 569 | /* the session is broken! */ |
557 | 570 | pThis->sessState = eRelpSessState_BROKEN; |
558 | 571 | } |
993 | 1006 | relpSessSetGnuTLSPriString(relpSess_t *pThis, char *pristr) |
994 | 1007 | { |
995 | 1008 | ENTER_RELPFUNC; |
996 | RELPOBJ_assert(pThis, Tcp); | |
1009 | RELPOBJ_assert(pThis, Sess); | |
997 | 1010 | |
998 | 1011 | free(pThis->pristring); |
999 | 1012 | if(pristr == NULL) { |
1010 | 1023 | relpSessSetCACert(relpSess_t *pThis, char *cert) |
1011 | 1024 | { |
1012 | 1025 | ENTER_RELPFUNC; |
1013 | RELPOBJ_assert(pThis, Tcp); | |
1026 | RELPOBJ_assert(pThis, Sess); | |
1014 | 1027 | |
1015 | 1028 | free(pThis->caCertFile); |
1016 | 1029 | if(cert == NULL) { |
1027 | 1040 | relpSessSetOwnCert(relpSess_t *pThis, char *cert) |
1028 | 1041 | { |
1029 | 1042 | ENTER_RELPFUNC; |
1030 | RELPOBJ_assert(pThis, Tcp); | |
1043 | RELPOBJ_assert(pThis, Sess); | |
1031 | 1044 | |
1032 | 1045 | free(pThis->ownCertFile); |
1033 | 1046 | if(cert == NULL) { |
1044 | 1057 | relpSessSetPrivKey(relpSess_t *pThis, char *cert) |
1045 | 1058 | { |
1046 | 1059 | ENTER_RELPFUNC; |
1047 | RELPOBJ_assert(pThis, Tcp); | |
1060 | RELPOBJ_assert(pThis, Sess); | |
1048 | 1061 | |
1049 | 1062 | free(pThis->privKeyFile); |
1050 | 1063 | if(cert == NULL) { |
315 | 315 | pEngine = pThis->pEngine; |
316 | 316 | assert(pAddr != NULL); |
317 | 317 | |
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)); | |
322 | 321 | strcpy((char*)szHname, "???"); |
323 | 322 | strcpy((char*)szIP, "???"); |
324 | 323 | ABORT_FINALIZE(RELP_RET_INVALID_HNAME); |
325 | 324 | } |
326 | 325 | |
327 | 326 | 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); | |
329 | 328 | if(error == 0) { |
330 | 329 | memset (&hints, 0, sizeof (struct addrinfo)); |
331 | 330 | hints.ai_flags = AI_NUMERICHOST; |
684 | 683 | RELP_RET_WRN_NO_KEEPALIVE); |
685 | 684 | } |
686 | 685 | |
687 | pThis->pEngine->dbgprint("KEEPALIVE enabled for socket %d\n", sock); | |
686 | // pThis->pEngine->dbgprint("KEEPALIVE enabled for socket %d\n", sock); | |
688 | 687 | |
689 | 688 | done: |
690 | 689 | return; |
33 | 33 | #define RELPTCP_H_INCLUDED |
34 | 34 | |
35 | 35 | #include <stdint.h> |
36 | #include <gnutls/gnutls.h> | |
36 | #ifdef ENABLE_TLS | |
37 | # include <gnutls/gnutls.h> | |
38 | #endif | |
37 | 39 | #include "relp.h" |
38 | 40 | |
39 | 41 | typedef enum { relpTCP_RETRY_none = 0, |
101 | 103 | int dhBits; /**< number of bits for Diffie-Hellman key */ |
102 | 104 | char *pristring; /**< priority string for GnuTLS */ |
103 | 105 | relpAuthMode_t authmode; |
106 | #ifdef ENABLE_TLS | |
104 | 107 | gnutls_anon_client_credentials_t anoncred; /**< client anon credentials */ |
105 | 108 | gnutls_anon_server_credentials_t anoncredSrv; /**< server anon credentials */ |
109 | #endif | |
106 | 110 | tcpPermittedPeers_t permittedPeers; |
107 | 111 | /* GnuTLS certificat support */ |
112 | #ifdef ENABLE_TLS | |
108 | 113 | gnutls_certificate_credentials_t xcred; /**< certificate credentials */ |
114 | #endif | |
109 | 115 | char *caCertFile; |
110 | 116 | char *ownCertFile; |
111 | 117 | char *privKeyFile; |
118 | #ifdef ENABLE_TLS | |
112 | 119 | gnutls_session_t session; |
113 | 120 | gnutls_dh_params_t dh_params; /**< server DH parameters for anon mode */ |
121 | #endif | |
114 | 122 | relpTcpRtryState_t rtryOp; |
115 | 123 | } relpTcp_t; |
116 | 124 |