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

Implement --require-sha flag #18831

Closed
6 tasks done
vitorgalvao opened this issue Feb 13, 2016 · 14 comments
Closed
6 tasks done

Implement --require-sha flag #18831

vitorgalvao opened this issue Feb 13, 2016 · 14 comments

Comments

@vitorgalvao
Copy link
Member

vitorgalvao commented Feb 13, 2016

Refs #10380.

When using --require-sha on the command line (or HOMEBREW_CASK_OPTS) during an install, before starting the download HBC must check if the cask in question uses sha256 :no_check. If it does, installation will abort for that specific cask and an explanatory message be given.

Steps for implementation (from the next post):

@adidalal
Copy link
Contributor

Steps for implementation:

@jawshooah Seem okay?

@jawshooah
Copy link
Contributor

The man page will also need to be updated. Other than that, I believe that should be sufficient.

@jawshooah jawshooah self-assigned this Feb 19, 2016
@vitorgalvao
Copy link
Member Author

Please don’t “+1” this issue (or any other, for that matter), as it only adds noise. We want this implemented, it’s not a vote.

Will remove comments that don’t add to the discussion, to keep the issue focused.

@fuzzyroddis
Copy link
Contributor

Could we change it to a slight but important difference:
...before starting the download HBC must check if the cask in question uses *contains a sha256 hash and the value is not :no_check. Else, installation will abort for that specific cask and an explanatory message be given.

@vitorgalvao
Copy link
Member Author

@fuzzyroddis What’s the difference?

@fuzzyroddis
Copy link
Contributor

It's a nitpick, but in the original if a cask does not contain any sha256 line rather than sha256 :no_check then the installation would continue even though it's equivalent to :no_check

@vitorgalvao
Copy link
Member Author

There’s no such thing as a cask without a sha256. It’s mandatory, and casks don’t pass audit without it.

@fuzzyroddis
Copy link
Contributor

I understand that an audit would catch such a cask, but it's still possible for a cask to exist without a sha256 eg. if it is merged ignoring results of an audit.

@vitorgalvao
Copy link
Member Author

Unless I’m misremembering, a cask that does not pass audit will also refuse to install. audit isn’t just for Travis, it is also a part of HBC.

@fuzzyroddis
Copy link
Contributor

Wouldn't it be safer to require a sha256 with length 64? Is there a reason you want to only check for :no_check?

@vitorgalvao
Copy link
Member Author

We only do that for casks that have unversioned urls and hence would break constantly.

Please search our issues and documentation for further questions on this. Everything has already been explained at length multiple times.

@fuzzyroddis
Copy link
Contributor

Perhaps you misunderstand me, I'm not talking about the use of :no_check rather this issue which is about --require-sha. I'm saying that if --require-sha is used it should check for the existence of a sha256 hash and if there isn't one then fail. Where OP is asking to check for :no_check instead and fail if it finds it.

Type hash :no_check no sha256 line
Failing if no hash
Failing if :no_check 🔴

This isn't an issue of what :no_check does nor how audit works, its about ensuring the behaviour of --require-sha never pulls a url without a hash.

Sure it might double up, that audit checks for a hash and then --require-sha checks again, but I'd say that's the safer way.

@vitorgalvao
Copy link
Member Author

vitorgalvao commented May 17, 2016

Again, there are no casks with no sha256. :no_check exists precisely because of that.

Try it. Make a cask with no sha256 and try to install it. HBC will blow up in your face and will not proceed. In the very unlikely and never before heard of case of a cask slipping through with no sha256, HBC will refuse to install it anyway. This is not an issue. You’re arguing for a case that will never happen.

@jawshooah
Copy link
Contributor

Done in #22398, and refined in #22404.

@miccal miccal removed the core Issue with Homebrew itself rather than with a specific cask. label Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants