From 4f6b8c9a5cfb19404f15c82b98cadce7d2d3a052 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 10 Feb 2021 15:14:02 +0100 Subject: [PATCH] add COM0 and LPT0 to the list of reserved crate names In #695 we added all the documented reserved Windows file names to the list of reserved crate names, to prevent people from registering crates named that way and breaking all Windows users in the process. Unfortunately it turns out that COM0 and LPT0 are *also* reserved on Windows systems, but they're not documented in Microsoft's docs. This PR adds both names to the reserved crate names list. Note that the migration here is a no-op on the production crates.io instance, as both names were manually added to the database before opening this PR. --- migrations/2021-02-10-141019_reserve_com0_lpt0/down.sql | 1 + migrations/2021-02-10-141019_reserve_com0_lpt0/up.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 migrations/2021-02-10-141019_reserve_com0_lpt0/down.sql create mode 100644 migrations/2021-02-10-141019_reserve_com0_lpt0/up.sql diff --git a/migrations/2021-02-10-141019_reserve_com0_lpt0/down.sql b/migrations/2021-02-10-141019_reserve_com0_lpt0/down.sql new file mode 100644 index 00000000000..bb2c18f48fc --- /dev/null +++ b/migrations/2021-02-10-141019_reserve_com0_lpt0/down.sql @@ -0,0 +1 @@ +DELETE FROM reserved_crate_names WHERE name IN ('com0', 'lpt0'); diff --git a/migrations/2021-02-10-141019_reserve_com0_lpt0/up.sql b/migrations/2021-02-10-141019_reserve_com0_lpt0/up.sql new file mode 100644 index 00000000000..4a366ee242b --- /dev/null +++ b/migrations/2021-02-10-141019_reserve_com0_lpt0/up.sql @@ -0,0 +1 @@ +INSERT INTO reserved_crate_names (name) VALUES ('com0'), ('lpt0') ON CONFLICT DO NOTHING;