Skip to content

Commit

Permalink
fix: correct typos and sql syntax (#5314)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong authored Jan 17, 2023
2 parents 787a656 + 0961742 commit 4c375f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions core/src/main/resources/data/initialize_mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if exists (SELECT 1 FROM sysobjects WHERE name='insert_software' AND xtype='P')
drop procedure insert_software;
if exists (SELECT 1 FROM sysobjects WHERE name='knownExploited' AND xtype='U')
drop table knownExploited;
if exists (SELECT 1 FROM sysobjects WHERE name='merge_knownexpoited' AND xtype='P')
drop procedure merge_knownexpoited;
if exists (SELECT 1 FROM sysobjects WHERE name='merge_knownexploited' AND xtype='P')
drop procedure merge_knownexploited;

CREATE TABLE vulnerability (id int identity(1,1) PRIMARY KEY, cve VARCHAR(20) UNIQUE,
description VARCHAR(8000), v2Severity VARCHAR(20), v2ExploitabilityScore DECIMAL(3,1),
Expand Down Expand Up @@ -235,12 +235,12 @@ IF EXISTS(SELECT * FROM knownExploited WHERE cveID=@cveID)
SET vendorProject=@vendorProject, product=@product, vulnerabilityName=@vulnerabilityName,
dateAdded=@dateAdded, shortDescription=@shortDescription, requiredAction=@requiredAction,
dueDate=@dueDate, notes=@notes
WHERE cveID=@cveID
WHERE cveID=@cveID;
ELSE
INSERT INTO knownExploited (vendorProject, product, vulnerabilityName,
dateAdded, shortDescription, requiredAction, dueDate, notes, cveID)
VALUES (@vendorProject, @product, @vulnerabilityName,
@dateAdded, @shortDescription, @requiredAction, @dueDate, @notes, @cveID)
@dateAdded, @shortDescription, @requiredAction, @dueDate, @notes, @cveID);
END;

GO
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/data/initialize_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DROP PROCEDURE IF EXISTS dependencycheck.cleanup_orphans;
DROP PROCEDURE IF EXISTS dependencycheck.update_vulnerability;
DROP PROCEDURE IF EXISTS dependencycheck.insert_software;
DROP PROCEDURE IF EXISTS dependencycheck.merge_ecosystem;
DROP PROCEDURE IF EXISTS dependencycheck.merge_knownexpoited;
DROP PROCEDURE IF EXISTS dependencycheck.merge_knownexploited;
DROP TABLE IF EXISTS software;
DROP TABLE IF EXISTS cpeEntry;
DROP TABLE IF EXISTS `reference`;
Expand Down Expand Up @@ -307,7 +307,7 @@ INSERT INTO knownExploited (`cveID`, `vendorProject`, `product`, `vulnerabilityN
END //
DELIMITER ;

GRANT EXECUTE ON PROCEDURE dependencycheck.merge_knownexpoited TO 'dcuser';
GRANT EXECUTE ON PROCEDURE dependencycheck.merge_knownexploited TO 'dcuser';

GRANT SELECT, INSERT, UPDATE, DELETE ON dependencycheck.* TO 'dcuser';

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/data/initialize_oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ EXCEPTION
END;
/

GRANT EXECUTE ON merge_knownexpoited TO dcuser;
GRANT EXECUTE ON merge_knownexploited TO dcuser;

CREATE OR REPLACE PROCEDURE update_vulnerability(p_cveId IN vulnerability.cve%type,
p_description IN vulnerability.description%type,
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/resources/data/initialize_postgres.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DROP FUNCTION IF EXISTS public.save_property;
DROP FUNCTION IF EXISTS public.update_vulnerability;
DROP FUNCTION IF EXISTS public.insert_software;
DROP FUNCTION IF EXISTS public.merge_ecosystem;
DROP FUNCTION IF EXISTS public.merge_knownexpoited;
DROP FUNCTION IF EXISTS public.merge_knownexploited;
DROP TABLE IF EXISTS software;
DROP TABLE IF EXISTS cpeEntry;
DROP TABLE IF EXISTS reference;
Expand Down Expand Up @@ -123,7 +123,7 @@ IF EXISTS(SELECT 1 FROM knownExploited WHERE cveID=p_cveID) THEN
SET vendorProject=p_vendorProject, product=p_product, vulnerabilityName=p_vulnerabilityName,
dateAdded=p_dateAdded, shortDescription=p_shortDescription, requiredAction=p_requiredAction,
dueDate=p_dueDate, notes=p_notes
WHERE cveID=p_cveID
WHERE cveID=p_cveID;
ELSE
INSERT INTO knownExploited (cveID, vendorProject, product, vulnerabilityName,
dateAdded, shortDescription, requiredAction, dueDate, notes)
Expand All @@ -133,7 +133,7 @@ END IF;
END
$$ LANGUAGE plpgsql;

GRANT EXECUTE ON FUNCTION public.merge_knownexpoited(varchar(20), VARCHAR(255), VARCHAR(255), VARCHAR(500), CHAR(10), VARCHAR(2000), VARCHAR(1000), CHAR(10), VARCHAR(2000)) TO dcuser;
GRANT EXECUTE ON FUNCTION public.merge_knownexploited(varchar(20), VARCHAR(255), VARCHAR(255), VARCHAR(500), CHAR(10), VARCHAR(2000), VARCHAR(1000), CHAR(10), VARCHAR(2000)) TO dcuser;

CREATE FUNCTION update_vulnerability (
IN p_cveId VARCHAR(20), IN p_description VARCHAR(8000), IN p_v2Severity VARCHAR(20),
Expand Down

0 comments on commit 4c375f1

Please sign in to comment.