6.0.0-beta1
7/18/25

[#10965] call-time pass-by-reference in Horde_Auth
Summary call-time pass-by-reference in Horde_Auth
Queue Horde Framework Packages
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester math.parent (at) gmail (dot) com
Created 02/06/2012 (4911 days ago)
Due
Updated 01/10/2013 (4572 days ago)
Assigned
Resolved 01/10/2013 (4572 days ago)
Milestone
Patch No

History
01/10/2013 07:41:22 PM Michael Slusarz Comment #8
Assigned to Michael Slusarz
State ⇒ Resolved
Priority ⇒ 1. Low
Reply to this comment
01/10/2013 07:40:43 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (master):

commit e818d082119aa497428c44609d7c42373acbc872
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Thu Jan 10 13:14:41 2013 -0700

     This was Bug #10965

  framework/Auth/package.xml |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

http://git.horde.org/horde-git/-/commit/e818d082119aa497428c44609d7c42373acbc872
01/10/2013 08:35:39 AM math (dot) parent (at) gmail (dot) com Comment #6 Reply to this comment
THis was finally fixed in 48f26df17fd8b36e37f732b223d17dd7bd10b68c.
02/07/2012 05:46:22 PM math (dot) parent (at) gmail (dot) com Comment #5 Reply to this comment
This is not pass-by-reference which is deprecated but call-time 
pass-by-reference.

i.e:
function foo(&$arg) { }
is accepted

but
$var = foo(&$arg)
is not in php 5.4.

According to source [1] and doc [2], argument &$error of pam_auth and 
pam_chpass, is passed by reference.

So
pam_auth($username, $password , $error)
and pam_auth($username, $password , &$error)
are equivalent, but the second form will throw a fatal error on php 5.4.

[1]: http://svn.php.net/viewvc/pecl/pam/trunk/pam.c?view=markup
[2]: http://svn.php.net/viewvc/pecl/pam/trunk/README?view=markup
02/06/2012 08:40:03 PM Jan Schneider Comment #4 Reply to this comment
Without the attached patch, Horde_Auth will fail under PHP 5.4 
because of "PHP Fatal error".
Doesn't matter much, because if that extension still hasn't been 
updated to *not* require call-by-reference, it won't work with PHP 5.4 
anymore anyway.
02/06/2012 07:53:46 PM math (dot) parent (at) gmail (dot) com Comment #3 Reply to this comment
(I didn't know about the Debian pam_auth mess. For reference, I have 
found 
http://lists.horde.org/archives/dev/Week-of-Mon-20110321/025992.html)

But this bug report is not specific to Debian: it is for Horde 4 to 
work under php 5.4.

Without the attached patch, Horde_Auth will fail under PHP 5.4 because 
of "PHP Fatal error".
02/06/2012 03:03:43 PM Jan Schneider Comment #2
State ⇒ Rejected
Reply to this comment
It's required by the only official PAM extension to pass by value. 
Debian doesn't matter because they have some custom extension that 
isn't available anywhere else.
See past discussions for details.
02/06/2012 02:46:59 PM math (dot) parent (at) gmail (dot) com Comment #1
Priority ⇒ 2. Medium
Type ⇒ Enhancement
Summary ⇒ call-time pass-by-reference in Horde_Auth
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
New Attachment: Pam.php.diff Download
State ⇒ New
Reply to this comment
call-time pass-by-reference, has always been optional.

According to http://php.net/manual/en/language.references.pass.php:
<<<
As of PHP 5.3.0, you will get a warning saying that "call-time 
pass-by-reference" is deprecated when you use & in foo(&$a);.
This is now fatal under PHP 5.4.

See attached patch for "framework/Auth/lib/Horde/Auth/Pam.php", to fix 
this for Horde_Auth.

See original report at http://bugs.debian.org/658870

Saved Queries