Skip to content

Commit 0e695c3

Browse files
prasanthksrjwrdegoede
authored andcommitted
platform/x86: dell-wmi-sysman: Change user experience when Admin/System Password is modified
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 <[email protected]> Signed-off-by: Divya Bharathi <[email protected]> Signed-off-by: Prasanth KSR <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent caf2389 commit 0e695c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ int set_new_password(const char *password_type, const char *new)
9595

9696
print_hex_dump_bytes("set new password data: ", DUMP_PREFIX_NONE, buffer, buffer_size);
9797
ret = call_password_interface(wmi_priv.password_attr_wdev, buffer, buffer_size);
98-
/* clear current_password here and use user input from wmi_priv.current_password */
98+
/* on success copy the new password to current password */
9999
if (!ret)
100-
memset(current_password, 0, MAX_BUFF);
100+
strscpy(current_password, new, MAX_BUFF);
101101
/* explain to user the detailed failure reason */
102102
else if (ret == -EOPNOTSUPP)
103103
dev_err(&wmi_priv.password_attr_wdev->dev, "admin password must be configured\n");

0 commit comments

Comments
 (0)