diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-29 21:38:11 +0000 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-29 21:38:11 +0000 |
commit | 17f96cc8141e32d4893a870fd4951c5d00ed57b0 (patch) | |
tree | d53fe3b5de5df8ad5981c044ea187724ccd3334b /bin/report-vuln | |
parent | ba599add8d2019744118ebd8d88586e13f4d54d5 (diff) |
report-vuln: Support generation of mail headers
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@58125 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/report-vuln')
-rwxr-xr-x | bin/report-vuln | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/bin/report-vuln b/bin/report-vuln index a20f6ae764..5e053f88ea 100755 --- a/bin/report-vuln +++ b/bin/report-vuln @@ -8,14 +8,14 @@ # # report-vuln(){ # TMPFILE="$HOME/reportbug.tmp" -# $HOME/debian/svn/secure-testing/bin/report-vuln "$@" > $TMPFILE -# mutt -i $TMPFILE submit@bugs.debian.org +# $HOME/debian/svn/secure-testing/bin/report-vuln -m "$@" > $TMPFILE +# mutt -H $TMPFILE # rm $TMPFILE # } # # in bash, this can be simply: # -# mutt -i <($HOME/debian/svn/secure-testing/bin/report-vuln) submit@bugs.debian.org +# mutt -H <($HOME/debian/svn/secure-testing/bin/report-vuln -m <pkg> <CVE>) # # export http_proxy if you need to use an http proxy to report bugs @@ -113,11 +113,18 @@ def get_cve(id): return ret + '\n' -def gen_text(pkg, cveid, blanks=False, severity=None, affected=None, cc=False, cclist=None, src=False): +def gen_text(pkg, cveid, blanks=False, severity=None, affected=None, cc=False, cclist=None, src=False, mh=False): vuln_suff = 'y' cve_suff = '' time_w = 'was' temp_id_cnt = 0 + header = '' + + if mh: + header += '''To: submit@bugs.debian.org +Subject: %s: %s + +''' % (pkg, ' '.join(cveid)) if len(cveid) > 1: cve_suff = 's' @@ -125,9 +132,9 @@ def gen_text(pkg, cveid, blanks=False, severity=None, affected=None, cc=False, c time_w = 'were' if src: - header = '''Source: %s\n''' % (pkg) + header += '''Source: %s\n''' % (pkg) else: - header = '''Package: %s\n''' % (pkg) + header += '''Package: %s\n''' % (pkg) if affected is None: if blanks: @@ -212,6 +219,7 @@ def main(): parser.add_argument('--cc-list', dest='cclist', default=['team@security.debian.org', 'secure-testing-team@lists.alioth.debian.org'], help='list of addresses to add in CC (default: %(default)s)') parser.add_argument('--src', action="store_true", help='report against source package') + parser.add_argument('-m', '--mail-header', action="store_true", help='generate a mail header') parser.add_argument('pkg', help='affected package') parser.add_argument('cve', nargs='+', help='relevant CVE for this source package, may be used multiple time if the issue has multiple CVEs') args = parser.parse_args() @@ -231,7 +239,7 @@ def main(): if not c.match(arg) and not temp_id.match(arg): error(arg + ' does not seem to be a valid CVE id') - gen_text(pkg, cve, affected=args.affected, blanks=args.blanks, severity=args.severity, cc=args.cc, cclist=args.cclist, src=args.src) + gen_text(pkg, cve, affected=args.affected, blanks=args.blanks, severity=args.severity, cc=args.cc, cclist=args.cclist, src=args.src, mh=args.mail_header) if __name__ == '__main__': main() |