aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2015-07-20 12:17:12 -0500
committerDan Williams <dcbw@redhat.com>2015-07-20 12:24:22 -0500
commit9b051b14ed33b5eca2e7d1b384d6a9f60d08e482 (patch)
tree6cd1b3aa967f26773e9087d27360f5c266e4d852
parent99da30059f136600e4bf5ac2faec8b42def17d65 (diff)
iface-modem: don't check the cache when asking for required unlocks
When passing known_lock=UNKNOWN to mm_iface_modem_update_lock_info() we actually do want to ask the modem itself for locks instead of checking the cache. For example, when an unknown error is returned after performing PIN/PUK operations, the cache value may well be NONE if that was the prior lock state, and that bypasses the modem which might now be locked. Thus the state gets messed up. Reproducer is to send 'ChangePin' with the wrong "old" PIN 3 times, then send a wrong PUK. No error was returned from mmcli and the modem's lock state was shown as 'none'.
-rw-r--r--src/mm-iface-modem.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 0ed204c5..0de50e22 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -3025,16 +3025,11 @@ update_lock_info_context_step (UpdateLockInfoContext *ctx)
/* Don't re-ask if already known */
if (ctx->lock == MM_MODEM_LOCK_UNKNOWN) {
/* If we're already unlocked, we're done */
- if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE) {
- internal_load_unlock_required (
- ctx->self,
- (GAsyncReadyCallback)internal_load_unlock_required_ready,
- ctx);
- return;
- }
-
- /* Just assume that no lock is required */
- ctx->lock = MM_MODEM_LOCK_NONE;
+ internal_load_unlock_required (
+ ctx->self,
+ (GAsyncReadyCallback)internal_load_unlock_required_ready,
+ ctx);
+ return;
}
/* Fall down to next step */