diff options
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r-- | src/mm-iface-modem.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 31b575a1..f4b29fef 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -24,6 +24,7 @@ #include "mm-sim.h" #include "mm-bearer-list.h" #include "mm-log.h" +#include "mm-context.h" #define SIGNAL_QUALITY_RECENT_TIMEOUT_SEC 60 #define SIGNAL_QUALITY_CHECK_TIMEOUT_SEC 30 @@ -367,6 +368,17 @@ handle_command_auth_ready (MMBaseModem *self, return; } + /* If we are not in Debug mode, report an error */ + if (!mm_context_get_debug ()) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNAUTHORIZED, + "Cannot send AT command to modem: " + "operation only allowed in debug mode"); + handle_command_context_free (ctx); + return; + } + /* If command is not implemented, report an error */ if (!MM_IFACE_MODEM_GET_INTERFACE (self)->command || !MM_IFACE_MODEM_GET_INTERFACE (self)->command_finish) { |