Fixed crash on startup when running in an environment that doesn't have /home/heinzi set (e.g. an empty env), https://github.com/cryfs/cryfs/issues/374
This commit is contained in:
parent
41ab58faf3
commit
c6a69ae36b
@ -5,6 +5,7 @@ Fixed bugs:
|
||||
* Fixed determining the user's homedir: If $HOME and the /etc/passwd entry for the current user contradict each other, now $HOME takes preference over /etc/passwd.
|
||||
* Fix Android compilation, https://github.com/cryfs/cryfs/issues/345
|
||||
* Remove cryfs-stats tool which isn't ready yet and could destroy the file system
|
||||
* Fixed crash on startup when running in an environment that doesn't have $HOME set (e.g. an empty env), https://github.com/cryfs/cryfs/issues/374
|
||||
|
||||
|
||||
Version 0.10.2
|
||||
|
@ -9,7 +9,8 @@ using std::string;
|
||||
#include <pwd.h>
|
||||
namespace {
|
||||
bf::path _get_home_directory() {
|
||||
string homedir = getenv("HOME");
|
||||
const char* homedir_ = getenv("HOME");
|
||||
string homedir = (homedir_ == nullptr) ? "" : homedir_;
|
||||
if (homedir == "") {
|
||||
// try the /etc/passwd entry
|
||||
struct passwd* pwd = getpwuid(getuid());
|
||||
|
Loading…
Reference in New Issue
Block a user