fix(dfm-mount): stop GMountOperation signal emission to prevent premature UNHANDLED reply - #390
Closed
Johnson-zs wants to merge 1 commit into
Closed
Johnson-zs wants to merge 1 commit into
Johnson-zs wants to merge 1 commit into
Conversation
…ture UNHANDLED reply Root cause: gio's GMountOperation default class handlers (G_SIGNAL_RUN_LAST) schedule an idle reply of G_MOUNT_OPERATION_UNHANDLED after instance handlers return. On first-time SFTP login, gvfs sends ask-question (host key) followed by ask-password. The stale UNHANDLED idle queued by the question stage may still be pending when the AskPassword DBus call is dispatched (priority race: G_PRIORITY_DEFAULT dispatch vs G_PRIORITY_DEFAULT_IDLE idle); it then fires inside the modal password dialog's nested event loop, completes the pending AskPassword invocation as handled=FALSE, and gvfs fails the mount with "Password dialog cancelled" (密码对话框被取消) — reproducible when the UI is busy/event-starved on the password dialog, exactly matching the reported first-login SFTP mount failure. Fix: call g_signal_stop_emission_by_name() in both mountByGvfsAskQuestion and mountByGvfsAskPasswd, same as gvfs' own client implementation (gmountsource.c op_ask_password/op_ask_question). All reply paths already call g_mount_operation_reply explicitly, so stopping the default handler is safe. Verified with a minimal gio reproducer against a local SFTP server: - busy mode (stale idle + nested dialog loop): mount fails with "密码对话框被取消" (G_IO_ERROR_FAILED_HANDLED) before the fix - with stop_emission: mount succeeds under identical conditions Log: 修复首次登录挂载sftp点击仍然登录后提示挂载失败密码对话框被取消 Influence: sftp/ftp/smb 挂载过程中密码与主机密钥确认对话框交互不再被 gio 默认处理器竞态打断 Bug: https://pms.uniontech.com/bug-view-376305.html Change-Id: I1f9e2d6c4b7a48e3952f0a1d8e6c5b3a7f2d4e8c
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFixes the first SFTP login race by stopping default GMountOperation signal emission for question and password prompts, preventing a stale asynchronous UNHANDLED reply from being delivered during the subsequent authentication dialog and reported as “password dialog cancelled.” Sequence diagram for preventing stale GMountOperation repliessequenceDiagram
participant GVFS
participant GMountOperation
participant DNetworkMounter
participant Dialog
GVFS->>GMountOperation: emit ask-question
GMountOperation->>DNetworkMounter: mountByGvfsAskQuestion()
DNetworkMounter->>GMountOperation: g_signal_stop_emission_by_name(self, ask-question)
DNetworkMounter->>Dialog: show host-key question
Dialog-->>DNetworkMounter: explicit reply
DNetworkMounter-->>GVFS: handled response
GVFS->>GMountOperation: emit ask-password
GMountOperation->>DNetworkMounter: mountByGvfsAskPasswd()
DNetworkMounter->>GMountOperation: g_signal_stop_emission_by_name(self, ask-password)
DNetworkMounter->>Dialog: show authentication dialog
Dialog-->>DNetworkMounter: explicit reply
DNetworkMounter-->>GVFS: handled response
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #389 to master
Cherry-pick PR #389 (commit 8081779) to master branch.
Fix: first SFTP login, after clicking "Still Login", the mount fails with a "password dialog cancelled" error. Root cause: GMountOperation signal emission is not stopped, causing a premature UNHANDLED reply.
Changes: src/dfm-mount/private/dnetworkmounter.cpp — add g_signal_stop_emission_by_name() calls in mountByGvfsAskQuestion and mountByGvfsAskPasswd entry points.
Summary by Sourcery
Prevent default GMountOperation signal handling from issuing premature unhandled replies during interactive SFTP authentication.
Bug Fixes:
Enhancements: