aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-19 21:49:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-19 21:49:22 +0100
commit36ed49f8086de072154ccd17f67a2fa2120f8af1 (patch)
tree4a5ff23aad411f407f33407e6cdd63e0898b8cfa
parentd2eeffcc9eb221556283680fcc6edcef2115c633 (diff)
downloadvulns-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-xscripts/cve_create7
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