MFB: The rest of the fix too for previous commit

This commit is contained in:
Jani Taskinen 2008-07-21 11:27:45 +00:00
parent 348cec30d0
commit f25ac22c58

View File

@ -5083,8 +5083,12 @@ PHPAPI char *php_get_current_user(void) /* {{{ */
if ((pwd=getpwuid(pstat->st_uid))==NULL) {
return "";
}
#endif
SG(request_info).current_user_length = strlen(pwd->pw_name);
SG(request_info).current_user = estrndup(pwd->pw_name, SG(request_info).current_user_length);
#if defined(ZTS) && defined(HAVE_GETPWUID_R) && defined(_SC_GETPW_R_SIZE_MAX)
efree(pwbuf);
#endif
return SG(request_info).current_user;
#endif
}