Bug #73103 [NEW]: Release 1.1.0 has random behaviour

From: Date: Sat, 17 Sep 2016 11:27:42 +0000
Subject: Bug #73103 [NEW]: Release 1.1.0 has random behaviour
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204092@lists.php.net to get a copy of this message
From:             tvdijen at gmail dot com
Operating system: CentOS 7 + RHEL6
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:Release 1.1.0 has random behaviour

Description:
------------
The doAuthentication-method sometimes fails to return anything
(execution stops).
It actually fails more often than it works. This behaviour started after
updating the krb5-module to the latest release 1.1.0.

I started debugging my php-code by adding debug-lines. It turned out
that code-execution stops at doAuthentication for no obvious reason. No
errors are being displayed or even logged.

See example-code below. When I start IE and run the test-script, it will
fail with a 'Page cannot be displayed'. Apache access log shows that the
page request is received. I can see my own debug-lines in the logs up to
doAuthentication() and then I run into a dead end.
When I repeat the test (close IE completely, start it again en run the
script again), let's say one in ten times it fails.

A rollback to version 1.0.0 of the module fixed everything, so my guess
is that the recent changes have something to do with this random
behaviour. I've seen this behaviour on both RHEL6+PHP5.3 and
CentOS7+PHP5.4

Test script:
---------------
<?php
 if(!extension_loaded('krb5')) {
         die('KRB5 Extension not installed');
 }

 if(!empty($_SERVER['HTTP_AUTHORIZATION'])) {
        list($mech, $data) = explode(' ',
$_SERVER['HTTP_AUTHORIZATION']);
         if(strtolower($mech) == 'basic') {
                 echo "Client sent basic";
                 die('Unsupported request');
         } else if(strtolower($mech) != 'negotiate') {
                 echo "Couldn't find negotiate";
                 die('Unsupported request');
         }
         $auth = new KRB5NegotiateAuth('/path/to/keytab');

         if($reply = $auth->doAuthentication()) {
                 header('HTTP/1.1 200 Success');
                 echo 'Success - authenticated as ' .
$auth->getAuthenticatedUser() . '<br>';
         } else {
                 echo 'Failed to authN.';
                 die();
         }
 } else {
         header('HTTP/1.1 401 Unauthorized');
         header('WWW-Authenticate: Negotiate',false);
         echo 'Not authenticated. No HTTP_AUTHORIZATION available.';
         echo 'Check headers sent by the browser and verify that ';
         echo 'apache passes them to PHP';
 }
 ?>

Expected result:
----------------
I'd expect doAuthentication() to at either return true/false or throw an
error.

Actual result:
--------------
Code execution stops for no apparent reason.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=73103&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=73103&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=73103&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=73103&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=73103&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=73103&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=73103&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=73103&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=73103&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=73103&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=73103&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=73103&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=73103&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=73103&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73103&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=73103&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=73103&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=73103&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73103&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=73103&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=73103&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#204092) next »