Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/security:master commit in: bin/
Date: Wed, 04 Mar 2020 04:06:23
Message-Id: 1583294724.dda658f89dd2514a89dade9fa9d52d14b4d2c7cb.whissi@gentoo
1 commit: dda658f89dd2514a89dade9fa9d52d14b4d2c7cb
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 4 04:05:24 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 4 04:05:24 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/security.git/commit/?id=dda658f8
7
8 cvetool: add 'getcveidlist' action
9
10 'getcveidlist' action will allow you to get list of internal CVE ids
11 required for API request.
12
13 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
14
15 bin/cvetool | 12 ++++++++++++
16 1 file changed, 12 insertions(+)
17
18 diff --git a/bin/cvetool b/bin/cvetool
19 index 28b8901..05d0b6e 100755
20 --- a/bin/cvetool
21 +++ b/bin/cvetool
22 @@ -47,6 +47,13 @@ class CVETool:
23 sys.exit(1)
24
25 self.assign(args[0], [self.cleanup_cve(cve) for cve in args[1:]])
26 + elif command =='getcveidlist':
27 + if len(args) < 1:
28 + print('Usage: getcveidlist <CVE> [<CVE>...]')
29 + print('Returns a list of the real CVE IDs')
30 + sys.exit(1)
31 +
32 + self.getcveidlist([self.cleanup_cve(cve) for cve in args[0:]])
33 elif command == 'new':
34 if len(args) != 1:
35 print('Usage: new <CVE>')
36 @@ -90,6 +97,11 @@ class CVETool:
37 print(' State: ' + data['state'])
38 print(' Bugs: ' + ' , '.join(['https://bugs.gentoo.org/' + str(bug) for bug in data['bugs']]))
39
40 + def getcveidlist(self, cves):
41 + cve_ids = [self.get_internal_cve_id(cve) for cve in cves]
42 + print('CVE IDs: cves=' + ','.join([str(c) for c in cve_ids]))
43 +
44 +
45 def assign(self, bug, cves):
46 cve_ids = [self.get_internal_cve_id(cve) for cve in cves]
47 response = self.request('/cve/assign/?bug=' + str(bug) + '&cves=' + ','.join([str(c) for c in cve_ids]))