mirror of
https://github.com/php/php-src.git
synced 2024-12-24 09:18:17 +08:00
MFB: The rest of the fix too for previous commit
This commit is contained in:
parent
348cec30d0
commit
f25ac22c58
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user