szaszm commented on code in PR #2069:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2069#discussion_r2599018297


##########
libminifi/src/properties/Properties.cpp:
##########
@@ -157,8 +158,41 @@ void fixValidatedProperty(const std::string& property_name,
     needs_to_persist_new_value = false;
   }
 }
+
+auto getExtraPropertiesFileNames(const std::filesystem::path& 
extra_properties_files_dir, const std::shared_ptr<core::logging::Logger>& 
logger) {
+  std::vector<std::filesystem::path> extra_properties_file_names;
+  if (utils::file::exists(extra_properties_files_dir) && 
utils::file::is_directory(extra_properties_files_dir)) {
+    utils::file::list_dir(extra_properties_files_dir, [&](const 
std::filesystem::path&, const std::filesystem::path& file_name) {
+      if (!file_name.string().ends_with(".bak")) {
+        extra_properties_file_names.push_back(file_name);

Review Comment:
   I've changed my mind about the pattern matching: I think I'd rather have a 
whitelist by matching extensions, rather than a blacklist by `*.bak`. It's more 
explicit about what we want to read, and it leaves room for things like a 
README.txt like in `/etc/sysctl.d` on my system. By the way, another pattern I 
was thinking about following was `/etc/X11/xorg.conf.d`.
   
   What do you think? As always, I'm open to different viewpoints and to being 
wrong.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to