aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsom <somashekhar.puttagangaiah@intel.com>2022-04-01 20:27:47 +0530
committerAleksander Morgado <aleksander@aleksander.es>2022-04-20 15:20:34 +0200
commit1e08f9ca2c07ed2e080c76f66f50250e62e3bc31 (patch)
treee9125356b760785c161d9b92bc52be2d64478bcf
parent4207ee61b75e754785d8e94046642a61303c6e7d (diff)
mm-log: hiding personal info while logging
During mm logging, some of the information like simIccId, Telephone numbers need to be hidden from displaying in the logs to protect some of the user information. Implemented for MBIM requiring libmbim 1.27.6, which is the development version that includes the needed API.
-rw-r--r--configure.ac2
-rw-r--r--meson.build2
-rw-r--r--src/main.c1
-rw-r--r--src/mm-context.c12
-rw-r--r--src/mm-context.h1
-rw-r--r--src/mm-log.c2
-rw-r--r--src/mm-log.h1
7 files changed, 19 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 13837c1f..a05c90c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -386,7 +386,7 @@ dnl-----------------------------------------------------------------------------
dnl MBIM support (enabled by default)
dnl
-LIBMBIM_VERSION=1.27.5
+LIBMBIM_VERSION=1.27.6
AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes])
AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
diff --git a/meson.build b/meson.build
index 540c6d50..354afa61 100644
--- a/meson.build
+++ b/meson.build
@@ -237,7 +237,7 @@ config_h.set('WITH_AT_COMMAND_VIA_DBUS', enable_at_command_via_dbus)
# MBIM support (enabled by default)
enable_mbim = get_option('mbim')
if enable_mbim
- mbim_glib_dep = dependency('mbim-glib', version: '>= 1.27.3')
+ mbim_glib_dep = dependency('mbim-glib', version: '>= 1.27.6')
endif
config_h.set('WITH_MBIM', enable_mbim)
diff --git a/src/main.c b/src/main.c
index a9221cdc..8516d7bc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -165,6 +165,7 @@ main (int argc, char *argv[])
mm_context_get_log_journal (),
mm_context_get_log_timestamps (),
mm_context_get_log_relative_timestamps (),
+ mm_context_get_log_personal_info (),
&error)) {
g_printerr ("error: failed to set up logging: %s\n", error->message);
g_error_free (error);
diff --git a/src/mm-context.c b/src/mm-context.c
index ee9b372c..37793e5a 100644
--- a/src/mm-context.c
+++ b/src/mm-context.c
@@ -134,6 +134,7 @@ static const gchar *log_file;
static gboolean log_journal;
static gboolean log_show_ts;
static gboolean log_rel_ts;
+static gboolean log_personal_info;
static const GOptionEntry log_entries[] = {
{
@@ -163,6 +164,11 @@ static const GOptionEntry log_entries[] = {
"Use relative timestamps (from MM start)",
NULL
},
+ {
+ "log-personal-info", 0, 0, G_OPTION_ARG_NONE, &log_personal_info,
+ "Show personal info in logs",
+ NULL
+ },
{ NULL }
};
@@ -210,6 +216,12 @@ mm_context_get_log_relative_timestamps (void)
return log_rel_ts;
}
+gboolean
+mm_context_get_log_personal_info (void)
+{
+ return log_personal_info;
+}
+
/*****************************************************************************/
/* Test context */
diff --git a/src/mm-context.h b/src/mm-context.h
index 2a69e11c..8a5c0458 100644
--- a/src/mm-context.h
+++ b/src/mm-context.h
@@ -41,6 +41,7 @@ const gchar *mm_context_get_log_file (void);
gboolean mm_context_get_log_journal (void);
gboolean mm_context_get_log_timestamps (void);
gboolean mm_context_get_log_relative_timestamps (void);
+gboolean mm_context_get_log_personal_info (void);
/* Testing support */
gboolean mm_context_get_test_session (void);
diff --git a/src/mm-log.c b/src/mm-log.c
index 22a39012..7b81d9fa 100644
--- a/src/mm-log.c
+++ b/src/mm-log.c
@@ -310,6 +310,7 @@ mm_log_setup (const char *level,
gboolean log_journal,
gboolean show_timestamps,
gboolean rel_timestamps,
+ gboolean show_personal_info,
GError **error)
{
/* levels */
@@ -366,6 +367,7 @@ mm_log_setup (const char *level,
#endif
#if defined WITH_MBIM
+ mbim_utils_set_show_personal_info (show_personal_info);
g_log_set_handler ("Mbim",
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
log_handler,
diff --git a/src/mm-log.h b/src/mm-log.h
index d0b5c607..4c643e28 100644
--- a/src/mm-log.h
+++ b/src/mm-log.h
@@ -60,6 +60,7 @@ gboolean mm_log_setup (const char *level,
gboolean log_journal,
gboolean show_ts,
gboolean rel_ts,
+ gboolean show_personal_info,
GError **error);
void mm_log_shutdown (void);