Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
e8af2d38
Commit
e8af2d38
authored
6 months ago
by
f-a
Committed by
Mikolaj
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement git:// protocol check
parent
cc65775f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Cabal/src/Distribution/PackageDescription/Check.hs
+12
-0
12 additions, 0 deletions
Cabal/src/Distribution/PackageDescription/Check.hs
Cabal/src/Distribution/PackageDescription/Check/Warning.hs
+7
-0
7 additions, 0 deletions
Cabal/src/Distribution/PackageDescription/Check/Warning.hs
with
19 additions
and
0 deletions
Cabal/src/Distribution/PackageDescription/Check.hs
+
12
−
0
View file @
e8af2d38
...
...
@@ -684,6 +684,7 @@ checkSourceRepos rs = do
checkP
(
isNothing
repoLocation_
)
(
PackageDistInexcusable
MissingLocation
)
checkGitProtocol
repoLocation_
checkP
(
repoType_
==
Just
(
KnownRepoType
CVS
)
&&
isNothing
repoModule_
...
...
@@ -722,6 +723,17 @@ checkMissingVcsInfo rs =
repoTypeDirname
Monotone
=
[
"_MTN"
]
repoTypeDirname
Pijul
=
[
".pijul"
]
-- git:// lacks TLS or other encryption, see
-- https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_cons_4
checkGitProtocol
::
Monad
m
=>
Maybe
String
-- Repository location
->
CheckM
m
()
checkGitProtocol
mloc
=
checkP
(
fmap
(
isPrefixOf
"git://"
)
mloc
==
Just
True
)
(
PackageBuildWarning
GitProtocol
)
-- ------------------------------------------------------------
-- Package and distribution checks
-- ------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Cabal/src/Distribution/PackageDescription/Check/Warning.hs
+
7
−
0
View file @
e8af2d38
...
...
@@ -193,6 +193,7 @@ data CheckExplanation
|
UnrecognisedSourceRepo
String
|
MissingType
|
MissingLocation
|
GitProtocol
|
MissingModule
|
MissingTag
|
SubdirRelPath
...
...
@@ -355,6 +356,7 @@ data CheckExplanationID
|
CIUnrecognisedSourceRepo
|
CIMissingType
|
CIMissingLocation
|
CIGitProtocol
|
CIMissingModule
|
CIMissingTag
|
CISubdirRelPath
...
...
@@ -496,6 +498,7 @@ checkExplanationId (NoLicenseFile{}) = CINoLicenseFile
checkExplanationId
(
UnrecognisedSourceRepo
{})
=
CIUnrecognisedSourceRepo
checkExplanationId
(
MissingType
{})
=
CIMissingType
checkExplanationId
(
MissingLocation
{})
=
CIMissingLocation
checkExplanationId
(
GitProtocol
{})
=
CIGitProtocol
checkExplanationId
(
MissingModule
{})
=
CIMissingModule
checkExplanationId
(
MissingTag
{})
=
CIMissingTag
checkExplanationId
(
SubdirRelPath
{})
=
CISubdirRelPath
...
...
@@ -642,6 +645,7 @@ ppCheckExplanationId CINoLicenseFile = "no-license-file"
ppCheckExplanationId
CIUnrecognisedSourceRepo
=
"unrecognised-repo-type"
ppCheckExplanationId
CIMissingType
=
"repo-no-type"
ppCheckExplanationId
CIMissingLocation
=
"repo-no-location"
ppCheckExplanationId
CIGitProtocol
=
"git-protocol"
ppCheckExplanationId
CIMissingModule
=
"repo-no-module"
ppCheckExplanationId
CIMissingTag
=
"repo-no-tag"
ppCheckExplanationId
CISubdirRelPath
=
"repo-relative-dir"
...
...
@@ -964,6 +968,9 @@ ppExplanation MissingType =
"The source-repository 'type' is a required field."
ppExplanation
MissingLocation
=
"The source-repository 'location' is a required field."
ppExplanation
GitProtocol
=
"Cloning over git:// might lead to an arbitrary code execution "
++
"vulnerability. Use https:// or ssh:// instead."
ppExplanation
MissingModule
=
"For a CVS source-repository, the 'module' is a required field."
ppExplanation
MissingTag
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment