lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev cookie config in lynx.cfg -- needed?


From: brian j pardy
Subject: lynx-dev cookie config in lynx.cfg -- needed?
Date: Tue, 16 Feb 1999 17:46:01 -0800

I've come across a small buglet in the way that COOKIE_ACCEPT_DOMAINS
and similar options are handled when they are set in both .lynxrc and
lynx.cfg.

If a domain is set in lynx.cfg, and Lynx writes the .lynxrc file, that
domain will be included in this setting in .lynxrc, and upon the next
Lynx startup, will set the flag on this domain twice.  Each time Lynx
re-writes the .lynxrc file, another copy of the domains included in
lynx.cfg will be written to .lynxrc.

I never use any of these in lynx.cfg -- does anyone else?  It may be
unnecessary bloat to have them in there, and I think I'd rather remove
them if nobody wants them.  I understand the reasons one may want
them, so I'm hesitant to just rip them out without asking first.

Here's a bit of a patch to make a new internal variable which will
handle these when they're set in lynx.cfg so that they won't show up
duplicated in .lynxrc.  This may be nasty to apply -- this against
dev.16, but I've changed this code in similar places with other
patches that also needs to be included.

Basically I created a duplicate copy of LYCookieAcceptDomains and all
the similar variables, except named as LYCookieSAcceptDomains, and so
on.  After setting the flags, the system-set copies of these variables
are FREE()'d.  This patch uses my old functions to set the flags at the
end of LYReadCFG.c -- this is only because I wanted to make this patch
against dev.16, instead of dev.16+the other patches.

Ugh, what I'm writing looks very unclear to me -- here's how I want
this area of LYReadCFG.c to look.  Just yell at me if it doesn't make 
sense.

    if (LYCookieSAcceptDomains != NULL) {
        cookie_domain_flag_set(LYCookieSAcceptDomains, FLAG_ACCEPT_ALWAYS);
        FREE(LYCookieSAcceptDomains);
    }

    if (LYCookieSRejectDomains != NULL) {
        cookie_domain_flag_set(LYCookieSRejectDomains, FLAG_REJECT_ALWAYS);
        FREE(LYCookieSRejectDomains);
    }

    if (LYCookieSStrictCheckDomains != NULL) {
        cookie_domain_flag_set(LYCookieSStrictCheckDomains, 
FLAG_INVCHECK_STRICT);
        FREE(LYCookieSStrictCheckDomains);
    }

    if (LYCookieSLooseCheckDomains != NULL) {
        cookie_domain_flag_set(LYCookieSLooseCheckDomains, FLAG_INVCHECK_LOOSE);
        FREE(LYCookieSLooseCheckDomains);
    }

    if (LYCookieSQueryCheckDomains != NULL) {
        cookie_domain_flag_set(LYCookieSQueryCheckDomains, FLAG_INVCHECK_QUERY);
        FREE(LYCookieSQueryCheckDomains);
    }

Anyways, here's the patch:


diff -cr 2.8.2dev.16/src/LYGlobalDefs.h 2.8.2dev.16.bri/src/LYGlobalDefs.h
*** 2.8.2dev.16/src/LYGlobalDefs.h      Mon Feb  8 02:32:59 1999
--- 2.8.2dev.16.bri/src/LYGlobalDefs.h  Tue Feb 16 17:14:32 1999
***************
*** 317,322 ****
--- 317,327 ----
  extern char *LYCookieStrictCheckDomains; /* domains to check strictly    */
  extern char *LYCookieLooseCheckDomains; /* domains to check loosely      */
  extern char *LYCookieQueryCheckDomains; /* domains to check w/a query    */
+ extern char *LYCookieSAcceptDomains;    /* domains to accept all cookies */
+ extern char *LYCookieSRejectDomains;    /* domains to reject all cookies */
+ extern char *LYCookieSStrictCheckDomains;/* domains to check strictly    */
+ extern char *LYCookieSLooseCheckDomains;/* domains to check loosely      */
+ extern char *LYCookieSQueryCheckDomains;/* domains to check w/a query    */
  #ifdef EXP_PERSISTENT_COOKIES
  extern BOOLEAN persistent_cookies;
  extern char *LYCookieFile;              /* file to store cookies in      */
diff -cr 2.8.2dev.16/src/LYMain.c 2.8.2dev.16.bri/src/LYMain.c
*** 2.8.2dev.16/src/LYMain.c    Mon Feb  8 02:32:59 1999
--- 2.8.2dev.16.bri/src/LYMain.c        Tue Feb 16 17:37:29 1999
***************
*** 344,349 ****
--- 344,354 ----
  PUBLIC char *LYCookieStrictCheckDomains = NULL; /* check strictly  */
  PUBLIC char *LYCookieLooseCheckDomains = NULL;  /* check loosely   */
  PUBLIC char *LYCookieQueryCheckDomains = NULL;  /* check w/a query */
+ PUBLIC char *LYCookieSAcceptDomains = NULL; /* domains to accept all cookies 
*/
+ PUBLIC char *LYCookieSRejectDomains = NULL; /* domains to reject all cookies 
*/
+ PUBLIC char *LYCookieSStrictCheckDomains = NULL; /* check strictly  */
+ PUBLIC char *LYCookieSLooseCheckDomains = NULL;  /* check loosely   */
+ PUBLIC char *LYCookieSQueryCheckDomains = NULL;  /* check w/a query */
  #ifdef EXP_PERSISTENT_COOKIES
  BOOLEAN persistent_cookies = TRUE;
  PUBLIC char *LYCookieFile = NULL;          /* default cookie file */
diff -cr 2.8.2dev.16/src/LYReadCFG.c 2.8.2dev.16.bri/src/LYReadCFG.c
*** 2.8.2dev.16/src/LYReadCFG.c Mon Feb  8 02:32:59 1999
--- 2.8.2dev.16.bri/src/LYReadCFG.c     Tue Feb 16 17:13:59 1999
***************
*** 855,868 ****
  #ifdef USE_COLOR_TABLE
       PARSE_FUN("color", CONF_FUN, color_fun),
  #endif
!      PARSE_STR("cookie_accept_domains", CONF_STR, LYCookieAcceptDomains),
  #ifdef EXP_PERSISTENT_COOKIES
       PARSE_STR("cookie_file", CONF_STR, LYCookieFile),
  #endif /* EXP_PERSISTENT_COOKIES */
!      PARSE_STR("cookie_loose_invalid_domains", CONF_STR, 
LYCookieLooseCheckDomains),
!      PARSE_STR("cookie_query_invalid_domains", CONF_STR, 
LYCookieQueryCheckDomains),
!      PARSE_STR("cookie_reject_domains", CONF_STR, LYCookieRejectDomains),
!      PARSE_STR("cookie_strict_invalid_domains", CONF_STR, 
LYCookieStrictCheckDomains),
       PARSE_ENV("cso_proxy", CONF_ENV, 0 ),
  #ifdef VMS
       PARSE_STR("CSWING_PATH", CONF_STR, LYCSwingPath),
--- 855,868 ----
  #ifdef USE_COLOR_TABLE
       PARSE_FUN("color", CONF_FUN, color_fun),
  #endif
!      PARSE_STR("cookie_accept_domains", CONF_STR, LYCookieSAcceptDomains),
  #ifdef EXP_PERSISTENT_COOKIES
       PARSE_STR("cookie_file", CONF_STR, LYCookieFile),
  #endif /* EXP_PERSISTENT_COOKIES */
!      PARSE_STR("cookie_loose_invalid_domains", CONF_STR, 
LYCookieSLooseCheckDomains),
!      PARSE_STR("cookie_query_invalid_domains", CONF_STR, 
LYCookieSQueryCheckDomains),
!      PARSE_STR("cookie_reject_domains", CONF_STR, LYCookieSRejectDomains),
!      PARSE_STR("cookie_strict_invalid_domains", CONF_STR, 
LYCookieSStrictCheckDomains),
       PARSE_ENV("cso_proxy", CONF_ENV, 0 ),
  #ifdef VMS
       PARSE_STR("CSWING_PATH", CONF_STR, LYCSwingPath),
***************
*** 1292,1315 ****
       * And for query/strict/loose invalid cookie checking. - BJP
       */
  
!     if (LYCookieAcceptDomains != NULL) {
!       cookie_add_acceptlist(LYCookieAcceptDomains);
      }
  
!     if (LYCookieRejectDomains != NULL) {
!       cookie_add_rejectlist(LYCookieRejectDomains);
      }
  
!     if (LYCookieStrictCheckDomains != NULL) {
!       cookie_set_invcheck(LYCookieStrictCheckDomains, INVCHECK_STRICT);
      }
  
!     if (LYCookieLooseCheckDomains != NULL) {
!       cookie_set_invcheck(LYCookieLooseCheckDomains, INVCHECK_LOOSE);
      }
  
!     if (LYCookieQueryCheckDomains != NULL) {
!       cookie_set_invcheck(LYCookieQueryCheckDomains, INVCHECK_QUERY);
      }
  
  }
--- 1292,1320 ----
       * And for query/strict/loose invalid cookie checking. - BJP
       */
  
!     if (LYCookieSAcceptDomains != NULL) {
!       cookie_add_acceptlist(LYCookieSAcceptDomains);
!       FREE(LYCookieSAcceptDomains);
      }
  
!     if (LYCookieSRejectDomains != NULL) {
!       cookie_add_rejectlist(LYCookieSRejectDomains);
!       FREE(LYCookieSRejectDomains);
      }
  
!     if (LYCookieSStrictCheckDomains != NULL) {
!       cookie_set_invcheck(LYCookieSStrictCheckDomains, INVCHECK_STRICT);
!       FREE(LYCookieSStrictCheckDomains);
      }
  
!     if (LYCookieSLooseCheckDomains != NULL) {
!       cookie_set_invcheck(LYCookieSLooseCheckDomains, INVCHECK_LOOSE);
!       FREE(LYCookieSLooseCheckDomains);
      }
  
!     if (LYCookieSQueryCheckDomains != NULL) {
!       cookie_set_invcheck(LYCookieSQueryCheckDomains, INVCHECK_QUERY);
!       FREE(LYCookieSQueryCheckDomains);
      }
  
  }


-- 
System going down at 1:45 this afternoon for disk crashing.

reply via email to

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