lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV Authorization Fix for Lynx 2.8


From: Sam Horrocks
Subject: LYNX-DEV Authorization Fix for Lynx 2.8
Date: Tue, 07 Apr 1998 21:36:57 -0700

I ran into a problem with lynx 2.8, where if I authenticate myself
to a web server, and then later on visit that same web server but
with some characters in the hostname of a different case (for instance
capitalized instead of lower-case), lynx won't recognize it as being
the same server, and it will again prompt me to authenticate.

For example, if I bring up:
    
    http://www.protected.com

and authenticate myself and then later on follow a link to:

    http://www.Protected.Com

then Lynx will not recognize it as being the same server, and will
prompt me again to authenticate.

This problem is annoying to me, but much worse for the people who are
using a script that I wrote that attempts to hide the authentication
details by using "-auth" on the command line.

I double-checked RFC 1034 and it says:

    domain names can be stored with arbitrary case, but domain name
    comparisons for all present domain functions are done in a
    case-insensitive manner, assuming an ASCII character set,

Enclosed is a patch to make the server name comparison case-insensitive.
Hope you can roll this into a future version of Lynx:

*** WWW/Library/Implementation/HTAABrow.c.orig  Fri Jan 16 11:29:28 1998
--- WWW/Library/Implementation/HTAABrow.c       Tue Apr  7 21:07:57 1998
***************
*** 261,266 ****
--- 261,279 ----
      }
  }
  
+ PRIVATE int strcmp_ignore_case ARGS2(
+       CONST char *,   s1,
+       CONST char *,   s2)
+ {
+ #define LCASE(c) ((c) >= 'A' && (c) <= 'Z' ? ((c) + ('a' - 'A')) : (c))
+     int d;
+ 
+     while ((d = LCASE(*s1) - LCASE(*s2)) == 0 && *s1++ && *s2++)
+       ;
+     return d;
+ #undef LCASE
+ }
+ 
  /* PRIVATE                                            HTAAServer_lookup()
  **            LOOK UP SERVER BY HOSTNAME AND PORTNUMBER
  ** ON ENTRY:
***************
*** 289,295 ****
  
        while (NULL != (server = (HTAAServer*)HTList_nextObject(cur))) {
            if (server->portnumber == portnumber  &&
!               0==strcmp(server->hostname, hostname) &&
                server->IsProxy == IsProxy)
                return server;
        }
--- 302,308 ----
  
        while (NULL != (server = (HTAAServer*)HTList_nextObject(cur))) {
            if (server->portnumber == portnumber  &&
!               0==strcmp_ignore_case(server->hostname, hostname) &&
                server->IsProxy == IsProxy)
                return server;
        }

reply via email to

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