-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(onboard): fail if input is /dev/null
When the input is /dev/null, every read returns EOF. In general, it may also happen that read doesn't work as intended. So, the robust thing to do here is to ensure that we check the return values. By doing that we notice of io.EOF errors and we don't proceed with the onboarding. This diff fixes the issue described by ooni/probe#1281 however it may be that we also want (in the near or not-so-near future) to stop onboarding if the input terminal is not a tty. This is however a possible future evolution that should not prevent us for committing and merging this simple fix that unblocks creating a Debian package.
- Loading branch information
1 parent
7a43975
commit 920c371
Showing
2 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters