On 2019/02/12 19:48, Giannis Tsaraias wrote:
> Hello,
> 
> Here's a diff to update ngircd to 25. Changelog:
> https://raw.githubusercontent.com/ngircd/ngircd/master/ChangeLog
> 
> Passes all tests. Manually tested with SSL as well.
> 
> Looking for feedback and OKs.

Please use https for ngircd.barton.de and run update-patches.

The newly added MaxPenaltyTime is a time_t (64-bit on all OpenBSD arches)
but is accessed as a long which will break on 32-bit arches; the visible
warning indicating this is here:

conf.c:391:37: warning: format specifies type 'long' but the argument has type 
'time_t' (aka 'long long') [-Wforma
t]
        printf("  MaxPenaltyTime = %ld\n", Conf_MaxPenaltyTime);
                                   ~~~     ^~~~~~~~~~~~~~~~~~~
                                   %lld

The attached replacement for patch-src_ngircd_conf_c should fix that.
$OpenBSD: patch-src_ngircd_conf_c,v 1.5 2014/12/03 10:32:18 jasper Exp $
Index: src/ngircd/conf.c
--- src/ngircd/conf.c.orig
+++ src/ngircd/conf.c
@@ -388,7 +388,7 @@ Conf_Test( void )
        printf("  MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
        printf("  MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
        printf("  MaxNickLength = %u\n", Conf_MaxNickLength - 1);
-       printf("  MaxPenaltyTime = %ld\n", Conf_MaxPenaltyTime);
+       printf("  MaxPenaltyTime = %lld\n", (long long)Conf_MaxPenaltyTime);
        printf("  MaxListSize = %d\n", Conf_MaxListSize);
        printf("  PingTimeout = %d\n", Conf_PingTimeout);
        printf("  PongTimeout = %d\n", Conf_PongTimeout);
@@ -757,7 +757,7 @@ Set_Defaults(bool InitServers)
        strlcat(Conf_HelpFile, HELP_FILE, sizeof(Conf_HelpFile));
        strcpy(Conf_ServerPwd, "");
        strlcpy(Conf_PidFile, PID_FILE, sizeof(Conf_PidFile));
-       Conf_UID = Conf_GID = 0;
+       Conf_UID = Conf_GID = 703;      /* _ngircd */
 
        /* Limits */
        Conf_ConnectRetry = 60;
@@ -1644,7 +1644,7 @@ Handle_LIMITS(const char *File, int Line, char *Var, c
                return;
        }
        if (strcasecmp(Var, "MaxPenaltyTime") == 0) {
-               Conf_MaxPenaltyTime = atol(Arg);
+               Conf_MaxPenaltyTime = atoll(Arg);
                if (Conf_MaxPenaltyTime < -1)
                        Conf_MaxPenaltyTime = -1;       /* "unlimited" */
                return;
@@ -2291,8 +2291,8 @@ Validate_Config(bool Configtest, bool Rehash)
 
        if (Conf_MaxPenaltyTime != -1)
                Config_Error(LOG_WARNING,
-                            "Maximum penalty increase ('MaxPenaltyTime') is 
set to %ld, this is not recommended!",
-                            Conf_MaxPenaltyTime);
+                            "Maximum penalty increase ('MaxPenaltyTime') is 
set to %lld, this is not recommended!",
+                            (long long)Conf_MaxPenaltyTime);
 
 #ifdef DEBUG
        servers = servers_once = 0;

Reply via email to