302060 {
302061 if (!info.db) {
302062 return;
302063 }
302064 if (input.GetValue<bool>()) {
302065 throw InvalidInputException("Cannot enable external access while database is running");
302066 }
302067 auto &config = info.config;
302068 if (info.db && Settings::Get<EnableExternalAccessSetting>(*info.db)) {
302069
302070 auto &db_manager = DatabaseManager::Get(*info.db);
302071 auto attached_paths = db_manager.GetAttachedDatabasePaths();
302072 for (auto &path : attached_paths) {
302073 config.AddAllowedPath(path);
302074 config.AddAllowedPath(path + ".wal");
302075 config.AddAllowedPath(path + ".wal.checkpoint");
302076 config.AddAllowedPath(path + ".wal.recovery");
302077 }
302078 }
302079 if (config.options.use_temporary_directory && !config.options.temporary_directory.empty()) {
302080
302081 config.AddAllowedDirectory(config.options.temporary_directory);
302082 }
302083}