Skip to content

php-install-extensions xpass doesnt work on alpine #1656

@leenooks

Description

@leenooks

This has been triaged a bit in /remicollet/php-xpass/issues/7, but it looks like this is the summary of the issue:

  • php-install-extensions xpass will automatically trigger a pull of libxcrypt (it's dependancy).
  • libxcrypt is built and installed fine
  • xpass is built and installed fine
  • php recognises xpass installed (it shows in phpinfo())

However, calls to xpass functions (specifically tested is Yescrypt ie: password_hash($password,PASSWORD_YESCRYPT) isnt using the libxcrypt library, its still using alpine's musl crypt library.

Claude indicates php needs to be built with --with-external-libcrypt

--- Here is my interaction with claude

Also the most useful diagnostic:

php -r '
var_dump(PHP_VERSION);
var_dump(crypt("secret", "$y$j9T$saltvalue1234567890123$"));
'

If crypt() returns *0 or a DES hash, PHP still isn't using your libxcrypt. And confirm PHP's linkage again after your libxcrypt reinstall:

ldd $(php -r 'echo PHP_BINARY;') | grep crypt

It should now show libcrypt.so.1 (since you built with --enable-obsolete-api=yes). If it still shows nothing, PHP needs to be rebuilt with --with-external-libcrypt regardless of what libxcrypt is installed.

--- End interaction

And fwiw, ldd $(php -r 'echo PHP_BINARY;') | grep crypt was blank.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions