Skip to content

Conversation

@legionus
Copy link
Collaborator

@legionus legionus commented Aug 8, 2024

This feature provides a wrapper around dialogs such as password prompts. Work with dialogs becomes more challenging when plymouth is used. Other utilities can also be used to display the dialog.

@legionus legionus requested a review from gabifalk August 8, 2024 16:08
@legionus
Copy link
Collaborator Author

legionus commented Aug 8, 2024

@wladmis, you might be interested.

@legionus legionus requested a review from wladmis August 8, 2024 18:05
! type -P unl0kr >/dev/null || ask=__ask_pass_with_unl0kr

# To avoid issues with quoting arguments for the utility, a temporary
# wrapper can be created.
Copy link
Contributor

Choose a reason for hiding this comment

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

Too hacky, but OK.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@wladmis What exactly seems like a hack to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

A workaround with a wrapper file to solve quoting issues, but I don't know better solution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, this is a simple and effective way to do it. If it doesn't happen very often, I don't see anything wrong with it.

! type -P unl0kr >/dev/null || ask=__ask_pass_with_unl0kr

# To avoid issues with quoting arguments for the utility, a temporary
# wrapper can be created.
Copy link
Contributor

Choose a reason for hiding this comment

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

A workaround with a wrapper file to solve quoting issues, but I don't know better solution.


# To avoid issues with quoting arguments for the utility, a temporary
# wrapper can be created.
tempfile="/.initrd/dialog-ask-pass-$$.$BASHPID"
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it'd be better if the local definition of tempfile was placed right above this line, and if it was named smth like cmdwrapper instead of tempfile.

        local cmdwrapper
        cmdwrapper="="/.initrd/dialog-ask-pass-$$.$BASHPID"
        ...
        "$ask" "$prompt" "$tries" "$cmdwrapper" || rc="$?"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it makes sense to rename the temporary file.

This feature provides a wrapper around dialogs such as password prompts.
Work with dialogs becomes more challenging when plymouth is used. Other
utilities can also be used to display the dialog.

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
@legionus legionus merged commit 74600c1 into master Aug 12, 2024
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