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'.
This commit is contained in:
Dan Williams
2015-07-20 12:24:22 -05:00
parent 99da30059f
commit 9b051b14ed
+5 -10
View File
@@ -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 */