diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2015-01-13 09:39:42 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-01-13 09:39:42 +0100 |
commit | fd52fdb212e8f54dda4fef1d756da9cfcc3edc46 (patch) | |
tree | 071ac1b500bc7a2ceb85062e115f3817496dd606 | |
parent | 5ad9573a05abd86595e08063bad94915cf104766 (diff) | |
download | libmbim-fd52fdb212e8f54dda4fef1d756da9cfcc3edc46.tar.gz |
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.
-rw-r--r-- | src/libmbim-glib/mbim-utils.c | 9 |
1 files 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, |