2.4.0b3 NEWGROUPS patch.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




2.4.0b3 won't accept NEWGROUPS commands without the following patch.
I'm displaying poor netiquette by including a unified diff in the body of
this message, so that you are encouraged to apply it by hand and check
its logic.  I haven't given it a good thrashing.


--- newgroups.c.orig    Tue Apr 18 09:18:11 2000
+++ newgroups.c Tue Apr 18 11:07:04 2000
@@ -26,11 +26,11 @@
        char dist[128]="";
        int i;
        int t[4];
-       char arg1[9];
+       char arg1[10];
        int len;
        int yr;
        memset(d, 0, sizeof d);
-       if (sscanf(args, "%*s %8s %6s %3s <%127s>", arg1, d+4, gmt, dist)<2)
+       if (sscanf(args, "%*s %9s %6s %3s <%127s>", arg1, d+4, gmt, dist)<2)
        {
 bad:
                emitrn("501 [yy]yymmdd hhmmss [\"GMT\"] [<distributions>]");
@@ -39,15 +39,15 @@
        len = strlen(arg1);
        if (len < 6 || atoi(arg1) == 0)
                goto bad;
-       strncpy(arg1+len-4, d, 4);
+       strncpy(d, arg1+len-4, 4);
        for (i=0; i<4; i++)
                if ((t[i]=c2i(d+2*i))==-1)
                        goto bad;
        /* deal with y2k bugged readers */
-       arg1[len-4] = '0';
+       arg1[len-4] = 0;
        yr = atoi(arg1);
-       if (yr>19100)
-           yr-=1900;
+       if (yr>=19100)
+           yr-=19000;
        if (yr>1900)
                yr-=1900;
        if (yr <70)

-- 
_________________________________________________________________________
Andrew Donkin                  Waikato University, Hamilton,  New Zealand


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux