From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/2] netreg: Add CPHS CSP implementation
Date: Thu, 03 Feb 2011 15:06:08 -0600 [thread overview]
Message-ID: <4D4B18C0.9000809@gmail.com> (raw)
In-Reply-To: <1296739688-26585-1-git-send-email-aki.niemi@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]
Hi Aki,
> @@ -838,6 +860,9 @@ static DBusMessage *network_register(DBusConnection *conn,
>
> netreg->driver->register_auto(netreg, register_callback, netreg);
>
> + if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY)
> + return NULL;
> +
So we might just return access_denied here as well.
> set_registration_mode(netreg, NETWORK_REGISTRATION_MODE_AUTO);
>
> return NULL;
<snip>
> @@ -1769,7 +1835,7 @@ static void netreg_load_settings(struct ofono_netreg *netreg)
> mode = g_key_file_get_integer(netreg->settings, SETTINGS_GROUP,
> "Mode", NULL);
>
> - if (mode >= 0 && mode <= 1)
> + if (mode != NETWORK_REGISTRATION_MODE_AUTO_ONLY)
> netreg->mode = mode;
>
This check is unnecessary, you already loaded the settings before you
managed to load the sim file. You're also removing a sanity check for
no real reason.
This brings up another point, since the CPHS CSP file is actually
user-writeable (for some unknown reason) the user can remove the SIM,
put it in another phone and modify the forced-auto settings. If you
store the forced-auto mode in the settings file, then there's no way to
ever go back to non-forced auto, even though he should be able to.
I suggest that when forced-auto is detected, that we only write
NETWORK_REGISTRATION_MODE_AUTO to the settings store.
Regards,
-Denis
next prev parent reply other threads:[~2011-02-03 21:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 13:28 [PATCH 1/2] netreg: Add CPHS CSP implementation Aki Niemi
2011-02-03 13:28 ` [PATCH 2/2] TODO: Remove completed CPHS CSP task Aki Niemi
2011-02-03 21:06 ` Denis Kenzior [this message]
2011-02-03 21:22 ` [PATCH 1/2] netreg: Add CPHS CSP implementation Aki Niemi
2011-02-03 21:58 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D4B18C0.9000809@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox