Re: com php-src: Fix handling of session user module custom handlers.: NEWS ext/session/mod_user.c

From: Date: Mon, 07 Jul 2014 19:03:21 +0000
Subject: Re: com php-src: Fix handling of session user module custom handlers.: NEWS ext/session/mod_user.c
References: 1 2 3 4  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79300@lists.php.net to get a copy of this message
Yeah, I know what the problem is and am working on a diff. An hour or two, maybe? On Mon, Jul 7, 2014 at 10:34 AM, Ferenc Kovacs <tyra3l@gmail.com> wrote: > Hi Sara, > > do you have any eta when you can look at this? > > > On Mon, Jul 7, 2014 at 2:45 AM, Sara Golemon <php@golemon.com> wrote: >> >> Yikes! These all passed locally. I'll take a look at Travis when I get >> home. >> >> -Sara >> >> > On Jul 6, 2014, at 14:29, Nikita Popov <nikita.ppv@gmail.com> wrote: >> > >> >> On Sun, Jul 6, 2014 at 6:40 PM, Sara Golemon <pollita@php.net> wrote: >> >> Commit: 2d9885c8cbbc2199bac4801eaef7c18c76f28033 >> >> Author: Sara Golemon <pollita@php.net> Thu, 15 May 2014 >> >> 14:00:15 -0700 >> >> Parents: 5b925824edf3edc951fc41608d5cbd07a0baab08 >> >> Branches: master >> >> >> >> Link: >> >> >> >> http://git.php.net/?p=php-src.git;a=commitdiff;h=2d9885c8cbbc2199bac4801eaef7c18c76f28033 >> >> >> >> Log: >> >> Fix handling of session user module custom handlers. >> >> >> >> According to the documentation, returning TRUE from >> >> user based session handlers should indicate success, >> >> while returning FALSE should indicate failure. >> >> >> >> The existing logic relied on casting the return value >> >> to an integer and returning that from the function. >> >> However, the internal handlers use SUCCESS/FAILURE >> >> where SUCCESS == 0, and FAILURE == -1, so the following >> >> behavior map occurs: >> >> >> >> return false; => return 0; => return SUCCESS >> >> return true; => return 1; => return <undefined> >> >> >> >> Since the session API checks against FAILURE, >> >> both boolean responses wind up appearing like "not FAILURE". >> >> >> >> This diff reasserts boolean responses to behave as >> >> documented and introduces some special handling >> >> for integer responses of 0 and -1 so that code can be >> >> written for older and newer versions of PHP. >> > >> > After this changeset, the following tests fail on Travis >> > (https://travis-ci.org/php/php-src/builds/29257323): >> > >> > Bug #60634 (Segmentation fault when trying to die() in >> > SessionHandler::write()) - fatal error in write during exec >> > [ext/session/tests/bug60634_error_1.phpt] >> > Bug #60634 (Segmentation fault when trying to die() in >> > SessionHandler::write()) - exception in write during exec >> > [ext/session/tests/bug60634_error_2.phpt] >> > Test session_module_name() function : variation >> > [ext/session/tests/session_module_name_variation3.phpt] >> > Test session_set_save_handler() function : basic functionality >> > [ext/session/tests/session_set_save_handler_basic.phpt] >> > Test session_set_save_handler() : full handler implementation >> > [ext/session/tests/session_set_save_handler_class_002.phpt] >> > Test session_set_save_handler() : incomplete implementation >> > [ext/session/tests/session_set_save_handler_class_005.phpt] >> > Test session_set_save_handler() : incorrect arguments for existing >> > handler open [ext/session/tests/session_set_save_handler_class_012.phpt] >> > Test session_set_save_handler() function: class with create_sid >> > [ext/session/tests/session_set_save_handler_class_016.phpt] >> > Test session_set_save_handler() function: class with create_sid >> > [ext/session/tests/session_set_save_handler_class_017.phpt] >> > Test session_set_save_handler() function : using closures as callbacks >> > [ext/session/tests/session_set_save_handler_closures.phpt] >> > Test session_set_save_handler() function : error functionality >> > [ext/session/tests/session_set_save_handler_error3.phpt] >> > Test session_set_save_handler() function : error functionality >> > [ext/session/tests/session_set_save_handler_error4.phpt] >> > Test session_set_save_handler() function: interface >> > [ext/session/tests/session_set_save_handler_iface_001.phpt] >> > Test session_set_save_handler() function : variation >> > [ext/session/tests/session_set_save_handler_variation4.phpt] >> > Test session_set_save_handler() function : test write short circuit >> > [ext/session/tests/session_set_save_handler_write_short_circuit.phpt] >> > >> > Could you please take a look? >> > >> > Nikita >> > > > > > > -- > Ferenc Kovács > @Tyr43l - http://tyrael.hu

« previous php.cvs (#79300) next »