Closed Bug 263366 Opened 20 years ago Closed 20 years ago

execute() doesn't check if exection succeeded or not, and claims it did even if that's not the case

Categories

(Core Graveyard :: Installer: XPInstall Engine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jst, Assigned: dveditz)

Details

(Keywords: fixed-aviary1.0, fixed1.7.5)

Attachments

(2 files, 2 obsolete files)

If an xpi file calls execute("foo") and we fail to execute "foo", the xpinstall
process happily pretends everything worked fine even if it failed to execute
"foo", or if execution of "foo" failed. This seems rather wrong... Patch coming up.
Attachment #161395 - Flags: superreview?(dveditz)
Attachment #161395 - Flags: review?(peterv)
Comment on attachment 161395 [details] [diff] [review]
Catch errors from executing files

A non-blocking process--a very common case if you're launching a "wrapped
install"--will return the initial mExitValue of -1

We should probably invent a new error code for this, too. Failures of the
"Complete()" methods are all lumped into the return from performInstall().
Script authors would be helped to know that it was an executable that failed.
Attachment #161395 - Flags: superreview?(dveditz) → superreview-
We probably want to return an error in the File.execute() case as well... patch
coming up to address my issues
Attached patch patch for aviary branch (obsolete) — Splinter Review
This patch expands the previous patch to address my comments. Sorry it's an
aviary patch -- my only clean tree at the moment -- but there shouldn't be any
trunk conflicts
Assignee: jst → dveditz
Attachment #161395 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #161418 - Flags: superreview?(jst)
Attachment #161418 - Flags: review?(peterv)
Comment on attachment 161418 [details] [diff] [review]
patch for aviary branch

- In nsInstallFileOpItem::NativeFileOpFileExe...

       rv = process->Run(mBlocking, (const char **)&cParams, argcount, nsnull);
+      if (NS_SUCCEEDED(rv) && mBlocking)
+      {
[...]
+      }
+      else
+	 result = nsInstall::EXECUTION_ERROR;

Won't this result in an error for every non-blocking execute() call that goes
through this code?

sr=jst with that taken care of.
Attachment #161418 - Flags: superreview?(jst) → superreview+
Comment on attachment 161418 [details] [diff] [review]
patch for aviary branch

>Index: xpinstall/src/nsInstall.h
>===================================================================

>-            TOO_MANY_CERTIFICATES       = -203,
>+            EXECUTION_ERROR             = -203,

Do we care about the other places where this is defined? (see
http://lxr.mozilla.org/seamonkey/search?string=TOO_MANY_CERTIFICATES)

What jst said.
Attachment #161418 - Flags: review?(peterv) → review+
Attachment #161395 - Flags: review?(peterv)
Fixed installer error strings and the File.execute() non-blocking case
Attachment #161418 - Attachment is obsolete: true
Comment on attachment 162166 [details] [diff] [review]
fix review comments

Carrying over r/sr, seeking branch approval. jst wants this for the plugin
finder
Attachment #162166 - Flags: superreview+
Attachment #162166 - Flags: review+
Attachment #162166 - Flags: approval1.7.x?
Attachment #162166 - Flags: approval-aviary?
Nominating for 1.0 because I think jst needs this: clear nomination if you don't.
Flags: blocking-aviary1.0?
Comment on attachment 162166 [details] [diff] [review]
fix review comments

a=asa for aviary checkin and 1.7 checkin.
Attachment #162166 - Flags: approval1.7.x?
Attachment #162166 - Flags: approval1.7.x+
Attachment #162166 - Flags: approval-aviary?
Attachment #162166 - Flags: approval-aviary+
Fixed on trunk, 1.7 and aviary branches.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
For the record, this caused a regression on the mac due to a bug in the fix for
bug 263429 where mExitValue was never set to the actual exit value, it was left
at its initial value of -1. Fixed on branches, no bug.
Oh, and that was fixed on the trunk too.
Flags: blocking-aviary1.0?
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: