Closed Bug 368477 Opened 18 years ago Closed 14 years ago

Unsuitable behaviour when $HOME is not set

Categories

(Core :: XPCOM, defect)

1.8 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

(I've also heard of crashes, but I'm not quite sure about this)

When $HOME is not set, the application, whatever it may be, tries to find the profile in a /.$VENDOR/ directory, for example.

Basically, the main problem is that GetUnixHomeDir (http://lxr.mozilla.org/seamonkey/source/xpcom/io/SpecialSystemDirectory.cpp#222) just tries to get the HOME environment variable without a fallback. If HOME is not set, it should use getpwuid(getuid())->pw_dir (or the NSPR equivalent if there is any).

Speaking of this function, it's strange that VMS uses getenv while others use PR_GetEnv, probably something that should be corrected.

I also found several places that use the HOME environment variable, such as http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsAppFileLocationProvider.cpp#378 or http://lxr.mozilla.org/seamonkey/source/toolkit/xre/nsXREDirProvider.cpp#951, they probably should use the GetUnixHomeDir instead.
This makes sure that any code using $HOME will get a value.
Assignee: nobody → mh+mozilla
Attachment #441799 - Flags: review?(benjamin)
Blocks: 291162
Attachment #441799 - Flags: review?(benjamin) → review+
http://hg.mozilla.org/mozilla-central/rev/162eea2a68e8
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: