diff options
Diffstat (limited to 'inet/ruserpass.c')
-rw-r--r-- | inet/ruserpass.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/inet/ruserpass.c b/inet/ruserpass.c index cff9493..a0a4b97 100644 --- a/inet/ruserpass.c +++ b/inet/ruserpass.c @@ -87,9 +87,14 @@ ruserpass(host, aname, apass) int t, i, c, usedefault = 0; struct stat stb; - hdir = getenv("HOME"); - if (hdir == NULL) - hdir = "."; + hdir = __secure_getenv("HOME"); + if (hdir == NULL) { + /* If we can't get HOME, fail instead of trying ".", + which is no improvement. This really should call + getpwuid(getuid()). */ + /*hdir = ".";*/ + return -1; + } buf = alloca (strlen (hdir) + 8); |