Closed
Bug 92294
Opened 24 years ago
Closed 24 years ago
nsIFile IsDirectory doesn't handle symlinks [FIX][REVIEW]
Categories
(Core :: XPCOM, defect, P1)
Tracking
()
RESOLVED
INVALID
mozilla0.9.4
People
(Reporter: pete, Assigned: pete)
Details
Attachments
(4 files)
1.84 KB,
patch
|
Details | Diff | Splinter Review | |
1.82 KB,
patch
|
Details | Diff | Splinter Review | |
1.77 KB,
patch
|
Details | Diff | Splinter Review | |
1.79 KB,
patch
|
Details | Diff | Splinter Review |
Assigning to myself, i have a fix for this in my local tree.
--pete
![]() |
||
Updated•24 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.4
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
You need to give this code some nsCOMPtr love, this will leak 'target' in case
target->InitWithPath() or any other calls before the NS_RELEASE(target) fails:
+ nsLocalFile *target = new nsLocalFile();
+ if (!target)
+ return NS_ERROR_OUT_OF_MEMORY;
+ NS_ADDREF(target);
+ if (NS_FAILED(rv=target->InitWithPath(symPath)))
+ return rv;
Change that and I'll have one more look.
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
> You need to give this code some nsCOMPtr love, this will leak 'target'
Duh, Don't knwo why i did that . . .
Anyway, fixed.
Thanks Johnny.
--pete
Assignee | ||
Updated•24 years ago
|
Priority: -- → P1
Comment 7•24 years ago
|
||
I don't get it -- why is this bug's patch code necessary? nsLocalFileUnix.h's
nsLocalFile::FillStatCache calls stat(2), which follows symlinks. There should
be no need to get the target, worry about whether it exists, etc. Is this bug
about nsLocalFileWin.cpp or Mac bugs not found on Unix?
/be
Assignee | ||
Comment 8•24 years ago
|
||
Brendan, you are right. However, yesterday isDirectory was not working properly.
It was returning false when checking a symlinked dir . . .
Today it is . . . ?
I have to see if i can duplicate what I was seeing yesterday.
This is strange.
--pete
Assignee | ||
Comment 9•24 years ago
|
||
I'm going to mark this one invalid. I can't seem to repeat what i was seeing the
other day. I will reopen if i stumble across this again.
--pete
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Comment 10•22 years ago
|
||
*** Bug 192809 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•