Skip to content

Conversation

cmcgee1024
Copy link
Member

Currently when there is a post installation command during init the user is given the command that they must run at the end. In order to streamline the process further an additional flag called '--sudo-install-packages' is added that will invoke sudo on behalf of the user to perform that command as root.

Add the new flag to the init subcommand. Create a regex that restricts the allowable commands to a narrow set of patterns as a measure of protection. Invoke the sudo process directly from the expected directory on supported Linux systems, which is /usr/bin/sudo

Currently when there is a post installation command during init
the user is given the command that they must run at the end. In
order to streamline the process further an additional flag called
'--sudo-install-packages' is added that will invoke sudo on behalf
of the user to perform that command as root.

Add the new flag to the init subcommand. Create a regex that
restricts the allowable commands to a narrow set of patterns as a
measure of protection. Invoke the sudo process directly from the
expected directory on supported Linux systems, which is /usr/bin/sudo
@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

p.waitUntilExit()

if p.terminationStatus == 0 {
SwiftlyCore.print("sudo could not be run to install the packages")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could go in the common messages struct

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.

2 participants