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

fix: fix server selection in update-user #14727

Merged

Conversation

RochMoreau
Copy link
Contributor

@RochMoreau RochMoreau commented Jun 11, 2024

Fixes server selection in update-user while preserving a nice display of server along with its alt_name in the list

Description

This commit fixes a bug preventing correct selection of server when trying to update users. It improves the prompt's clarity by providing both server name and IP_subject_alt_name. It also ensures server selection from the list uses actual server names instead of list descriptions strings that caused the initial bug.

The previous code was directly using the strings generated from the "Build list of installed servers" as server identifier.
A previous commit (#14718) introduced some display-related text in the string provoking errors at the step "Server address prompt" since the provided strings no longer represent server identity.

2 possible choices:

  1. Keep the initial system of passing strings from "Build list of installed servers" to "Server address prompt"
    1. Benefits: It works, it was the initial behavior before Use legacy OpenSSL Format for Apple Devices #14718
    2. Drawback 1: Cannot display some helpful data in the prompt like the IP_subject_alt_name of the server
    3. Drawback 2: Prone to the same error in the future if somebody adds new display-related data in the strings
  2. Make "Build list of installed servers" return an array of object and "Server address prompt" pick only relevant properties for display, and relevant properties for server selection
    1. Benefit 1: Future-proof, the code is clear in the intent and the risk of re-introducing a breaking change is low
    2. Benefit 2: Keeps a nice display of the servers for selection, using IP (name)
    3. Drawback: The code is a bit more complex since it now handles objects instead of plain strings, but this could count as a benefit too because now the manipulated data is explicitly named with object keys

This PR went with the option 2

Motivation and Context

Solves issue #14726

How Has This Been Tested?

Manually tested using the same reproduction steps provided in issue #14726

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • [] My change requires a change to the documentation.
  • [] I have updated the documentation accordingly.
  • [] I have added tests to cover my changes.
  • [] All new and existing tests passed.

…y of server along with its alt_name in the list

This commit fixes a bug preventing correct selection of server when trying to update users. It improves the prompt's clarity by providing both server name and IP_subject_alt_name. It also ensures server selection from the list uses actual server names instead of list descriptions strings that caused the initial bug.
@CLAassistant
Copy link

CLAassistant commented Jun 11, 2024

CLA assistant check
All committers have signed the CLA.

@ddxor
Copy link

ddxor commented Jun 29, 2024

I manually applied this fix to my instance and it fixed this issue for me. Thanks @RochMoreau!

Copy link

@george2781 george2781 left a comment

Choose a reason for hiding this comment

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

This fixes my install when I apply it so looks good to me

@jackivanov jackivanov merged commit 346437f into trailofbits:master Jul 18, 2024
4 checks passed
@RochMoreau RochMoreau deleted the fix-update-users-server-select branch July 18, 2024 07:36
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.

5 participants