Przeglądaj źródła

* time_t is signed, not unsigned. Fixed.
-Should fix timesync, we'll see.
* Added stuff to cmd_debug for figuring out if timesync is fixed.
* Possibly fixed some cookie-ops issues


svn: 831

Bryan Drewery 22 lat temu
rodzic
commit
43a889a45f

+ 3 - 2
src/botcmd.c

@@ -825,8 +825,9 @@ static void bot_buildts(int idx, char *par)
 
 static void bot_timesync(int idx, char *par)
 {
-  putlog(LOG_DEBUG, "@", "Got timesync from %s: %s", dcc[idx].nick, par);
-  timesync = atoi(par) - now;
+  putlog(LOG_DEBUG, "@", "Got timesync from %s: %s (%li - %li)", dcc[idx].nick, par, atol(par), now);
+  timesync = atol(par) - now;
+
 #ifdef HUB
   send_timesync(-1);
 #endif /* HUB */

+ 24 - 6
src/cmds.c

@@ -539,7 +539,7 @@ static void cmd_motd(struct userrec *u, int idx, char *par)
 
     s = malloc(strlen(par) + 1 + strlen(dcc[idx].nick) + 10 + 1 + 1); /* +2: ' 'x2 */
 
-    sprintf(s, "%s %lu %s", dcc[idx].nick, now, par);
+    sprintf(s, "%s %li %s", dcc[idx].nick, now, par);
     set_cfg_str(NULL, "motd", s);
     free(s);
     dprintf(idx, "Motd set\n");
@@ -559,7 +559,7 @@ static void cmd_about(struct userrec *u, int idx, char *par)
   dprintf(idx, STR("Wraith botpack by bryan\n"));
   egg_strftime(c, sizeof c, "%c %Z", gmtime(&buildts));
   dprintf(idx, STR("Version: %s\n"), egg_version);
-  dprintf(idx, STR("Build: %s (%lu)\n"), c, buildts);
+  dprintf(idx, STR("Build: %s (%li)\n"), c, buildts);
   dprintf(idx, STR("(written from a base of Eggdrop 1.6.12)\n"));
   dprintf(idx, STR("..with credits and thanks to the following:\n"));
   dprintf(idx, STR(" \n"));
@@ -1287,8 +1287,10 @@ static void cmd_console(struct userrec *u, int idx, char *par)
 static void cmd_date(struct userrec *u, int idx, char *par)
 {
   char date[50] = "", utctime[50] = "", ltime[50] = "";
+  time_t hub;
 
   putlog(LOG_CMDS, "*", "#%s# date", dcc[idx].nick);
+
   egg_strftime(date, sizeof date, "%c %Z", localtime(&now));
 #ifndef S_UTCTIME
   sprintf(ltime, "<-- This time is used on the bot.");
@@ -1299,6 +1301,10 @@ static void cmd_date(struct userrec *u, int idx, char *par)
   sprintf(utctime, "<-- This time is used on the bot.");
 #endif /* S_UTCTIME */
   dprintf(idx, "%s %s\n", date, (utctime && utctime[0]) ? utctime : "");
+  
+  hub = now + timesync;
+  egg_strftime(date, sizeof date, "%c %Z", gmtime(&hub));
+  dprintf(idx, "%s <-- Botnet uses this\n", date);
 }
 
 #ifdef HUB
@@ -1879,8 +1885,20 @@ static void cmd_die(struct userrec *u, int idx, char *par)
 
 static void cmd_debug(struct userrec *u, int idx, char *par)
 {
+  char *cmd = NULL;
+
   putlog(LOG_CMDS, "*", STR("#%s# debug"), dcc[idx].nick);
-  tell_netdebug(idx);
+
+  if (par[0])
+    cmd = newsplit(&par);
+  if (!strcmp(cmd, "timesync") || !cmd)
+    dprintf(idx, "Timesync: %li (%li)\n", now + timesync, timesync);
+  if (!strcmp(cmd, "now") || !cmd)
+    dprintf(idx, "Now: %li\n", now);
+  if (!strcmp(cmd, "role") || !cmd)
+    dprintf(idx, "Role: %d\n", role);
+  if (!strcmp(cmd, "net") || !cmd)
+    tell_netdebug(idx);
 }
 
 static void cmd_timers(struct userrec *u, int idx, char *par)
@@ -3018,7 +3036,7 @@ static void cmd_newleaf(struct userrec *u, int idx, char *par)
       bi->hublevel = 0;
       set_user(&USERENTRY_BOTADDR, u1, bi);
       /* set_user(&USERENTRY_PASS, u1, SALT2); */
-      sprintf(tmp, STR("%lu %s"), now, u->handle);
+      sprintf(tmp, "%li %s", now, u->handle);
       set_user(&USERENTRY_ADDED, u1, tmp);
       dprintf(idx, STR("Added new leaf: %s\n"), handle);
       while (par[0]) {
@@ -3186,7 +3204,7 @@ static void cmd_pls_user(struct userrec *u, int idx, char *par)
 
     userlist = adduser(userlist, handle, host, "-", USER_DEFAULT);
     u2 = get_user_by_handle(userlist, handle);
-    sprintf(tmp, STR("%lu %s"), now, u->handle);
+    sprintf(tmp, "%li %s", now, u->handle);
     set_user(&USERENTRY_ADDED, u2, tmp);
     dprintf(idx, STR("Added %s (%s) with no flags.\n"), handle, host);
     while (par[0]) {
@@ -3582,7 +3600,7 @@ static void cmd_netlag(struct userrec * u, int idx, char * par) {
   
   timer_get_now(&tv);
   tm = (tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000);
-  sprintf(tmp, STR("ping %lu"), tm);
+  sprintf(tmp, "ping %li", tm);
   dprintf(idx, STR("Sent ping to all linked bots\n"));
   botnet_send_cmd_broad(-1, conf.bot->nick, u->handle, idx, tmp);
 }

+ 10 - 12
src/dcc.c

@@ -40,7 +40,7 @@
 
 
 struct dcc_t *dcc = NULL;	/* DCC list				   */
-int	timesync = 0;
+time_t	timesync = 0;
 int	dcc_total = 0;		/* Total dcc's				   */
 char	network[41] = "EFnet"; /* Name of the IRC network you're on  */
 
@@ -192,25 +192,23 @@ static void strip_telnet(int sock, char *buf, int *len)
 }
 void send_timesync(int idx)
 {
+#ifdef HUB
   /* Send timesync to idx, or all lower bots if idx<0 */
   if (idx >= 0)
-    dprintf(idx, "ts %li\n", (timesync + now));
+    dprintf(idx, "ts %li\n", timesync + now);
   else {
-#ifdef HUB
     char s[30] = "";
     int i;
 
-    sprintf(s, ("ts %li\n"), (timesync + now));
+    sprintf(s, "ts %li\n", timesync + now);
     for (i = 0; i < dcc_total; i++) {
       if ((dcc[i].type == &DCC_BOT) && (bot_aggressive_to(dcc[i].user))) {
         dprintf(i, s);
         lower_bot_linked(i);
       }
     }
-#else /* !HUB */
-    putlog(LOG_ERRORS, "*", "I'm a leaf - where should i send timesync?");
-#endif /* HUB */
   }
+#endif /* HUB */
 }
 
 
@@ -444,7 +442,7 @@ static void timeout_dcc_bot_new(int idx)
 
 static void display_dcc_bot_new(int idx, char *buf)
 {
-  sprintf(buf, "bot*  waited %lus", now - dcc[idx].timeval);
+  sprintf(buf, "bot*  waited %lis", now - dcc[idx].timeval);
 }
 
 static void free_dcc_bot_(int n, void *x)
@@ -725,7 +723,7 @@ static void tout_dcc_chat_secpass(int idx)
 
 static void display_dcc_chat_secpass(int idx, char *buf)
 {
-  sprintf(buf, "secpass  waited %lus", now - dcc[idx].timeval);
+  sprintf(buf, "secpass  waited %lis", now - dcc[idx].timeval);
 }
 
 static void tout_dcc_chat_pass(int idx)
@@ -737,7 +735,7 @@ static void tout_dcc_chat_pass(int idx)
 
 static void display_dcc_chat_pass(int idx, char *buf)
 {
-  sprintf(buf, "pass  waited %lus", now - dcc[idx].timeval);
+  sprintf(buf, "pass  waited %lis", now - dcc[idx].timeval);
 }
 
 static void kill_dcc_general(int idx, void *x)
@@ -1572,7 +1570,7 @@ static void timeout_dcc_telnet_id(int idx)
 
 static void display_dcc_telnet_id(int idx, char *buf)
 {
-  sprintf(buf, "t-in  waited %lus", now - dcc[idx].timeval);
+  sprintf(buf, "t-in  waited %lis", now - dcc[idx].timeval);
 }
 
 struct dcc_table DCC_TELNET_ID =
@@ -1661,7 +1659,7 @@ void eof_dcc_identwait(int idx)
 
 static void display_dcc_identwait(int idx, char *buf)
 {
-  sprintf(buf, "idtw  waited %lus", now - dcc[idx].timeval);
+  sprintf(buf, "idtw  waited %lis", now - dcc[idx].timeval);
 }
 
 struct dcc_table DCC_IDENTWAIT =

+ 2 - 1
src/dcc.h

@@ -206,7 +206,8 @@ struct dupwait_info {
 #define TLN_ECHO_C      "\001"
 
 extern struct dcc_t 		*dcc;
-extern int 			dcc_total, timesync;
+extern int 			dcc_total;
+extern time_t			timesync;
 extern char			network[];
 
 extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_BOT_NEW,

+ 1 - 1
src/dns.c

@@ -42,7 +42,7 @@ void eof_dcc_dnswait(int idx)
 
 static void display_dcc_dnswait(int idx, char *buf)
 {
-  sprintf(buf, "dns   waited %lus", now - dcc[idx].timeval);
+  sprintf(buf, "dns   waited %lis", now - dcc[idx].timeval);
 }
 
 static void kill_dcc_dnswait(int idx, void *x)

+ 1 - 1
src/mod/channels.mod/channels.c

@@ -302,7 +302,7 @@ void rebalance_roles()
         ba = get_user(&USERENTRY_BOTADDR, dcc[i].user);
         if (ba && (ba->roleid == (hNdx + 1))) {
           ba->roleid = lNdx + 1;
-          sprintf(tmp, STR("rl %d %li"), lNdx + 1, (timesync + now));
+          sprintf(tmp, "rl %d %li", lNdx + 1, timesync + now);
           putbot(dcc[i].nick, tmp);
         }
       }

+ 1 - 1
src/mod/channels.mod/cmdschan.c

@@ -1458,7 +1458,7 @@ static void cmd_pls_chan(struct userrec *u, int idx, char *par)
       free(tmp);
 
       tmp = calloc(1, 7 + 1 + 10 + 1);
-      sprintf(tmp, "addedts %lu", now);
+      sprintf(tmp, "addedts %li", now);
       do_chanset(NULL, chan, tmp, DO_LOCAL | DO_NET );
       free(tmp);
     }

+ 6 - 6
src/mod/channels.mod/userchan.c

@@ -443,11 +443,11 @@ int u_addban(struct chanset_t *chan, char *ban, char *from, char *note, time_t e
 
     if (mask) {
       if (!chan)
-	shareout(NULL, "+b %s %lu %s%s %s %s\n", mask, expire_time - now,
+	shareout(NULL, "+b %s %li %s%s %s %s\n", mask, expire_time - now,
 		 (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p" : "-", from, note);
       else
-	shareout(chan, "+bc %s %lu %s %s%s %s %s\n", mask, expire_time - now,
+	shareout(chan, "+bc %s %li %s %s%s %s %s\n", mask, expire_time - now,
 		 chan->dname, (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p" : "-", from, note);
       free(mask);
@@ -520,11 +520,11 @@ int u_addinvite(struct chanset_t *chan, char *invite, char *from, char *note, ti
 
     if (mask) {
       if (!chan)
-	shareout(NULL, "+inv %s %lu %s%s %s %s\n", mask, expire_time - now,
+	shareout(NULL, "+inv %s %li %s%s %s %s\n", mask, expire_time - now,
 		 (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p": "-", from, note);
       else
-	shareout(chan, "+invc %s %lu %s %s%s %s %s\n", mask, expire_time - now,
+	shareout(chan, "+invc %s %li %s %s%s %s %s\n", mask, expire_time - now,
 		 chan->dname, (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p": "-", from, note);
       free(mask);
@@ -597,11 +597,11 @@ int u_addexempt(struct chanset_t *chan, char *exempt, char *from, char *note, ti
 
     if (mask) {
       if (!chan)
-	shareout(NULL, "+e %s %lu %s%s %s %s\n", mask, expire_time - now,
+	shareout(NULL, "+e %s %li %s%s %s %s\n", mask, expire_time - now,
 		 (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p": "-", from, note);
       else
-	shareout(chan, "+ec %s %lu %s %s%s %s %s\n", mask, expire_time - now,
+	shareout(chan, "+ec %s %li %s %s%s %s %s\n", mask, expire_time - now,
 		 chan->dname, (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p": "-", from, note);
       free(mask);

+ 4 - 4
src/mod/irc.mod/cmdsirc.c

@@ -1307,11 +1307,11 @@ static void cmd_channel(struct userrec *u, int idx, char *par)
       } else {
 	/* Determine idle time */
 	if (now - (m->last) > 86400)
-	  egg_snprintf(s1, sizeof s1, "%2lud", ((now - (m->last)) / 86400));
+	  egg_snprintf(s1, sizeof s1, "%2lid", ((now - (m->last)) / 86400));
 	else if (now - (m->last) > 3600)
-	  egg_snprintf(s1, sizeof s1, "%2luh", ((now - (m->last)) / 3600));
+	  egg_snprintf(s1, sizeof s1, "%2lih", ((now - (m->last)) / 3600));
 	else if (now - (m->last) > 180)
-	  egg_snprintf(s1, sizeof s1, "%2lum", ((now - (m->last)) / 60));
+	  egg_snprintf(s1, sizeof s1, "%2lim", ((now - (m->last)) / 60));
 	else
 	  strncpyz(s1, "   ", sizeof s1);
 	egg_snprintf(format, sizeof format, "%%c%%c%%-%us %%-%us %%s %%c   %%d %%s  %%s\n", 
@@ -1500,7 +1500,7 @@ static void cmd_adduser(struct userrec *u, int idx, char *par)
   if (!u) {
     userlist = adduser(userlist, hand, p1, "-", USER_DEFAULT);
     u = get_user_by_handle(userlist, hand);
-    sprintf(tmp, STR("%lu %s"), now, dcc[idx].nick);
+    sprintf(tmp, STR("%li %s"), now, dcc[idx].nick);
     set_user(&USERENTRY_ADDED, u, tmp);
     make_rand_str(s2, 15);
     set_user(&USERENTRY_PASS, u, s2);

+ 13 - 21
src/mod/irc.mod/mode.c

@@ -1311,8 +1311,8 @@ static int gotmode(char *from, char *msg)
 
       if (chan && me_op(chan) && ops && (ufrom) && (ufrom->flags & USER_BOT) && !channel_fastop(chan) && !channel_take(chan)) {
         int isbadop = 0;
-        if ((modecnt != 2) || (strncmp(modes[0], "+o", 2)) ||
-            (strncmp(modes[1], "-b", 2))) {
+
+        if ((modecnt != 2) || (strncmp(modes[0], "+o", 2)) || (strncmp(modes[1], "-b", 2))) {
           isbadop = 1;
         } else {
           char enccookie[25] = "", plaincookie[25] = "", key[NICKLEN + 20] = "", goodcookie[25] = "";
@@ -1320,18 +1320,9 @@ static int gotmode(char *from, char *msg)
           /* -b *!*@[...] */
           strncpyz(enccookie, (char *) &(modes[1][8]), sizeof(enccookie));
           p = enccookie + strlen(enccookie) - 1;
-/* old shit 
-          *p = 0;
-          while (p - enccookie < 24) {
-            *p++ = '.';
-            *p = 0;
-          }
-*/
           strcpy(key, nfrom);
           strcat(key, SALT2);
-/* putlog(LOG_DEBUG, "*", "Decrypting cookie: %s with key %s", enccookie, key); */
           p = decrypt_string(key, enccookie);
-/* putlog(LOG_DEBUG, "*", "Decrypted cookie: %s", p); */
           strncpyz(plaincookie, p, sizeof(plaincookie));
           free(p);
           /*
@@ -1340,23 +1331,22 @@ static int gotmode(char *from, char *msg)
            * last 5 regular chars of chan
            */
           makeplaincookie(chan->dname, (char *) (modes[0] + 3), goodcookie);
-/* putlog(LOG_DEBUG, "*", "cookie from %s: %s should be: %s", nfrom, plaincookie, goodcookie); */
           if (strncmp((char *) &plaincookie[6], (char *) &goodcookie[6], 5))
             isbadop = 2;
           else if (strncmp((char *) &plaincookie[11], (char *) &goodcookie[11], 5))
             isbadop = 3;
           else {
             char ltmp[20] = "";
-            long optime;
-            int off;
+            time_t optime, off;
 
-            sprintf(ltmp, STR("%010li"), (now + timesync));
+            /* this makes NO sense, optime should just be ltmp[4]-... but its not... ??? */
+            sprintf(ltmp, "%010li", now + timesync);
             strncpyz((char *) &ltmp[4], plaincookie, 7);
             optime = atol(ltmp);
             off = (now + timesync - optime);
 
             if (abs(off) > OP_TIME_SLACK) {
-/*            isbadop = 4; */
+              /* isbadop = 4; */
               putlog(LOG_DEBUG, "*", "%s opped with bad ts (not punishing.): %li was off by %li", nfrom, optime, off);
             }
           }
@@ -1364,6 +1354,7 @@ static int gotmode(char *from, char *msg)
         if (isbadop) {
           char trg[NICKLEN] = "";
 
+          putlog(LOG_DEBUG, "*", "%s opped in %s with bad cookie(%d): %s", nfrom, chan->dname, isbadop, msg);
           n = i = 0;
           switch (role) {
           case 0:
@@ -1372,12 +1363,12 @@ static int gotmode(char *from, char *msg)
             /* Kick opper */
             m = ismember(chan, nfrom);
             if (!m || !chan_sentkick(m)) {
-              sprintf(tmp, STR("KICK %s %s :%s%s\n"), chan->name, nfrom, kickprefix, kickreason(KICK_BADOP));
+              sprintf(tmp, "KICK %s %s :%s%s\n", chan->name, nfrom, kickprefix, kickreason(KICK_BADOP));
               tputs(serv, tmp, strlen(tmp));
               if (m)
                 m->flags |= SENTKICK;
             }
-            sprintf(tmp, STR("%s MODE %s"), from, msg);
+            sprintf(tmp, "%s MODE %s", from, msg);
             deflag_user(ufrom, DEFLAG_BADCOOKIE, tmp, chan);
             break;
           default:
@@ -1395,7 +1386,7 @@ static int gotmode(char *from, char *msg)
               if (m) {
                 if (!(m->flags & CHANOP)) {
                   if (!chan_sentkick(m)) {
-                    sprintf(tmp, STR("KICK %s %s :%s%s\n"), chan->name, trg, kickprefix, kickreason(KICK_BADOPPED));
+                    sprintf(tmp, "KICK %s %s :%s%s\n", chan->name, trg, kickprefix, kickreason(KICK_BADOPPED));
                     tputs(serv, tmp, strlen(tmp));
                     m->flags |= SENTKICK;
                   }
@@ -1403,6 +1394,7 @@ static int gotmode(char *from, char *msg)
               }
             }
           }
+
           if (isbadop == 1)
             putlog(LOG_WARN, "*", STR("Missing cookie: %s MODE %s"), from, msg);
           else if (isbadop == 2)
@@ -1414,8 +1406,8 @@ static int gotmode(char *from, char *msg)
         } else
           putlog(LOG_DEBUG, "@", STR("Good op: %s"), msg);
       }
-      if ((ops) && chan && me_op(chan) && !channel_manop(chan) && (ufrom) &&
-          !(ufrom->flags & USER_BOT)) {
+
+      if ((ops) && chan && me_op(chan) && !channel_manop(chan) && (ufrom) && !(ufrom->flags & USER_BOT)) {
         char trg[NICKLEN] = "";
 
         n = i = 0;

+ 2 - 3
src/mod/notes.mod/notes.c

@@ -293,8 +293,7 @@ int storenote(char *argv1, char *argv2, char *argv3, int idx, char *who, int buf
 	  else if (argv1[0] == '@')
 	    from = p + 1;
 	}
-	fprintf(f, "%s %s %lu %s%s\n", to, from, now,
-		l ? work : "", argv3);
+	fprintf(f, "%s %s %li %s%s\n", to, from, now, l ? work : "", argv3);
 	fclose(f);
 	if (idx >= 0)
 	  dprintf(idx, "%s.\n", "Stored message");
@@ -649,7 +648,7 @@ static int msg_notes(char *nick, char *host, struct userrec *u, char *par)
       return 1;
     }
     chmod(notefile, userfile_perm);	/* Use userfile permissions. */
-    fprintf(f, "%s %s %lu %s\n", to, u->handle, now, par);
+    fprintf(f, "%s %s %li %s\n", to, u->handle, now, par);
     fclose(f);
     dprintf(DP_HELP, "NOTICE %s :%s\n", nick, NOTES_DELIVERED);
     return 1;

+ 1 - 1
src/mod/server.mod/server.c

@@ -1383,7 +1383,7 @@ static void server_5minutely()
       putlog(LOG_SERV, "*", IRC_SERVERSTONED);
     } else if (!trying_server) {
       /* Check for server being stoned. */
-      dprintf(DP_MODE, "PING :%lu\n", (unsigned long) now);
+      dprintf(DP_MODE, "PING :%li\n", now);
       waiting_for_awake = 1;
     }
   }

+ 2 - 2
src/mod/share.mod/share.c

@@ -1104,7 +1104,7 @@ static void share_ufsend(int idx, char *par)
   int i, sock;
   FILE *f = NULL;
 
-  egg_snprintf(s, sizeof s, "%s.share.%s.%lu.users", tempdir, conf.bot->nick, now);
+  egg_snprintf(s, sizeof s, "%s.share.%s.%li.users", tempdir, conf.bot->nick, now);
   if (!(b_status(idx) & STAT_SHARE)) {
     dprintf(idx, "s e You didn't ask; you just started sending.\n");
     dprintf(idx, "s e Ask before sending the userfile.\n");
@@ -1913,7 +1913,7 @@ static void start_sending_users(int idx)
   struct chanuserrec *ch = NULL;
   struct chanset_t *cst = NULL;
 
-  egg_snprintf(share_file, sizeof share_file, "%s.share.%s.%lu", tempdir, dcc[idx].nick, now);
+  egg_snprintf(share_file, sizeof share_file, "%s.share.%s.%li", tempdir, dcc[idx].nick, now);
   if (dcc[idx].u.bot->uff_flags & UFF_OVERRIDE) {
     debug1("NOTE: Sharing aggressively with %s, overriding its local bots.",
 	   dcc[idx].nick);

+ 1 - 1
src/userent.c

@@ -477,7 +477,7 @@ void update_mod(char *handle, char *nick, char *cmd, char *par)
 {
   char tmp[100] = "";
 
-  egg_snprintf(tmp, sizeof tmp, "%lu, %s (%s %s)", now, nick, cmd, (par && par[0]) ? par : "");
+  egg_snprintf(tmp, sizeof tmp, "%li, %s (%s %s)", now, nick, cmd, (par && par[0]) ? par : "");
   set_user(&USERENTRY_MODIFIED, get_user_by_handle(userlist, handle), tmp);
 }
 

+ 1 - 2
src/users.c

@@ -139,8 +139,7 @@ void addignore(char *ign, char *from, char *mnote, time_t expire_time)
     char *mask = str_escape(ign, ':', '\\');
 
     if (mask) {
-      shareout(NULL, STR("+i %s %lu %c %s %s\n"), mask, expire_time - now,
-	       (p->flags & IGREC_PERM) ? 'p' : '-', from, mnote);
+      shareout(NULL, STR("+i %s %li %c %s %s\n"), mask, expire_time - now, (p->flags & IGREC_PERM) ? 'p' : '-', from, mnote);
       free(mask);
     }
   }

+ 2 - 1
src/utc-time.c

@@ -6,7 +6,8 @@
 
 int main() {
   time_t now = time(NULL);
-  printf("%lu\n", mktime(gmtime(&now)));
+
+  printf("%li\n", mktime(gmtime(&now)));
   return 0;
 }