summaryrefslogtreecommitdiff
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:25:02 -0500
commitad207bbf800749027d645f5e184c241b4e92838c (patch)
tree8e439cc95b86272537d1296bfb4ba09b2d6b0c5d
parentc29b85edc41644ea891b4ada96f652f6d3ea2971 (diff)
downloadModemManager-ad207bbf800749027d645f5e184c241b4e92838c.tar.gz
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'. (cherry picked from commit 9b051b14ed33b5eca2e7d1b384d6a9f60d08e482)
-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 5edbbae04..b9e12677c 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -2987,16 +2987,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 */