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

Fix client pid check #786

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix client pid check #786

wants to merge 2 commits into from

Conversation

cwendling
Copy link
Member

@cwendling cwendling commented Jan 7, 2025

Fixes #301.


Disclaimer: I didn't test this, I don't actually use flatpacks or such. However, given a check was clearly the wrong way around, and I imported another fix from Metacity, it might just work.

If this doesn't do it, possibly importing Metacity commits dade470e13292c58822b0c180019caf0ea3862f3 c6584a38a234726c1128d044fd7cc5a0f8379c69 c5136ec907fab167ffddfe4d10c3902c6c5d8852 8430e8436cb6bac732c00de5b5a3c3d73be62871 a7d6f11b3e712751b010a8f7622b148c93765f70 7c1cc3ca1d8131499b9cf2ef50b295602ffd6112 3e6358113acf61e0c68419bec6cc68a29603a2ec might help (it's mostly refactoring in the end tho, so I'm hopeful the simpler patch here would work).

CC @lukefromdc @lambdanil @tidux @rusty-snake @caiodev (and everybody else from #301), please test if you can :)

X's Success return value is 0, not a boolean, so the check was
effectively inverted.
@caiodev
Copy link

caiodev commented Jan 7, 2025

Hello @cwendling, how are you doing? Do you know where I could find build instructions for it? I've never done it. Tks 👍

@rusty-snake
Copy link

I didn't test this, I don't actually use flatpacks or such.

Try if you can reproduce with unshare --map-current-user --pid --fork PROGRAM

@cwendling
Copy link
Member Author

Try if you can reproduce with unshare --map-current-user --pid --fork PROGRAM

OK thanks, using this it fixes the issue: without these patches it shows "as superuser", with it it shows like a normal window. So that's a first win :)

Hello @cwendling, how are you doing? Do you know where I could find build instructions for it? I've never done it. Tks 👍

It depends a bit on your distribution and how comfortable your are building things, but on Debian-based distros, you can do something like:

~$ sudo apt-get build-dep marco
~$ git clone https://github.com/cwendling/marco.git
~$ cd marco
~/marco$ git switch client-pid
~/marco$ ./autogen.sh && ./configure && make -j4 && sudo make install

This will install the patched marco in /usr/local. Then, try /usr/local/bin/marco --replace and you should run the patched version (normally simply marco --replace should do, but better safe than sorry).

To uninstall the local build, run sudo make uninstall.

It's pretty standard, so you can also find additional info a bit everywhere :)

@caiodev
Copy link

caiodev commented Jan 7, 2025

@cwendling Nice. Will try it 👍

@raveit65
Copy link
Member

raveit65 commented Jan 7, 2025

Run as superuser is gone in titlebar with signal messenger from flathub.
Hopefully you do not run again in this bug caused by first attempted to fix this issue.
See #746 and reverted commit d3add65

@cwendling
Copy link
Member Author

@raveit65 I guess the issue you mentioned under X2Go was due to the lack of verification both that XRES was available, and that the XRES call was successful or not. Unfortunately although the XRES test implemented in #747 was good, the added check for the whether the XRES call was successful was done the wrong way around.

Either way, this shouldn't bring back the X2Go issue as both checks are kept, only the latter is fixed so things actually work when XRES is present.

And thanks for testing :)

@lukefromdc
Copy link
Member

lukefromdc commented Jan 8, 2025 via email

Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I could not test with flatpak (not installed here), I didn't get any issues with the build, nor a problem with not showing caja under sudo as "ROOT" or applying that to caja running as a normal user

@cwendling
Copy link
Member Author

@caiodev have you had a chance to test this yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firejail/Flatpak applications display "as superuser" on window title
5 participants