Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

UAPI send passwords in a hashed format

Discussion in 'cPanel Developers' started by SAdamLongevity, May 15, 2018 at 3:09 PM.

Tags:
  1. SAdamLongevity

    SAdamLongevity Registered

    Joined:
    Tuesday
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Hi,

    I am working on creating several Hooks to automate some tasks that need to be performed everytime a new account is added including: creating a database, creating a database user, and granting permissions to that user.

    Unfortunately I have reached a problem with the creation of the database user, as the UAPI function mysql::create_user does not seem to support taking the new user's password as a hash.

    For organizational reasons we want to match the database user password with the account password specified at account creation, which we can obtain in a hashed format using perls getpwnam function.

    Does anyone have any suggestions towards automating the creation of the new database user, with the same password used during account creation, or any ideas on how to get UAPI to take a hashed password instead of a plaintext one?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,145
    Likes Received:
    1,754
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page