← Back to team overview

desktop-packages team mailing list archive

[Bug 816804] Re: gvfs-open exit code is 0 when file is not found and no default application is registred

 

the fix has been commited to the upstream git and will be in the next
update

** Changed in: gvfs (Ubuntu)
       Status: Triaged => Fix Committed

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gvfs in Ubuntu.
https://bugs.launchpad.net/bugs/816804

Title:
  gvfs-open exit code is 0 when file is not found and no default
  application is registred

Status in GVFS:
  Fix Released
Status in “gvfs” package in Ubuntu:
  Fix Committed

Bug description:
  gvfs-open exits with error code 0 (success) even when there is error.

  The following conditions should exit with error code > 0:
  - File is not found
  - File is found, but default application for opening it is not registred

  Examples:
  $ gvfs-open nofile.txt || echo "NOT FOUND!"
  gvfs-open: file:///home/rodrigo/nofile.txt: error opening location: Error stating file '/home/rodrigo/nofile.txt': No such file or directory

  $ touch test.mdb ; gvfs-open nofile.txt || echo "NO ASSOCIATION!" ; rm test.mdb
  gvfs-open: file:///home/rodrigo/nofile.txt: error opening location: Error stating file '/home/rodrigo/nofile.txt': No such file or directory

  In both situations exit code was 0,  meaning success, even when gvfs-
  open was clearly NOT successful. This makes gvfs-open hard to use in
  scripts.

  And the problem is even worse considering gvfs-open is used by xdg-
  open

  A quick look at source code shows that it has a hardcoded "return 0"
  in main() function. The open() function is "static void". Both could
  easily be changed so open would be "static int open(...)", set a
  proper return code, and main would test for it.

  Using Maverick 10.10 64bits, gvfs 1.6.4-0ubuntu1.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/gvfs/+bug/816804/+subscriptions