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

NAS-133328 / 25.04 / Use -freebsdCompat flag for sedutil-cli #15375

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

yocalebo
Copy link
Contributor

sedutil-cli (by default) uses an asinine, non-portable "hashing" mechanism for the password. This means the password you typed on freeBSD to setup the drive will NOT work when given on linux (and vice versa). Since we're now stuck with this head-ache, we'll try again with the -freebsdCompat flag.

This does 3 primary things:

  1. move the actual logic for unlocking a disk to utility functions inside utils/sed.py
  2. if we fail to unlock a disk, try again with the -freebsdCompat flag
  3. unify, simplify, and add comments todisk.sed_unlock_all and disk.sed_unlock and various other methods that I added

This has been tested on an internal system where we reproduced this issue and there are no regressions, more importantly is that disks initialized on CORE now successfully unlock on SCALE.

@yocalebo yocalebo requested a review from a team January 11, 2025 13:44
@yocalebo yocalebo changed the title Add -freebsdCompat flag for sedutil-cli Use -freebsdCompat flag for sedutil-cli Jan 11, 2025
@bugclerk bugclerk changed the title Use -freebsdCompat flag for sedutil-cli NAS-133328 / 25.04 / Use -freebsdCompat flag for sedutil-cli Jan 11, 2025
@bugclerk
Copy link
Contributor

Copy link
Contributor

@mgrimesix mgrimesix left a comment

Choose a reason for hiding this comment

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

Flake8 complained about this:

    if (
        query_cp.returncode == ReturnCodeMappings.INVALID_OR_UNSUPPORTED
        or query_cp.returncode != ReturnCodeMappings.SUCCESS
    ):

With W503 "line break before binary operator". What you have in this PR is the current recommended line break. https://www.flake8rules.com/rules/W503.html
We might consider adding a global ignore to W503.

@yocalebo
Copy link
Contributor Author

Flake8 complained about this:

    if (
        query_cp.returncode == ReturnCodeMappings.INVALID_OR_UNSUPPORTED
        or query_cp.returncode != ReturnCodeMappings.SUCCESS
    ):

With W503 "line break before binary operator". What you have in this PR is the current recommended line break. https://www.flake8rules.com/rules/W503.html We might consider adding a global ignore to W503.

Yeah, I agree

@yocalebo yocalebo merged commit b73629f into master Jan 13, 2025
2 checks passed
@yocalebo yocalebo deleted the NAS-133328 branch January 13, 2025 13:58
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants