All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: dell-wmi-sysman: Change user experience when Admin/System Password is modified
@ 2021-06-28  8:49 Prasanth KSR
  2021-06-28  9:01 ` Hans de Goede
  2021-06-28  9:15 ` Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Prasanth KSR @ 2021-06-28  8:49 UTC (permalink / raw)
  To: Hans de Goede, dvhart
  Cc: LKML, platform-driver-x86, Prasanth KSR, Divya Bharathi

Whenever user has changed an Admin/System Password using the sysfs,
then we are automatically copying the new password to existing
password field.

Co-developed-by: Divya Bharathi <divya.bharathi@dell.com>
Signed-off-by: Divya Bharathi <divya.bharathi@dell.com>
Signed-off-by: Prasanth KSR <prasanth.ksr@dell.com>
---
 .../x86/dell/dell-wmi-sysman/passwordattr-interface.c         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c b/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c
index 339a082d6c18..86ec962aace9 100644
--- a/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c
+++ b/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c
@@ -95,9 +95,9 @@ int set_new_password(const char *password_type, const char *new)
 
 	print_hex_dump_bytes("set new password data: ", DUMP_PREFIX_NONE, buffer, buffer_size);
 	ret = call_password_interface(wmi_priv.password_attr_wdev, buffer, buffer_size);
-	/* clear current_password here and use user input from wmi_priv.current_password */
+	/* on success copy the new password to current password */
 	if (!ret)
-		memset(current_password, 0, MAX_BUFF);
+		strscpy(current_password, new, MAX_BUFF);
 	/* explain to user the detailed failure reason */
 	else if (ret == -EOPNOTSUPP)
 		dev_err(&wmi_priv.password_attr_wdev->dev, "admin password must be configured\n");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-28  9:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28  8:49 [PATCH] platform/x86: dell-wmi-sysman: Change user experience when Admin/System Password is modified Prasanth KSR
2021-06-28  9:01 ` Hans de Goede
2021-06-28  9:05   ` Ksr, Prasanth
2021-06-28  9:15 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.