Bug 358 - Registry's UserStore hardcodes a path in user's home directory
Summary: Registry's UserStore hardcodes a path in user's home directory
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-22 04:44 UTC by Iain Lane
Modified: 2014-09-25 05:11 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Iain Lane 2011-08-22 04:44:49 UTC
Sometimes a user's home directory may not be where you want to store regsistry keys for the current user (Registry.CurrentUser). Unfortunately, it looks as if mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:778 hardcodes this storage there. You can override the system storage directory at runtime using MONO_REGISTRY_PATH, but not the user one.

It would be better *anyway* if this used SpecialFolder.Config as that is the right place to put configuration files on *nix systems, but that would come with the added benefit of being able to be properly overridden at runtime (without resetting $HOME if my other patch gets accepted [currently you can't change it /at all/ because SpecialFolder.Personal is hardcoded]).

And/or another environment variable such as MONO_CURRENTUSER_REGISTRY_PATH could be used.
Comment 1 Adam Brengesjö 2012-07-03 16:51:03 UTC
I have added a commit for this on https://github.com/adbre/mono/tree/iss358,
but I'm not so sure about the consequenses for this change, so I have not yet opened a pull request.
Comment 2 Alex Rønne Petersen 2014-06-18 20:35:45 UTC
https://github.com/mono/mono/pull/1109
Comment 3 Bartek Juriewicz 2014-09-25 05:11:38 UTC
The discussion on github seems to be dead for a while, but the issue status is definitively not resolved yet. Since Adam wrote the man page and the fix is requested, maybe the bug should be reopened, and bumped?