Bug 563739 - FS.userHome() must verify the returned File
Summary: FS.userHome() must verify the returned File
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 5.8   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-29 14:49 EDT by Thomas Wolf CLA
Modified: 2020-06-01 01:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2020-05-29 14:49:38 EDT
FS.userHomeImpl() may return a completely bogus File object with an invalid Path if the user's environment variables are wrong.

JGit *must* validate the returned object (via toPath()), if that yields an InvalidPathException, the problem must be logged and a default value (System property user.home, if that is valid) must be set.

This is mostly a problem for the values returned by FS_Win and FS_Win_Cygwin, but it might be a good idea to check in FS for all systems.

See forum post https://www.eclipse.org/forums/index.php/t/1103963/ .
Comment 1 Eclipse Genie CLA 2020-05-29 17:07:58 EDT
New Gerrit change created: https://git.eclipse.org/r/163871
Comment 2 Eclipse Genie CLA 2020-05-31 14:45:58 EDT
Gerrit change https://git.eclipse.org/r/163871 was merged to [master].
Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=0b2d41b8584e16d6f7abeca92eaae326033b4489