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

Log command before asking user for sudo password #415

Closed
hohwille opened this issue Jun 25, 2024 · 0 comments · Fixed by #732
Closed

Log command before asking user for sudo password #415

hohwille opened this issue Jun 25, 2024 · 0 comments · Fixed by #732
Assignees
Labels
CLI IDEasy command-line-interface (parsing args, etc.) enhancement New feature or request install installation process of IDE + tools and install commandlet linux specific for linux OS (debian, ubunutu, suse, etc.)

Comments

@hohwille
Copy link
Member

hohwille commented Jun 25, 2024

From Review of PR #409:
What I think we need to consider for runWithPackageManager is that we need to add logging of the executed command in ProcessContext before actually executing the process.

Rationale

A linux user cannot be blindly prompted for its root password from sudo without knowing what is actually happening and what command is to be executed.

Requirement

Then runWithPackageManager should log an according message on log-level interaction. So that you get something like this:

We need to run the following privileged command(s):
sudo «somecommand»
...maybe more commands...
This will require root permissions!

Please note that we also need this for other things than just global tool installations with runWithPackageManager but also e.g. for #453
Therefore the logging itself should be implemented in a method that can be reused for other use-cases than executePackageManagerCommand.

Hint

Needs to be added here:

String bashPath = this.context.findBashRequired();

@hohwille hohwille added enhancement New feature or request linux specific for linux OS (debian, ubunutu, suse, etc.) labels Jun 25, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jun 25, 2024
@hohwille hohwille added install installation process of IDE + tools and install commandlet CLI IDEasy command-line-interface (parsing args, etc.) labels Jun 25, 2024
@ndemirca ndemirca assigned ndemirca and unassigned ndemirca Sep 10, 2024
@leonrohne27 leonrohne27 self-assigned this Oct 25, 2024
@leonrohne27 leonrohne27 moved this from 🆕 New to 🏗 In progress in IDEasy board Oct 25, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Oct 30, 2024
Added a method that will inform the user for what process he will need to enter his root-password
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Oct 30, 2024
Added a method that will inform the user for what process he will need to enter his root-password
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Oct 30, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Oct 31, 2024
Changed logPackageManagerCommands so that it only prints out the output for the single PackageManagerCommand that will be executed
@hohwille hohwille linked a pull request Nov 1, 2024 that will close this issue
@hohwille hohwille added this to the release:2024.11.001 milestone Nov 1, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 4, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDEasy board Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI IDEasy command-line-interface (parsing args, etc.) enhancement New feature or request install installation process of IDE + tools and install commandlet linux specific for linux OS (debian, ubunutu, suse, etc.)
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants