From fd52fdb212e8f54dda4fef1d756da9cfcc3edc46 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 13 Jan 2015 09:39:42 +0100 Subject: libmbim-glib,proxy: root user always allowed Even if MBIM_USERNAME is defined to a non-root user, root should always be able to access the proxy. E.g. ModemManager (run as root) must be able to launch and access the proxy even if MBIM_USERNAME was set to a non-root user. --- src/libmbim-glib/mbim-utils.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libmbim-glib/mbim-utils.c b/src/libmbim-glib/mbim-utils.c index 2b89f7c..a7541ae 100644 --- a/src/libmbim-glib/mbim-utils.c +++ b/src/libmbim-glib/mbim-utils.c @@ -89,13 +89,12 @@ __mbim_user_allowed (uid_t uid, struct passwd *expected_usr = NULL; + /* Root user is always allowed, regardless of the specified MBIM_USERNAME */ + if (uid == 0) + return TRUE; + expected_usr = getpwnam (MBIM_USERNAME); if (!expected_usr) { - g_warning ("Unknown user configured: %s", MBIM_USERNAME); - /* Falling back to check for root user if the configured user is unknown */ - if (uid == 0) - return TRUE; - g_set_error (error, MBIM_CORE_ERROR, MBIM_CORE_ERROR_FAILED, -- cgit v1.2.1