Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "HOME" directory configurable for certstore and registry #113

Closed
mfleisz opened this issue Sep 20, 2011 · 8 comments
Closed

Make "HOME" directory configurable for certstore and registry #113

mfleisz opened this issue Sep 20, 2011 · 8 comments
Milestone

Comments

@mfleisz
Copy link
Member

mfleisz commented Sep 20, 2011

Currently certstore and registry use getenv("HOME") to get a writable location for data files. On Platforms where HOME is not correctly set in the environment this will cause both data stores to fail (i.e. in case HOME is not set certstore will SEGFAULT at line 71 in certstore.c).
The best solution would be to allow the UI front end to override the "home" directory in the settings and if present, this setting is used by all data store helpers instead of getenv(HOME).

@otavio
Copy link
Contributor

otavio commented Sep 25, 2011

@mfleisz I fail to see, except very customized embedded OSs, where HOME wouldn't be set.

What is the use case in this issue?

If this is very specific to embedded stuff (which I am affected as well) I'd prefer to move this to 1.1 if noone objects.

@mfleisz
Copy link
Member Author

mfleisz commented Sep 26, 2011

Not just embedded systems will cause problems - no Windows-based system has "HOME" set by default. In it's current state the core is unusable on anything other than a non-embedded *nix platform as it simply crashes when getenv("HOME") fails.
It's hard for me to estimate how much effort it is going to be to have a clean fix. Maybe at least we can find a solution where certstore silently fails and the core is still able to connect to the server?

@otavio
Copy link
Contributor

otavio commented Sep 26, 2011

Yes, windows is indeed a problem. The urgency of this issue depends if we're going to support Windows for 1.0 or not.

@awakecoding
Copy link
Member

@otavio: I did some work over the last couple of days to push the Windows port forward. I'll handle the configurable home issue, if it's not for Windows, it'll be for something else. ~/.freerdp is usually good for Linux and the BSDs, but then when you get out of those it's usually case by case for what's preferred.

@awakecoding
Copy link
Member

...and pushed.

Now if you set settings->home_path to something other than NULL (NULL by default), both the certstore and registry will use that value instead of calling getenv("HOME").

@mfleisz
Copy link
Member Author

mfleisz commented Sep 27, 2011

Thx Marc-Andre, however the fix is not complete - get_local_certloc (called from x509_verify_cert in crypto.c) is still using getenv("HOME") (and later on seg faulting in strlen if HOME is not set) ...

@awakecoding
Copy link
Member

@mfleisz: now it should be fixed as well

@mfleisz
Copy link
Member Author

mfleisz commented Sep 29, 2011

Awesome - thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants