<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Sorry, I should have mentioned that I had looked at that option.<br>
<br>
For `chpasswd`, I need to fork a process but with `putspent` I can
do in same process.<br>
<br>
<div class="moz-cite-prefix">On 08/11/2017 10:20 PM, Kenneth Wilke
wrote:<br>
</div>
<blockquote
cite="mid:SN1PR20MB049686AE976A7994AA7949E8EF890@SN1PR20MB0496.namprd20.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr"
style="font-size:12pt; color:#000000;
font-family:Calibri,Helvetica,sans-serif">
<p>Could chpasswd be used for that?<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
color="#000000" face="Calibri, sans-serif"><b>From:</b>
openbmc
<a class="moz-txt-link-rfc2396E" href="mailto:openbmc-bounces+kenneth.wilke=rackspace.com@lists.ozlabs.org"><openbmc-bounces+kenneth.wilke=rackspace.com@lists.ozlabs.org></a>
on behalf of vishwa <a class="moz-txt-link-rfc2396E" href="mailto:vishwa@linux.vnet.ibm.com"><vishwa@linux.vnet.ibm.com></a><br>
<b>Sent:</b> Friday, August 11, 2017 11:18:48 AM<br>
<b>To:</b> OpenBMC Maillist<br>
<b>Subject:</b> Design proposal to Non-Interactive password
update for REST client</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">This email is about
openbmc/openbmc#1714 ( REST API to update root
<br>
password )<br>
<br>
Goal is to do Non-interactive password updates to enable a
REST client <br>
to update the root password.<br>
<br>
My proposal is to use `getspent(3)` and `putspent(3)` and
here is the flow.<br>
<br>
REST client will provide a method that takes std::string as
parameter.<br>
<br>
The Provider at the BMC will receive the password and does
these:<br>
<br>
- Executes `getspent(3)` for "root" and gets the entries.<br>
- Parses the `sp_pwdp` and extracts `encryption method` ,
`salt`.<br>
- Makes a call to `crypt(3)` with the extracted `salt` and
`user <br>
input` and generates encrypted pass-code<br>
- Populates the structure and calls `putspent(3)` to
update the password<br>
<br>
Please let me know your opinion on this.<br>
<br>
Thank you,<br>
<br>
!! Vishwa !!<br>
<br>
</div>
</span></font>
</blockquote>
<br>
</body>
</html>