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

Poor handling of "sudo ddev hostname" - panic when sudo fails #780

Closed
rfay opened this issue Apr 9, 2018 · 2 comments
Closed

Poor handling of "sudo ddev hostname" - panic when sudo fails #780

rfay opened this issue Apr 9, 2018 · 2 comments

Comments

@rfay
Copy link
Member

rfay commented Apr 9, 2018

What happened (or feature request):

Over in drud/quicksprint#41 @jeolpittet reported what appears to be a perfectly obvious problem with sudo ddev hostname - We do a util.CheckErr() after it, which causes a panic and stacktrace, but the reality is that it can easily fail for various reasons (inadequate permissions, wrong password, etc).

https://github.com/drud/ddev/blob/73517397dcc6707411a7c961d9fe8be146731ed2/pkg/ddevapp/ddevapp.go#L936-L937

What you expected to happen:

How to reproduce this:

Version: Please include the output of ddev version, docker version and the project's .ddev/config.yaml.

Anything else do we need to know:

Related source links or issues:

Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)

@joelpittet
Copy link
Contributor

Would one of these things help? https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
(I don't know any go)

@rfay
Copy link
Member Author

rfay commented Apr 9, 2018

No this is just a simple coding error :) Somebody (probably me) never thought about the fact that the sudo attempt could fail for various reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants