IBM / portlibfori

A set of APIs to enable applications to be more easily ported to PASE on IBM i
Other
8 stars 7 forks source link

Add a passwd utility #20

Open kadler opened 3 years ago

kadler commented 3 years ago

Would be useful to have a password change utility, like the standard Unix passwd.

The easiest way to implement such a tool would be to use QSYCHGPW using _PGMCALL.

Helpfully, the API takes in CCSID arguments for both old and new passwords, so we can pass in 1208 (or the output of Qp2paseCCSID).

When run as root, passwd doesn't prompt for the old password. The API does support this by passing *NOPWD, for the old password, but the user would need *SECADM special authority. We could check for this with #11 then not prompt.