|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80198 Fail posix_getpwnam, posix_getpwuid, ...
Submitted: 2020-10-07 14:30 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: dl at CyberPunk dot ru Assigned:
Status: Open Package: Unknown/Other Function
PHP Version: Irrelevant OS: All FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dl at CyberPunk dot ru
New email:
PHP Version: OS:


 [2020-10-07 14:30 UTC] dl at CyberPunk dot ru
All FreeBSD do not implement the function sysconf with arguments _SC_GETGR_R_SIZE_MAX , _SC_GETPW_R_SIZE_MAX.

php use this sysconf() in:
- main/main.c php_get_current_user()
- main/fopen_wrappers.c php_fopen_primary_script()
- ext/posix/posix.c posix_getpwnam(), posix_getpwuid(), posix_getgrnam(), posix_getgrgid()
- ext/standard/filestat.c php_get_uid_by_name(), php_get_gid_by_name()

The problem is the unsuccessful result for these functions.

Eliminated is trivial. patch applied.

Test script:
<?php var_dump(posix_getpwuid(0)); ?>

Current php-7.4.10

without patch

with patch
array(7) {
  string(4) "root"


php_FreeBSD_sysconf (last revision 2020-10-07 14:30 UTC by dl at CyberPunk dot ru)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2022-12-10 11:21 UTC] Hall565ertha at gmail dot com
Looks like you have the posix_geteuid function available, but not posix_getpwuid. That’s my bad for not checking that both functions exist before using them.

I’ll fix this in the next release of the plugin, but for now you might want to look at whether you have the posix extension installed.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 01:03:41 2023 UTC