Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base class implementation for local users' passwords reset #465

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

azmy98
Copy link

@azmy98 azmy98 commented May 7, 2024

Description

I added base class implementation for local-users-passwords-reset feautre.

Motivation and Context

It defines the abstract class the vendor needs to implement for local-users-passwords-reset feature

How Has This Been Tested?

By inheriting from this base class

Copy link

linux-foundation-easycla bot commented May 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@azmy98 azmy98 force-pushed the dev-reset-local-users-password branch 2 times, most recently from 5e3015b to b147a91 Compare May 9, 2024 03:38
@azmy98 azmy98 force-pushed the dev-reset-local-users-password branch from b147a91 to 6eba119 Compare May 15, 2024 03:17
@azmy98 azmy98 requested a review from dgsudharsan May 15, 2024 03:17
@azmy98 azmy98 force-pushed the dev-reset-local-users-password branch from 10d9aed to 1aa67f1 Compare August 14, 2024 12:04
This method is used to reset the user's password and expire it (optional) using Linux shell commands.
'''
# Use 'chpasswd' shell command to change password
subprocess.call([f"echo '{user}:{hashed_password}' | sudo chpasswd -e"], shell=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not concat command line. It is vulnerable to command argument injection. For example, hashed_password may include blank char.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maipbui to help review this part.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest not to use shell=True, instead use shell=False with an array of strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants