On Tue, 2009-12-15 at 23:27 +0100, gregor herrmann wrote: > Package: davical > Version: 0.9.7.6-0 > Severity: minor > > Hi Andrew, > > when adding a user from the pam db the full name gets extracted in > drivers_squid_pam.php with: > $fullname = trim( exec("getent passwd | grep ^" . $username ." | cut -d \":\" > -f5"), ' ,' ); > > When the fields in /etc/password contain a phone number this leads to > a nice full name like: > > gre...@colleen:~$ getent passwd | grep ^gregoa | cut -d: -f5 > gregor herrmann,,,+43 123 4567890 > > which is probaly not intended :)
Indeed :-) > > Sorry for the missing patch & cheers, No problem. I was considering something like this: diff --git a/inc/drivers_squid_pam.php b/inc/drivers_squid_pam.php index a4a0de7..d2cd862 100644 --- a/inc/drivers_squid_pam.php +++ b/inc/drivers_squid_pam.php @@ -67,7 +67,8 @@ function SQUID_PAM_check($username, $password ){ } else { dbg_error_log( "PAM", "user %s doesn't exist in local DB, we need to create it",$usernam - $fullname = trim( exec("getent passwd | grep ^" . $username ." | cut -d \":\" -f5"), ' , + $fullname = exec('getent passwd "'.$username.'"' ); + $fullname = preg_replace( '{^[^:]+:[^:]+:\d+:\d+:([^:,]+)(,[^:]*):}', '$1', $fullname ); $usr = (object) array( 'user_no' => 0, 'username' => $username, Can you test for me if that works for you? If it's all good then I'll include it in 0.9.8 which should be out this week, and which fixes your other problem too. Cheers, Andrew. ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64(272)DEBIAN You will gain money by a speculation or lottery. ------------------------------------------------------------------------
signature.asc
Description: This is a digitally signed message part