Fossil

Check-in [5d16ca43]
Login

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

Overview
Comment:Fix a bug in the IP address truncator. Ticket [a09798ba9e].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5d16ca43f192395100f17bb86006b824ceb5547c
User & Date: drh 2009-12-29 20:52:27
References
2010-01-02
21:33 New ticket [6248d17d] file not found. artifact: 3709c36b user: anonymous
2009-12-29
20:53 Fixed ticket [a09798ba]: Bug in ipPrefix (Check-in [86cbb69af2])? plus 2 other changes artifact: 4e3db166 user: drh
Context
2009-12-29
22:10
clean up a few compiler warnings check-in: 97789f0a user: rwilson tags: trunk
20:52
Fix a bug in the IP address truncator. Ticket [a09798ba9e]. check-in: 5d16ca43 user: drh tags: trunk
00:11
Only record the first 16 bits of the 32-bit IP address as part of the anonymous login cookie. check-in: 86cbb69a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/login.c.

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
  int i, j; 
  for(i=j=0; zIP[i]; i++){
    if( zIP[i]=='.' ){
      j++;
      if( j==2 ) break;
    }
  }
  return mprintf("%.*s", j, zIP);
}
        

/*
** Check to see if the anonymous login is valid.  If it is valid, return
** the userid of the anonymous user.
*/







|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
  int i, j; 
  for(i=j=0; zIP[i]; i++){
    if( zIP[i]=='.' ){
      j++;
      if( j==2 ) break;
    }
  }
  return mprintf("%.*s", i, zIP);
}
        

/*
** Check to see if the anonymous login is valid.  If it is valid, return
** the userid of the anonymous user.
*/