Skip to content

feat(accounts): replace passwd command with DBus SetPassword for pass…#3287

Open
qxp930712 wants to merge 1 commit into
linuxdeepin:masterfrom
qxp930712:master
Open

feat(accounts): replace passwd command with DBus SetPassword for pass…#3287
qxp930712 wants to merge 1 commit into
linuxdeepin:masterfrom
qxp930712:master

Conversation

@qxp930712

Copy link
Copy Markdown

…word modification

This commit replaces the direct invocation of the system passwd command
with the DBus SetPassword method for user password changes in the accounts
plugin. Key changes include:

  1. Replaced QProcess-based passwd command execution with DBus
  2. Added pre-flight password validation to check if new password and repeat password match before attempting modification
  3. Added password encryption step using cryptUserPassword before sending to the backend service
  4. Delegated old password authentication to polkit dialog instead of piping plaintext credentials into the passwd process
  5. Improved error reporting by forwarding DBus reply error messages directly to the caller

The migration eliminates plaintext credential exposure in process
arguments and pipes, provides clearer error feedback, and integrates
properly with the system's polkit authentication framework.

Log: Improved password modification security and user experience

Influence:

  1. Test password change flow for users with and without existing passwords
  2. Verify polkit authentication dialog appears correctly during password change
  3. Test mismatched password input validation
  4. Verify error messages are displayed properly on failure
  5. Test password modification in both GUI and non-GUI (needResult) modes

PMS:TASK-390539

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @qxp930712, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

…word modification

  This commit replaces the direct invocation of the system passwd command
  with the DBus SetPassword method for user password changes in the accounts
  plugin. Key changes include:

  1. Replaced QProcess-based passwd command execution with DBus
  2. Added pre-flight password validation to check if new password and
     repeat password match before attempting modification
  3. Added password encryption step using cryptUserPassword before sending
     to the backend service
  4. Delegated old password authentication to polkit dialog instead of
     piping plaintext credentials into the passwd process
  5. Improved error reporting by forwarding DBus reply error messages
     directly to the caller

  The migration eliminates plaintext credential exposure in process
  arguments and pipes, provides clearer error feedback, and integrates
  properly with the system's polkit authentication framework.

  Log: Improved password modification security and user experience

  Influence:
  1. Test password change flow for users with and without existing passwords
  2. Verify polkit authentication dialog appears correctly during password change
  3. Test mismatched password input validation
  4. Verify error messages are displayed properly on failure
  5. Test password modification in both GUI and non-GUI (needResult) modes

PMS:TASK-390539
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: qxp930712

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: qxp930712

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-bot

deepin-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.92
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3292

@deepin-bot

deepin-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.93
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3293

@deepin-bot

deepin-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.94
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3301

@deepin-bot

deepin-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.95
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3305

@deepin-bot

deepin-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.96
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3314

@deepin-bot

deepin-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.97
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3322

@deepin-bot

deepin-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.98
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3328

@deepin-bot

deepin-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.99
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3348

@deepin-bot

deepin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.100
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3354

@deepin-bot

deepin-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.101
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3368

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.

3 participants