Table of Contents

Patch pour SVXReflector

Version 17.12.1

f4hof-add-svxreflector-default-pwd-group.patch

Index: svxlink-17.12.1/src/svxlink/reflector/ReflectorClient.cpp
===================================================================
--- svxlink-17.12.1.orig/src/svxlink/reflector/ReflectorClient.cpp
+++ svxlink-17.12.1/src/svxlink/reflector/ReflectorClient.cpp
@@ -520,9 +520,8 @@ std::string ReflectorClient::lookupUserK
   string auth_group;
   if (!m_cfg->getValue("USERS", callsign, auth_group) || auth_group.empty())
   {
-    cout << "*** WARNING: Unknown user \"" << callsign << "\""
-         << endl;
-    return "";
+    /* Unknown user, silently hinting to group DefaultPassword. */
+    auth_group = "DefaultPassword";
   }
   string auth_key;
   if (!m_cfg->getValue("PASSWORDS", auth_group, auth_key) || auth_key.empty())

f4hof-reject-anon.patch

Index: svxlink-17.12.1/src/svxlink/reflector/ReflectorClient.cpp
===================================================================
--- svxlink-17.12.1.orig/src/svxlink/reflector/ReflectorClient.cpp
+++ svxlink-17.12.1/src/svxlink/reflector/ReflectorClient.cpp
@@ -518,6 +518,12 @@ void ReflectorClient::handleHeartbeat(As
 std::string ReflectorClient::lookupUserKey(const std::string& callsign)
 {
   string auth_group;
+  if (strcasestr( callsign.c_str(), "5P07N1K") != NULL)
+  {
+    /* Deny connection to anons */
+    cout << "Attempt to connect as \"" << callsign << "\" denied." << endl;
+    return "";
+  }
   if (!m_cfg->getValue("USERS", callsign, auth_group) || auth_group.empty())
   {
     /* Unknown user, silently hinting to group DefaultPassword. */

Version 19.09.1

f4hof-add-svxreflector-default-pwd-group.patch

Index: svxlink-19.09.1/src/svxlink/reflector/ReflectorClient.cpp
===================================================================
--- svxlink-19.09.1.orig/src/svxlink/reflector/ReflectorClient.cpp
+++ svxlink-19.09.1/src/svxlink/reflector/ReflectorClient.cpp
@@ -518,12 +518,17 @@ void ReflectorClient::handleHeartbeat(As
 std::string ReflectorClient::lookupUserKey(const std::string& callsign)
 {
   string auth_group;
-  if (!m_cfg->getValue("USERS", callsign, auth_group) || auth_group.empty())
+  if (strcasestr( callsign.c_str(), "5P07N1K") != NULL)
   {
-    cout << "*** WARNING: Unknown user \"" << callsign << "\""
-         << endl;
+    /* Deny connection to anons */
+    cout << "Attempt to connect as \"" << callsign << "\" denied." << endl;
     return "";
   }
+  if (!m_cfg->getValue("USERS", callsign, auth_group) || auth_group.empty())
+  {
+    /* Unknown user, silently hinting to group DefaultPassword. */
+    auth_group = "DefaultPassword";
+  }
   string auth_key;
   if (!m_cfg->getValue("PASSWORDS", auth_group, auth_key) || auth_key.empty())

Version 19.09.2

f4hof-add-svxreflector-default-pwd-group.patch

Index: svxlink-19.09.2/src/svxlink/reflector/ReflectorClient.cpp
===================================================================
--- svxlink-19.09.2.orig/src/svxlink/reflector/ReflectorClient.cpp
+++ svxlink-19.09.2/src/svxlink/reflector/ReflectorClient.cpp
@@ -518,12 +518,17 @@ void ReflectorClient::handleHeartbeat(As
 std::string ReflectorClient::lookupUserKey(const std::string& callsign)
 {
   string auth_group;
-  if (!m_cfg->getValue("USERS", callsign, auth_group) || auth_group.empty())
+  if (strcasestr( callsign.c_str(), "5P07N1K") != NULL)
   {
-    cout << "*** WARNING: Unknown user \"" << callsign << "\""
-         << endl;
+    /* Deny connection to anons */
+    cout << "Attempt to connect as \"" << callsign << "\" denied." << endl;
     return "";
   }
+  if (!m_cfg->getValue("USERS", callsign, auth_group) || auth_group.empty())
+  {
+    /* Unknown user, silently hinting to group DefaultPassword. */
+    auth_group = "DefaultPassword";
+  }
   string auth_key;
   if (!m_cfg->getValue("PASSWORDS", auth_group, auth_key) || auth_key.empty())
   {