Changeset 341


Ignore:
Timestamp:
May 11, 2011, 9:34:15 PM (14 years ago)
Author:
katerina
Message:

Fix for ticket #250: Compile error if option --enable-udp is used

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r323 r341  
    1212dnl start
    1313dnl
    14 AM_INIT_AUTOMAKE(samhain, 2.8.3a)
     14AM_INIT_AUTOMAKE(samhain, 2.8.4a)
    1515AC_DEFINE([SAMHAIN], 1, [Application is samhain])
    1616AC_CANONICAL_HOST
  • trunk/docs/Changelog

    r333 r341  
     12.8.4a:
     2        * Fix for compile error with --enable-udp (reported by Sean Chittenden)
     3
    142.8.4:
     5        * Fix another reload bug in the log monitoring module
    26        * Add unit tests for IgnoreAdded/IgnoreDeleted configuration directives
    37        * Fix deadlock after reload when compiled with --enable-login-watch
  • trunk/src/sh_forward.c

    r315 r341  
    57745774   * should be no problem as long as  sizeof(struct sockaddr_in) < INT_MAX ...
    57755775   */
    5776   int                fromlen = sizeof(from);
     5776  unsigned int fromlen = sizeof(from);
    57775777
    57785778  if (enable_syslog_socket == S_FALSE)
     
    57915791  res = recvfrom(fd,  buf,  1047, 0, (struct sockaddr *) &from, &fromlen);
    57925792
    5793   sh_ipvx_save(&ss, sa->sa_family, &from);
     5793  sh_ipvx_save(&ss, sa->sa_family, (struct sockaddr *) &from);
    57945794  sh_ipvx_ntoa(namebuf, sizeof(namebuf), &ss);
    57955795
     
    58555855      tmp = sh_tools_safe_name (ptr, 1);
    58565856      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_INET_SYSLOG,
    5857                       my_inet_ntoa(from.sin_addr),
     5857                      namebuf,
    58585858                      (cfac == NULL) ? _("none") : cfac,
    58595859                      (cpri == NULL) ? _("none") : cpri,
     
    59595959  if (callerFlag == S_FALSE)
    59605960    {
    5961       if (enable_syslog_socket == S_FALSE && syslog_sock >= 0)
     5961      if (enable_syslog_socket == S_FALSE && syslog_sock_n > 0)
    59625962        {
    59635963          /* user does not wish to use this facility
    59645964           */
    59655965          TPT(( 0, FIL__, __LINE__, _("msg=<close syslog socket>\n")));
    5966           sl_close_fd(FIL__, __LINE__, syslog_sock);
    5967           syslog_sock[0] = -1;
     5966          for (sock = 0; sock < syslog_sock_n; ++sock)
     5967            {
     5968              sl_close_fd(FIL__, __LINE__, syslog_sock[sock]);
     5969              syslog_sock[0] = -1;
     5970            }
    59685971        }
    59695972      SL_RETURN((-1), _("create_syslog_socket"));
     
    59785981  addr.sin_port        = htons(514);
    59795982 
    5980   do_syslog_socket(AF_INET, SOCK_DGRAM, 0, (struct sockaddr *) &addr, addrlen);
     5983  sock = do_syslog_socket(AF_INET, SOCK_DGRAM, 0,
     5984                          (struct sockaddr *) &addr, addrlen);
    59815985
    59825986  if (sock >= 0) {
     
    59915995  if (getaddrinfo (NULL, "syslog", &hints, &ai) != 0)
    59925996    {
    5993       errnum = errno;
     5997      int errnum = errno;
    59945998      sh_forward_printerr (_("getaddrinfo"), errnum, 514, __LINE__);
    5995       sl_close_fd (FIL__, __LINE__, sock);
    59965999      SL_RETURN((-1), _("create_syslog_socket"));
    59976000    }
     
    60196022    }
    60206023  freeaddrinfo (ai);
    6021 #endif
    60226024
    60236025 end:
     6026#endif
    60246027  if (syslog_sock_n > 1)
    60256028    SH_MINSOCK += (syslog_sock_n - 1);
  • trunk/src/sh_restrict.c

    r310 r341  
    591591  CuAssertPtrNotNull(tc, sh_restrict_list);
    592592
     593#if !defined(HOST_IS_CYGWIN)
    593594  res = sh_restrict_this("/bin/sh", 1000, 0755, fd);
    594595  CuAssertIntEquals(tc,1,res);
     596#endif
    595597
    596598  sl_close(fd);
  • trunk/test/testcompile.sh

    r279 r341  
    765765        # test client/server compilation
    766766        #
    767         TEST="${S}client/server application w/o srp${E}"
    768         #
    769         if test -r "Makefile"; then
    770                 $MAKE clean
    771         fi
    772         #
    773         ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
     767        TEST="${S}client/server application w/o srp, w/udp${E}"
     768        #
     769        if test -r "Makefile"; then
     770                $MAKE clean
     771        fi
     772        #
     773        ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-udp --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
    774774        #
    775775        let "num = num + 1" >/dev/null
     
    858858        # test  client/server compilation w/logwatch
    859859        #
    860         TEST="${S}client/server application w/login-watch${E}"
    861         #
    862         if test -r "Makefile"; then
    863                 $MAKE clean
    864         fi
    865         #
    866         ${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log 
    867         #
    868         let "num = num + 1" >/dev/null
    869         testmake $? $num || let "numfail = numfail + 1" >/dev/null
    870         let "num = num + 1" >/dev/null
    871         run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
    872         let "num = num + 1" >/dev/null
    873         run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
    874         #
    875         if test -r "Makefile"; then
    876                 $MAKE clean
    877         fi
    878         #
    879         ${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log 
     860        TEST="${S}client/server application w/login-watch,udp,no_ipv6${E}"
     861        #
     862        if test -r "Makefile"; then
     863                $MAKE clean
     864        fi
     865        #
     866        ${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-udp --disable-ipv6 --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log 
     867        #
     868        let "num = num + 1" >/dev/null
     869        testmake $? $num || let "numfail = numfail + 1" >/dev/null
     870        let "num = num + 1" >/dev/null
     871        run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
     872        let "num = num + 1" >/dev/null
     873        run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
     874        #
     875        if test -r "Makefile"; then
     876                $MAKE clean
     877        fi
     878        #
     879        ${TOP_SRCDIR}/configure --quiet --enable-network=client  --disable-ipv6 --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log 
    880880        #
    881881        let "num = num + 1" >/dev/null
Note: See TracChangeset for help on using the changeset viewer.