Closed
Bug 65680
Opened 25 years ago
Closed 25 years ago
Need file-replace utility for Mac
Categories
(Core Graveyard :: Installer: XPInstall Engine, defect, P1)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.8.1
People
(Reporter: dveditz, Assigned: samir_bugzilla)
References
Details
(Whiteboard: [xpiprd])
Attachments
(8 files)
|
4.98 KB,
patch
|
Details | Diff | Splinter Review | |
|
764 bytes,
patch
|
Details | Diff | Splinter Review | |
|
4.62 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.08 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.06 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.32 KB,
patch
|
Details | Diff | Splinter Review | |
|
11.54 KB,
patch
|
Details | Diff | Splinter Review | |
|
11.93 KB,
patch
|
Details | Diff | Splinter Review |
Need a Mac native utility to perform the the post-install replaces
| Reporter | ||
Comment 2•25 years ago
|
||
This is critical. Perhaps only need to help dbragg write the NativeReplace and
NativeDelete routines to plug into the generic framework he wrote for win/linux
Priority: -- → P1
Target Milestone: mozilla0.9 → mozilla0.8
| Assignee | ||
Comment 3•25 years ago
|
||
| Assignee | ||
Comment 4•25 years ago
|
||
| Assignee | ||
Comment 5•25 years ago
|
||
| Assignee | ||
Comment 6•25 years ago
|
||
Not attached but also new is the XPICleanup.mcp project file.
Status: NEW → ASSIGNED
Comment 7•25 years ago
|
||
Comments:
vr_stubs.c
You didn't touch it directly, but the hacky mac -> Unix path conversions
in this file will break if there is a / anywhere in the folder path. This
code needs to be tested with wacky paths.
InstallCleanupMac.cpp:
I'm really reluctant to approve code that uses full path strings to move
and delete files; it's so hard to do sanity checking, and very dangerous.
Where are these paths coming from? I think you need to at least test for
obvious bad cases, like empty strings, strings with no leaf name, or strings
with a leading :.
| Assignee | ||
Comment 8•25 years ago
|
||
Thanks for the comments Simon. These full paths are coming from libreg.
Although libreg stores Mac aliases, the file locations are returned as full
paths. There was some vague mention of this changing but given the current
resource constraints I don't anticpate this happening soon. I'll leave it to
Dan Veditz and Don Bragg to comment in greater detail on paths being returned by
libreg and any timeline on when this might change.
For now I will revise InstallCleanupMac.cpp by adding a routine to verify the
full paths per the criteria you have specified and resubmit for r and sr
thereafter. Thanks again.
| Reporter | ||
Comment 9•25 years ago
|
||
Actually if you look at ScheduledTask.cpp you'll see that a half-hearted
attempt was made to store persistent data, creating a local
GetPersistentStringFromSpec() routine before nsILocalFile supported such a
thing. The delete/replace lists don't use the libreg FILE type so there's no
requirement that it store file paths the way the version registry stuff
currently does.
Of course, Doug didn't come back and finish this when he implemented the
required nsILocalFile feature. It'd be a one-line change in ScheduledTasks.cpp
to make GetPersistentStringFromSpec() use LocalFile->GetPersistentDescriptor()
instead of LocalFile->GetPath().
On the Mac utility side you'd have to duplicate most of the
SetPersistentDescriptor() stuff from nsLocalFileMac.cpp since you won't be able
to call into XPCOM for this service. Looks pretty simple. (You'll also need a
local equivalent to PL_Base64Decode() from
mozilla/nsprpub/lib/libc/src/base64.c)
Comment 10•25 years ago
|
||
Is there any reason we actually have to pass persistent descriptors around here?
Those are intended to be saved to disk between runs, not to be passed around as
proxies for file specifiers, and, in this latter use, they may have some
undesirable behaviours (the Alias Manager loves to try to 'fix up' aliases, which
is what they are on Mac, when files go missing). Perhaps it would be OK to use
them, but bail if the 'wasChanged' param of ResolveAlias returns true, or
something.
| Reporter | ||
Comment 11•25 years ago
|
||
Yes, they're persistent because the replace utility has to run at some later
time once Mozilla has shut down. Mozilla needs to communicate with this utility
in some way, which it does by storing the persistent descriptors (or file
paths, or do you have better suggestions?) in a file.
| Reporter | ||
Comment 12•25 years ago
|
||
Since the current Netscape 6/Mozilla stores full paths the utility will have to
handle the current format in the upgrade case. I spun off bug 67858 to switch
to using aliases in the future, but this fix is not wasted since we'll have to
keep this code as well.
Blocks: 67858
| Assignee | ||
Comment 13•25 years ago
|
||
Comment 14•25 years ago
|
||
r=dbragg for the path verification changes made in the last attachment.
| Assignee | ||
Comment 15•25 years ago
|
||
Simon,
Please super review the 4th patch that incorporates your suggestions to verify
the paths. Thanks.
Comment 16•25 years ago
|
||
(strcmp(aPath, "") == 0) is an expensive way to check for an empty string. Try
(!*aPath) or (*aPath == '\0').
An an additional safety check, do we know what the file types/creators will be
for the files that we're deleting? If so, perhaps we can check them at cleanup
time. Sorry to be paranoid, but I'm always scared with code that deletes files.
Comment 17•25 years ago
|
||
sr=sfraser on the last patch, anyhow.
| Assignee | ||
Comment 18•25 years ago
|
||
Comment 19•25 years ago
|
||
r=sfraser again.
| Assignee | ||
Comment 20•25 years ago
|
||
The replace utility is generic for all kinds of files including jars, shared
libraries, and even arbitrary third party files so we do not know the creator
codes or file types of the files being replaced or deleted. Thus, although it is
clearly a good idea to be paranoid about verifying file types and creators at
deletion time we can not be confined to a list of types or creators.
| Assignee | ||
Comment 22•25 years ago
|
||
| Assignee | ||
Comment 23•25 years ago
|
||
Regarding the last patch attached:
Don,
Please bless with an r.
Simon,
Please bless witha n sr.
Thanks!
Comment 24•25 years ago
|
||
Looks like what we want. r=dbragg.
Comment 25•25 years ago
|
||
Where are the implementation for PerformScheduledTasks() and sleep() ?
You should also use const char* for non-modified file path params.
| Assignee | ||
Comment 26•25 years ago
|
||
PerformScheduledTasks() is in InstallCleanup.cpp which is XP code covered by
another bug. I'm using the standard sleep() from the MSL C Runtime.
Comment 27•25 years ago
|
||
Did you look at MSL's sleep() implementation? It just calls Delay(), which is
bad.
| Assignee | ||
Comment 28•25 years ago
|
||
| Assignee | ||
Comment 29•25 years ago
|
||
Oops, didn't realize the text was performatted. Let's try that last comment iwth
the above patch again:
(*) Made XPICleanup a faceless background app
(*) Made it so an alias to XPIClenaup is put in the Startup Items folder and
deleted when the app is done
Don,
Please r.
Simon,
Please sr.
Thanks.
| Assignee | ||
Comment 30•25 years ago
|
||
Comment 31•25 years ago
|
||
For what my Mac experience is worth I give it a resounding R=DBRAGG.
Comment 32•25 years ago
|
||
You should remove this comment:
// faceless background apps only get a 2K stack by default. If necessary,
// increase the stack size here (by calling GetApplLimit to find the current
// heap limit, and SetApplLimit to set it to a lower address, thus reserving
// more space for the stack)
since it only applies to 68k code.
Otherwise, sr=sfraser. But please test the heck out of this, including the
restart case.
| Reporter | ||
Updated•25 years ago
|
| Assignee | ||
Updated•25 years ago
|
Target Milestone: mozilla0.9 → mozilla0.8.1
| Assignee | ||
Comment 33•25 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 34•25 years ago
|
||
Build: 2001-06-07-11-0.9.1(MAC)
Files can be replaced on Mac. Cleanup occurs. No vtrunk needed since this was
checked in before 0.9. Marking Verified!
Status: RESOLVED → VERIFIED
Updated•10 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•