summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-06-17 14:25:55 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-18 13:03:05 +0000
commit7b3a64c4015780aa65efb8c35fb63e42b1f4d584 (patch)
treea2d627da145e4734cc45a8e3c6993cca250f0d47
parent0c9d5beb318953a4b41ddd615a2be07cc3e08e84 (diff)
downloadmongo-7b3a64c4015780aa65efb8c35fb63e42b1f4d584.tar.gz
SERVER-48329 Rename generated action_type files to be less fragile
-rw-r--r--src/mongo/db/auth/SConscript4
-rw-r--r--src/mongo/db/auth/action_type.h37
-rwxr-xr-xsrc/mongo/db/auth/generate_action_types.py2
3 files changed, 40 insertions, 3 deletions
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index a7cce5850bb..0c34d341d12 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -6,7 +6,7 @@ env = env.Clone()
generateActionTypes = env.Command(
target=[
- 'action_type.h', 'action_type.cpp'
+ 'action_type_gen.h', 'action_type_gen.cpp'
],
source=[
'generate_action_types.py',
@@ -171,7 +171,7 @@ env.Library(
target='authprivilege',
source=[
'action_set.cpp',
- 'action_type.cpp',
+ 'action_type_gen.cpp',
'impersonation_session.cpp',
'privilege.cpp',
'privilege_parser.cpp',
diff --git a/src/mongo/db/auth/action_type.h b/src/mongo/db/auth/action_type.h
new file mode 100644
index 00000000000..09fa4b5537f
--- /dev/null
+++ b/src/mongo/db/auth/action_type.h
@@ -0,0 +1,37 @@
+/**
+ * Copyright (C) 2020-present MongoDB, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the Server Side Public License, version 1,
+ * as published by MongoDB, Inc.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Server Side Public License for more details.
+ *
+ * You should have received a copy of the Server Side Public License
+ * along with this program. If not, see
+ * <http://www.mongodb.com/licensing/server-side-public-license>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the Server Side Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+// This file exists solely to redirect usages of the name
+// action_type.h to the file action_type_gen.h, so that we can
+// transparently rename the generated files to end with _gen. Please
+// do not remove this forwarding. See SERVER-48329 and SERVER-43187
+// for background.
+#include "mongo/db/auth/action_type_gen.h"
diff --git a/src/mongo/db/auth/generate_action_types.py b/src/mongo/db/auth/generate_action_types.py
index 289f9dfbc3c..ec6a39b23d5 100755
--- a/src/mongo/db/auth/generate_action_types.py
+++ b/src/mongo/db/auth/generate_action_types.py
@@ -149,7 +149,7 @@ sourceFileTemplate = """// AUTO-GENERATED FILE DO NOT EDIT
#include "mongo/platform/basic.h"
-#include "mongo/db/auth/action_type.h"
+#include "mongo/db/auth/action_type_gen.h"
#include <cstdint>
#include <iostream>