diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-19 21:49:22 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-19 21:49:22 +0100 |
commit | 36ed49f8086de072154ccd17f67a2fa2120f8af1 (patch) | |
tree | 4a5ff23aad411f407f33407e6cdd63e0898b8cfa | |
parent | d2eeffcc9eb221556283680fcc6edcef2115c633 (diff) | |
download | vulns-36ed49f8086de072154ccd17f67a2fa2120f8af1.tar.gz |
scripts/cve_create: don't creat a duplicate cve
Check the sha for an existing one before creating a new one.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rwxr-xr-x | scripts/cve_create | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/cve_create b/scripts/cve_create index 62afb3d2..160ebe6f 100755 --- a/scripts/cve_create +++ b/scripts/cve_create @@ -64,6 +64,13 @@ CVE_ROOT="${DIR}/../cve/" RESERVED_DIR="${CVE_ROOT}reserved/${YEAR}/" PUBLISHED_DIR="${CVE_ROOT}published/${YEAR}/" +# make sure we haven't allocated a CVE already for this id +found=$(grep -r -l "${GIT_SHA_FULL}" "${CVE_ROOT}"/published/) +if [[ "${found}" != "" ]]; then + echo "The git id ${GIT_SHA_FULL} is already assigned a cve, look in ${found} for details" + exit 1 +fi + # Go into the directory for the year asked for cd "${RESERVED_DIR}" 2> /dev/null if [[ $? -ne 0 ]]; then |