gnats-prs
[Top][All Lists]
Advanced

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

gnats/109: gnats 3.113 not compatible with older servers...


From: epeisach
Subject: gnats/109: gnats 3.113 not compatible with older servers...
Date: 16 Oct 2000 14:01:31 -0000

>Number:         109
>Category:       gnats
>Synopsis:       gnats 3.113 not compatible with older servers...
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 16 07:04:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     address@hidden
>Release:        3.113
>Organization:
>Environment:
Sgi running 6.5.5 (but not relevant)
>Description:
I tried firing up 3.113 with an old gnats server (3.99)
and discovered that the server closed the connection with 
the USER command.

I thought this was weird, until I realized that was the
behaviour when the server received an unknown command.

I put together a patch to determine the server version.
If it does not proper version, the user command is not
sent. 

I think maybe their should be an error if the user requested
a non default user (i.e. not anonymous) - but I did not implement.

>How-To-Repeat:

>Fix:
--- gnats-3.113/gnats/client.c.orig     Sat Oct 14 11:19:43 2000
+++ gnats-3.113/gnats/client.c  Sat Oct 14 11:36:20 2000
@@ -54,6 +54,10 @@
 /* The name this program was run with.  */
 extern char *program_name;
 
+/* Server version number. Default to high value */
+#define VERSION(maj, min) (maj * 1000 + min)
+static int server_version = VERSION(9,999);
+
 void
 free_reply (r)
      Reply *r;
@@ -163,6 +167,13 @@
   switch (r->state)
     {
     case CODE_GREETING:
+      /* The first reply line should have a version */
+      p = strstr(r->text, "GNATS server ");
+      if(p) {
+       int maj=0, min=0;
+       if(sscanf(p+13, "%d.%d ready", &maj, &min) ==2)
+         server_version = VERSION(maj, min);
+      }
       while (r->type == REPLY_CONT)
        {
          free_reply (r);
@@ -617,6 +628,9 @@
      char *user;
      char *passwd;
 {
+  if (server_version < VERSION(3, 107)) 
+    return;
+
   /* send the user command and get server's reply */
   if (debug)
     fprintf (stderr, "%s: writing `USER %s %s'\n", program_name,
>Release-Note:
>Audit-Trail:
>Unformatted:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]