Mouse Without Borders: create received files in the logged-on user's context#48769
Open
yeelam-gordon wants to merge 4 commits into
Open
Mouse Without Borders: create received files in the logged-on user's context#48769yeelam-gordon wants to merge 4 commits into
yeelam-gordon wants to merge 4 commits into
Conversation
…context When the service runs elevated, the destination folder for an incoming clipboard/file transfer is created while impersonating the logged-on user, but the file itself was created outside that context. This makes the resulting file ownership/permissions inconsistent with the folder. Create the file in the same impersonated context as its folder so it is owned by the logged-on user and inherits the folder's permissions. On the logon/screen-saver desktop the storage lives under Program Files where there is no interactive user to impersonate, so the file is still created directly to preserve existing behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MuyuanMS
reviewed
Jun 22, 2026
MuyuanMS
reviewed
Jun 22, 2026
MuyuanMS
approved these changes
Jun 22, 2026
LegendaryBlair
approved these changes
Jun 22, 2026
MuyuanMS
reviewed
Jun 23, 2026
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.
Summary
When Mouse Without Borders receives a file (clipboard / file transfer) while the
service is running elevated, the destination folder is created while impersonating
the logged-on user, but the file itself was created outside of that context. As a
result, the received file's ownership and permissions did not match the folder it
lives in.
This change creates the received file in the same context as its destination folder:
the logged-on user, so it is owned by that user and inherits the folder's
permissions.
Program Files, wherethere is no interactive user to impersonate, so the file continues to be created
directly — existing behavior is preserved.
Scope
src/modules/MouseWithoutBorders/App/Core/Clipboard.cs.Launch.ImpersonateLoggedOnUserAndDoSomethinghelper; no newdependencies, no API / IPC / schema changes.
and only for the per-user storage path. The
Program Filespath keeps its currentbehavior.
Validation
MouseWithoutBorders.csproj(Release | x64) — succeeds (exit code 0).