Right click > "show in folder" results in "There was an error executing xdg-open

Bug #1354563 reported by Elijah Lynn
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Shutter
Fix Released
Undecided
Michael Kogan

Bug Description

When right clicking an image from the main window and clicking "show in folder I get the error "There was an error executing xdg-open".

Screenshot attached.

Tags: xdg-open
Revision history for this message
Elijah Lynn (elijah-lynn) wrote :
Revision history for this message
Vadim Peretokin (vperetokin) wrote : Re: [Bug 1354563] [NEW] Right click > "show in folder" results in "There was an error executing xdg-open

Hiya - looks like you've attached the wrong screenshot.

On Sat, Aug 9, 2014 at 5:24 AM, Elijah Lynn <email address hidden> wrote:

> Public bug reported:
>
> When right clicking an image from the main window and clicking "show in
> folder I get the error "There was an error executing xdg-open".
>
> Screenshot attached.
>
> ** Affects: shutter
> Importance: Undecided
> Status: New
>
>
> ** Tags: xdg-open
>
> ** Attachment added: "xdg-error"
>
> https://bugs.launchpad.net/bugs/1354563/+attachment/4173018/+files/Selection_001.png
>
> --
> You received this bug notification because you are a member of Shutter
> Team, which is subscribed to Shutter.
> https://bugs.launchpad.net/bugs/1354563
>
> Title:
> Right click > "show in folder" results in "There was an error
> executing xdg-open
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/shutter/+bug/1354563/+subscriptions
>

Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

Hi Vadim,

Thanks for letting me know about that. I actually just found this issue via a search in an attempt to fix it again, lol.

Here is a gif of the error...

Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

Just updated to 0.93.1 (Rev.1278) and this is still present.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

What is hidden in "Show more details"?

Changed in shutter:
status: New → Incomplete
Revision history for this message
Brian McGinn (a6zj6) wrote :

I also have this issue. When I expand the 'Show more details' window it shows 'Exit Code: 1'.

Oddly, if I kill it and start it again it works. Perhaps it's only the instance started during boot?

See attached.

Revision history for this message
Brian McGinn (a6zj6) wrote :

Spoke too soon. It resolved itself for about 10 minutes then happened again regardless if I launch it from terminal or just from the launcher. Here are the details when I run it from terminal:

Launched using: /usr/bin/shutter --min_at_startup (also tried less the min_at_startup parameter)

WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!

xdg-open: unexpected argument 'Spike'
Try 'xdg-open --help' for more information.

Anyone have any creative ideas?? I've had this bug forever now. I am running Shutter 0.93.1 rev.1278

Changed in shutter:
status: Incomplete → Confirmed
Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

Okay, I think I figured out what is going on with this after actually setting Shutter up on a RHEL7 box. I tested first by launching from CLI as root `sudo shutter` and right click to open screenshots worked fine there, so I suspected permissions. Then I eventually arrived at running shutter without root on the CLI and looked at the stdout when right clicking to "show in folder". I noticed I had an xdg-open error of "unexpected argument" with part of the folder path. This led me to realize that the string wasn't quoted right and due to the fact that one of the folders in the path had a space in it, it was looking for only the first part of that path and then passing the post-space part of the string as a 2nd argument.

tl;dr
It is most likely a space in your path, check your path for spaces. I am still on 0.93.1, a new version 0.94.x has since come out with bug fixes and I don't know if it includes this.

Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

Browsing through the commits/revisions for the devel branch it appears it may be fixed as they the diff shows some changes to the xdg-open invocation code.

https://bazaar.launchpad.net/~shutter/shutter/devel/revision/1282

Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

And it appears that the fix might just be a side effect of fixing this security vulnerability. https://bugs.launchpad.net/shutter/+bug/1652600

Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

http://ubuntuhandbook.org/index.php/2017/09/shutter-0-94-released-install-ubuntu-16-04/

"Insecure use of system() allows arbitrary code execution via “Show in Folder”"

Revision history for this message
Michael Kogan (michael-kogan) wrote :

The news you linked includes instructions on installing 0.94 from PPA, culd you please check if it indeed solves the problem?

Revision history for this message
Jose Luis Tirado (txelu70) wrote :

I'm having this problem too, but I get an error code of 4, instead of 1. I'm using Archlinux with Gnome Desktop 3.28.0 and Shutter 0.94 rev 1920.

Revision history for this message
Jose Luis Tirado (txelu70) wrote :

I found the reason that causes the error in my case. I'm using a Spanish installation and the folder containing the images is called "Imágenes", which is the default folder for Shutter's snapshots. When I changed this output folder to another one called "Imagenes" (with no tilde) it worked just fine. So it must be the way this folder name was passed to xdg-open that causes the error if it contains non ASCII characters.
I must also say that other options like Open with Image Viewer worked well with the original "Imágenes" folder. Only "show in folder" didn't work.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Thanks for your research, I think, I could fix the bug, will push the fix asap.

Changed in shutter:
assignee: nobody → Photon (michael-kogan)
status: Confirmed → In Progress
Revision history for this message
Michael Kogan (michael-kogan) wrote :

Please test the latest revision 1292!

Changed in shutter:
status: In Progress → Fix Committed
Changed in shutter:
milestone: none → 0.94.1
Changed in shutter:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.