Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC command line on windows #5909

Closed
AtmanActive opened this issue Oct 1, 2022 · 8 comments
Closed

RPC command line on windows #5909

AtmanActive opened this issue Oct 1, 2022 · 8 comments
Labels

Comments

@AtmanActive
Copy link

The issue

Hi,

I'm trying to use RPC command line to automate running Mumble instance on windows but it doesn't work.
I have MumblePortable running and I issue:

mumble.exe rpc mute

... and nothing happens.

When I issue

mumble.exe -h

... then I do get the window with all command line options.

I read here someone suggested to check the path in the config file. I do have mumble.ini but I don't know what syntax would that be.

Any advice would be highly appreciated.

Thanks.

Mumble version

1.4.274

Mumble component

Client

OS

Windows

Additional information

No response

@Krzmbrzl
Copy link
Member

Krzmbrzl commented Oct 1, 2022

The first thing to try would be to check if a regular Mumble install shows the same issue. We don't provide portable installations (yet) and thus I don't know what they did to produce a portable Mumble version. Maybe this involves some sandboxing that also prevents RPC from working 🤔

@github-actions
Copy link

github-actions bot commented Oct 6, 2022

As there has been no activity on this issue for a couple of days, we assume that your issue has been fixed in the meantime.
Should this not be the case, please let us know.

If no further activity happens, this issue will be closed within 3 days.

@github-actions github-actions bot added the stale-support This issue hasn't seen any activity in recent time and will probably be closed soon. label Oct 6, 2022
@AtmanActive
Copy link
Author

I just tested with the latest official version and it is working as expected.

Even though I didn't even install the MSI file but just unpacked it and ran mumble.exe from there.

So what's different?
How does Mumble determine where to direct the RPC command?

As far as I know, MumblePortable doesn't touch mumble.exe itself in any way. It just prepares the working dir and config files and runs mumble.exe.

Will investigate some more...

@AtmanActive
Copy link
Author

This is how mumble,exe is ran by MumblePortable.exe:

mumble.exe /UAC:79283A /NCRC

Could this be the culprit?

I have no idea what those arguments are.

@github-actions github-actions bot removed the stale-support This issue hasn't seen any activity in recent time and will probably be closed soon. label Oct 7, 2022
@Krzmbrzl
Copy link
Member

Krzmbrzl commented Oct 7, 2022

I have no idea what those arguments are.

Me neither. Those are not handled by us.

In terms of how RPC is handled, I believe this is handled by Qt. Not quite sure though...

@AtmanActive
Copy link
Author

OK, got it figured out.

First I tried running the official mumble.exe with /UAC:79283A /NCRC arguments - no change, it is still working as expected.

Then I found MumblePortable.ini in the subfolder App\AppInfo\Launcher of the MumblePortable folder structure and there, on line 6 there was RunAsAdmin=try. When I removed that line, mumble RPC started working as expected.

On the other hand, if I leave that line RunAsAdmin=try in and I run my windows command prompt as admin, then, again, RPC is working correctly.

So the issue was admin elevation.
If mumble,exe is ran as admin, then, one needs a windows command prompt ran as admin as well in order for RPC to work.
If mumbe.exe is not elevated, then, a normal command prompt can reach RPC.
In other words non-elevated mumble.exe-RPC can't reach an elevated mumble.exe. Which is to be expected.

Now the question remains: does mumble.exe really need to be run as admin?

Or was this just an oversight by PortableApps.com packers?

I don't mind either, but would like to know what is official Mumble's position on this.

Thanks.

@davidebeatrici
Copy link
Member

Mumble should never be run as administrator, but there is a potential reason for doing so: getting global shortcuts to work in privileged applications.

We make use of uiAccess in official releases:

if(elevation)
set_property(TARGET mumble_exe APPEND_STRING PROPERTY LINK_FLAGS " /MANIFESTUAC:\"level=\'asInvoker\' uiAccess=\'true\'\"")
endif()

From https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-account-control-allow-uiaccess-applications-to-prompt-for-elevation-without-using-the-secure-desktop:

UIA programs are designed to interact with Windows and application programs on behalf of a user. This setting allows UIA programs to bypass the secure desktop to increase usability in certain cases, but it allows elevation requests to appear on the regular interactive desktop instead of on the secure desktop. This requests-appearance increases the risk that a malicious program could intercept data that is being transferred between the UI and the application. Because UIA programs must be able to respond to prompts regarding security issues, such as the UAC elevation prompt, UIA programs must be highly trusted. To be considered trusted, a UIA program must be digitally signed. By default, UIA programs can be run only from the following protected paths:

  • ..\Program Files\ (and subfolders)
  • ..\Program Files (x86)\ (and subfolders, in 64-bit versions of Windows only)
  • ..\Windows\System32\

The requirement to be in a protected path can be disabled by the User Account Control: Only elevate UIAccess applications that are installed in secure locations setting. Although this setting applies to any UIA program, it's used primarily in certain Windows Remote Assistance scenarios.

@Krzmbrzl
Copy link
Member

Krzmbrzl commented Oct 8, 2022

As Davide said. The gist of it is: At this point you either install Mumble in the programs directory on your system or global shortcuts will only work while not focusing on an application that runs with raised privileges.

@Krzmbrzl Krzmbrzl closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants