afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2010-01-30 09:33 am

[dw-free] uniq cookie should not be an option

[commit: http://hg.dwscoalition.org/dw-free/rev/c94773f1ac38]

http://bugs.dwscoalition.org/show_bug.cgi?id=2283

Remove from config files and documentation; remove checks (uniq cookies are
now always enabled)

Patch by [staff profile] denise.

Files modified:
  • bin/maint/clean_caches.pl
  • cgi-bin/Apache/LiveJournal.pm
  • cgi-bin/LJ/ConfCheck/General.pm
  • cgi-bin/LJ/UniqCookie.pm
  • cgi-bin/LJ/Widget/CreateAccount.pm
  • doc/raw/build/ljconfig/ljconfig2db.pl
  • etc/config.pl
--------------------------------------------------------------------------------
diff -r 8c0cf5fc17ff -r c94773f1ac38 bin/maint/clean_caches.pl
--- a/bin/maint/clean_caches.pl	Sat Jan 30 07:41:12 2010 +0000
+++ b/bin/maint/clean_caches.pl	Sat Jan 30 09:32:28 2010 +0000
@@ -32,10 +32,8 @@
     print "-I- Cleaning commenturl.\n";
     $dbh->do("DELETE FROM commenturls WHERE timecreate < UNIX_TIMESTAMP() - 86400*30 LIMIT 50000");
 
-    if ($LJ::UNIQ_COOKIES) {
-        print "-I- Cleaning underage uniqs.\n";
-        $dbh->do("DELETE FROM underage WHERE timeof < (UNIX_TIMESTAMP() - 86400*90) LIMIT 2000");
-    }
+    print "-I- Cleaning underage uniqs.\n";
+    $dbh->do("DELETE FROM underage WHERE timeof < (UNIX_TIMESTAMP() - 86400*90) LIMIT 2000");
 
     print "-I- Cleaning captcha sessions.\n";
     foreach my $c (@LJ::CLUSTERS) {
diff -r 8c0cf5fc17ff -r c94773f1ac38 cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm	Sat Jan 30 07:41:12 2010 +0000
+++ b/cgi-bin/Apache/LiveJournal.pm	Sat Jan 30 09:32:28 2010 +0000
@@ -303,19 +303,17 @@ sub trans
         }
 
         # handle uniq cookies
-        if ($LJ::UNIQ_COOKIES) {
+        # this will ensure that we have a correct cookie value
+        # and also add it to $r->notes
+        LJ::UniqCookie->ensure_cookie_value;
 
-            # this will ensure that we have a correct cookie value
-            # and also add it to $r->notes
-            LJ::UniqCookie->ensure_cookie_value;
+        # apply sysban block if applicable
+        if ( LJ::UniqCookie->sysban_should_block ) {
+            $r->handler( "perl-script" );
+            $r->push_handlers( PerlResponseHandler => \&blocked_bot );
+            return OK;
+            }
 
-            # apply sysban block if applicable
-            if (LJ::UniqCookie->sysban_should_block) {
-                $r->handler("perl-script");
-                $r->push_handlers(PerlResponseHandler => \&blocked_bot );
-                return OK;
-            }
-        }
 
         # this is a fancy transform - basically, if the file exists with a BML extension,
         # then assume we're trying to get to it.  (this allows us to write URLs without the
diff -r 8c0cf5fc17ff -r c94773f1ac38 cgi-bin/LJ/ConfCheck/General.pm
--- a/cgi-bin/LJ/ConfCheck/General.pm	Sat Jan 30 07:41:12 2010 +0000
+++ b/cgi-bin/LJ/ConfCheck/General.pm	Sat Jan 30 09:32:28 2010 +0000
@@ -788,7 +788,6 @@ my %bools = (
              'USER_VHOSTS' => "Let (at least some) users get *.\$USER_DOMAIN URLs.  They'll also need the 'userdomain' cap.",
              'USER_EMAIL' => "Let (at least some) users get email aliases on the site.  They'll also need the 'useremail' cap.  See also \$USER_DOMAIN",
              'USERPIC_BLOBSERVER' => "Store userpics on the 'blobserver'.  This is old.  MogileFS is the future.  You might want to use this option, though, for development, as blobserver in local-filesystem-mode is easy to setup.",
-             'UNIQ_COOKIES' => "Give each user a unique session cookie, unrelated to their login session cookie.",
              'TOS_CHECK' => 'Make users agree to the Terms of Service.',
              'TRACK_URL_ACTIVE' => "record in memcached what URL a given host/pid is working on",
              'TRUST_X_HEADERS' => "LiveJournal should trust the upstream's X-Forwarded-For and similar headers.  Default is off (for direct connection to the net).  If behind your own reverse proxies, you should enable this.",
diff -r 8c0cf5fc17ff -r c94773f1ac38 cgi-bin/LJ/UniqCookie.pm
--- a/cgi-bin/LJ/UniqCookie.pm	Sat Jan 30 07:41:12 2010 +0000
+++ b/cgi-bin/LJ/UniqCookie.pm	Sat Jan 30 09:32:28 2010 +0000
@@ -225,7 +225,6 @@ sub is_disabled {
     my $remote = LJ::get_remote();
     my $uniq   = $class->current_uniq;
 
-    return 1 unless $LJ::UNIQ_COOKIES;
     return ! LJ::is_enabled('uniq_mapping', $remote, $uniq);
 }
 
diff -r 8c0cf5fc17ff -r c94773f1ac38 cgi-bin/LJ/Widget/CreateAccount.pm
--- a/cgi-bin/LJ/Widget/CreateAccount.pm	Sat Jan 30 07:41:12 2010 +0000
+++ b/cgi-bin/LJ/Widget/CreateAccount.pm	Sat Jan 30 09:32:28 2010 +0000
@@ -417,12 +417,11 @@ sub handle_post {
     # age checking to determine how old they are
     my $uniq;
     my $is_underage = 0;
-    if ($LJ::UNIQ_COOKIES) {
-        $uniq = DW::Request->get->note('uniq');
-        if ($uniq) {
-            my $timeof = $dbh->selectrow_array('SELECT timeof FROM underage WHERE uniq = ?', undef, $uniq);
-            $is_underage = 1 if $timeof && $timeof > 0;
-        }
+
+    $uniq = DW::Request->get->note('uniq');
+    if ($uniq) {
+        my $timeof = $dbh->selectrow_array('SELECT timeof FROM underage WHERE uniq = ?', undef, $uniq);
+        $is_underage = 1 if $timeof && $timeof > 0;
     }
 
     my ($year, $mon, $day) = ( $post->{bday_yyyy}+0, $post->{bday_mm}+0, $post->{bday_dd}+0 );
diff -r 8c0cf5fc17ff -r c94773f1ac38 doc/raw/build/ljconfig/ljconfig2db.pl
--- a/doc/raw/build/ljconfig/ljconfig2db.pl	Sat Jan 30 07:41:12 2010 +0000
+++ b/doc/raw/build/ljconfig/ljconfig2db.pl	Sat Jan 30 09:32:28 2010 +0000
@@ -90,9 +90,6 @@ my %ljconfig =
                     'example' => "(
         'morphese',
         );",
-            },
-            'uniq_cookies' => {
-                    'desc' => "Set this boolean value to true, to give users a unique session cookie, unrelated to their login session cookie, to help fight abuse.",
             },
         },
 
diff -r 8c0cf5fc17ff -r c94773f1ac38 etc/config.pl
--- a/etc/config.pl	Sat Jan 30 07:41:12 2010 +0000
+++ b/etc/config.pl	Sat Jan 30 09:32:28 2010 +0000
@@ -62,7 +62,6 @@
     ###
 
     $TOS_CHECK = 0;     # require users to agree to TOS
-    $UNIQ_COOKIES = 1;  # give users uniq cookies to help fight abuse
 
     %REQUIRED_TOS =
         (
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org