Skip to content

pw_hash is not working with bcrypt-y #1453

Open
@Albroy

Description

@Albroy

Describe the Bug

Using the pw_hash() function with the 'bcrypt-y' algorithm inside an ini_setting resource causes a catalog compilation failure with an "Invalid argument" error when using Puppet stdlib version 9.7.0.

In stdlib 9.7.0, when I try to do this :

  ini_setting { 'my_thing.PASSWORD_HASH':
    ensure  => present,
    setting => 'my_thing.PASSWORD_HASH',
    value   => pw_hash($password, 'bcrypt-y','10$abcdefghijklmnopqrstuv),
    path    => $my_path,
  }

I get the following error :

Info: Loading facts
Notice: Requesting catalog from X
Notice: Catalog compiled by X
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Invalid argument - Invalid argument (file: /etc/puppetlabs/code/environments/X/site/profiles/manifests/my_thing.pp, line: 229, column: 16) on node X
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Environment

  • stdlib version : 9.7.0
  • puppet agent version : 7.34.0
  • puppet server version : 7.17.3
  • OS : Debian 11

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