Fossil

Check-in [9dd6c431]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the anonymous login cookie name to include a hash of the base URL. Ticket [3edef69bf3e995ed2]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9dd6c43185d68d61cfd2a86e60fe189f48e24922
User & Date: drh 2010-11-06 13:52:45
Context
2010-11-06
14:04
Fix the sync logic so that it is able to clone against the canonical fossil repository with its implied redirect. check-in: a921be7b user: drh tags: trunk
13:52
Change the anonymous login cookie name to include a hash of the base URL. Ticket [3edef69bf3e995ed2] check-in: 9dd6c431 user: drh tags: trunk
2010-11-04
19:58
Do not assume that the method is CGI just because the GATEWAY_INTERFACE environment variable is set. Only do CGI if GATEWAY_INTERFACE is set and there either is no argument specified, or the specified argument is not a valid command. Ticket [e49f245975f89a8a9] check-in: dcf839e4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/login.c.

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

/*
** Return the name of the login cookie
*/
static char *login_cookie_name(void){
  static char *zCookieName = 0;
  if( zCookieName==0 ){
    int n = strlen(g.zTop);
    zCookieName = fossil_malloc( n*2+16 );
                      /* 0123456789 12345 */
    strcpy(zCookieName, "fossil_login_");
    encode16((unsigned char*)g.zTop, (unsigned char*)&zCookieName[13], n);
  }
  return zCookieName;
}

/*
** Redirect to the page specified by the "g" query parameter.
** Or if there is no "g" query parameter, redirect to the homepage.







|
|
|
|
<







49
50
51
52
53
54
55
56
57
58
59

60
61
62
63
64
65
66

/*
** Return the name of the login cookie
*/
static char *login_cookie_name(void){
  static char *zCookieName = 0;
  if( zCookieName==0 ){
    unsigned int h = 0;
    const char *z = g.zBaseURL;
    while( *z ){ h = (h<<3) ^ (h>>26) ^ *(z++); }
    zCookieName = mprintf("fossil_login_%08x", h);

  }
  return zCookieName;
}

/*
** Redirect to the page specified by the "g" query parameter.
** Or if there is no "g" query parameter, redirect to the homepage.