Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
150feb69
Commit
150feb69
authored
Aug 04, 2014
by
Jonathan Mainguy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed max 8192 bytes, fixes #8424
parent
8646cc79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
library/packaging/rpm_key
+2
-6
No files found.
library/packaging/rpm_key
View file @
150feb69
...
@@ -65,10 +65,6 @@ import os.path
...
@@ -65,10 +65,6 @@ import os.path
import
re
import
re
import
tempfile
import
tempfile
# Attempt to download at most 8192 bytes.
# Should be more than enough for all keys
MAXBYTES
=
8192
def
is_pubkey
(
string
):
def
is_pubkey
(
string
):
"""Verifies if string is a pubkey"""
"""Verifies if string is a pubkey"""
pgp_regex
=
".*?(-----BEGIN PGP PUBLIC KEY BLOCK-----.*?-----END PGP PUBLIC KEY BLOCK-----).*"
pgp_regex
=
".*?(-----BEGIN PGP PUBLIC KEY BLOCK-----.*?-----END PGP PUBLIC KEY BLOCK-----).*"
...
@@ -118,11 +114,11 @@ class RpmKey:
...
@@ -118,11 +114,11 @@ class RpmKey:
module
.
exit_json
(
changed
=
False
)
module
.
exit_json
(
changed
=
False
)
def
fetch_key
(
self
,
url
,
maxbytes
=
MAXBYTES
):
def
fetch_key
(
self
,
url
):
"""Downloads a key from url, returns a valid path to a gpg key"""
"""Downloads a key from url, returns a valid path to a gpg key"""
try
:
try
:
rsp
,
info
=
fetch_url
(
self
.
module
,
url
)
rsp
,
info
=
fetch_url
(
self
.
module
,
url
)
key
=
rsp
.
read
(
maxbytes
)
key
=
rsp
.
read
()
if
not
is_pubkey
(
key
):
if
not
is_pubkey
(
key
):
self
.
module
.
fail_json
(
msg
=
"Not a public key:
%
s"
%
url
)
self
.
module
.
fail_json
(
msg
=
"Not a public key:
%
s"
%
url
)
tmpfd
,
tmpname
=
tempfile
.
mkstemp
()
tmpfd
,
tmpname
=
tempfile
.
mkstemp
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment