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

xdg-utils: Properly quote flatpak command #1097

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

jsparber
Copy link
Contributor

@jsparber jsparber commented Sep 6, 2023

xdp_app_info_rewrite_commandline has to respect quote_escape also when no commandline is given.

src/xdp-utils.c Outdated Show resolved Hide resolved
@jsparber jsparber force-pushed the fix_background_exce_quotes branch from b86edec to 4dc54f4 Compare September 14, 2023 14:06
@smcv
Copy link
Collaborator

smcv commented Sep 14, 2023

xdp_app_info_rewrite_commandline has to respect quote_escape also when no commandline is given

This looks right as far as I can tell, but what bug are you fixing? It would be much easier to assess whether this is correct with either a comment here or an issue report that briefly describes: steps to reproduce; expected result; actual result.

@jangernert
Copy link

I tried to build an run this to see if it fixes a bug I am hitting. But I failed to make it work. So here are my observations in hope it helps to further review the merge request:

  • install ashpd demo and open it
  • in the background section enable "Auto Start" and press "Request"
  • .config/autostart/ will have the file com.belmoussaoui.ashpd.demo.desktop
  • the app id is escaped in the exec line and won't work: Exec=flatpak run ''\\''com.belmoussaoui.ashpd.demo'\\'''
  • go back to ashpd demo and fill in something into the "Command" entry and press "Request" again
  • the autostart desktop file will change with the following exec line Exec=flatpak run --command=test123 com.belmoussaoui.ashpd.demo
  • the app id is not escaped and the autostart will work

@smcv
Copy link
Collaborator

smcv commented Sep 29, 2023

to see if it fixes a bug I am hitting

Please open an issue that describes the bug you are hitting (version of x-d-p / what you did / expected result / actual result), while using an unpatched xdg-desktop-portal (without this PR applied).

@jangernert
Copy link

to see if it fixes a bug I am hitting

Please open an issue that describes the bug you are hitting (version of x-d-p / what you did / expected result / actual result), while using an unpatched xdg-desktop-portal (without this PR applied).

#1118

@jsparber
Copy link
Contributor Author

jsparber commented Oct 2, 2023

Sorry for not responding for the last few weeks.

@smcv I didn't think this would fix an actual bug, i just noticed that the code path was wrong

@jangernert Does this fix issue #1118 for you?

`xdp_app_info_rewrite_commandline` has to respect `quote_escape` also
when no commandline is given.

Fixes flatpak#1118
@jsparber jsparber force-pushed the fix_background_exce_quotes branch from a158e8c to ae445d2 Compare October 2, 2023 08:26
@jangernert
Copy link

@jangernert Does this fix issue #1118 for you?

I wasn't able to test it. I was able to build and run the branch. But all the portal requests kept failing. Even the ones not related to this MR. So I must have done something wrong.

@jsparber
Copy link
Contributor Author

jsparber commented Oct 2, 2023

@jangernert Does this fix issue #1118 for you?

I wasn't able to test it. I was able to build and run the branch. But all the portal requests kept failing. Even the ones not related to this MR. So I must have done something wrong.

I had the same problem initially adding a symlink ln -s /usr/share/xdg-desktop-portal /usr/local/share/xdg-desktop-portal after installing to the /usr/local/ prefix solves the issue. I'm not sure if this is the best solution but it makes it work for Fedora

@jangernert
Copy link

I had the same problem initially adding a symlink ln -s /usr/share/xdg-desktop-portal /usr/local/share/xdg-desktop-portal after installing to the /usr/local/ prefix solves the issue. I'm not sure if this is the best solution but it makes it work for Fedora

That did the trick for me as well. And I can confirm: #1118 was fixed running this branch compared to the fedora package. Didn't test master without this MR, though. So take it with a tiny bit of salt.

@GeorgesStavracas GeorgesStavracas added this to the 1.18 milestone Oct 3, 2023
@GeorgesStavracas GeorgesStavracas added this pull request to the merge queue Oct 3, 2023
Merged via the queue into flatpak:main with commit ce57c6c Oct 3, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Triaged
Development

Successfully merging this pull request may close these issues.

4 participants