From: Joel Reicher Date: Fri, 14 Apr 2006 08:21:35 +0000 (+0000) Subject: Sanitised some dodgy homedir finding code, but it still might not make X-Git-Tag: nmh-1_3_RC1~37 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=9792341d7318d2e9f52557cad5f0b8a9c5c252ad;p=mmh Sanitised some dodgy homedir finding code, but it still might not make sense. --- diff --git a/uip/msgchk.c b/uip/msgchk.c index 69999f6..872dc2e 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -307,13 +307,12 @@ main (int argc, char **argv) if (vecp == 0) { char *home; - home = (uid = geteuid()) ? home = getenv ("HOME") : NULL; - if (home == NULL) { + /* Not sure this check makes sense... */ + if (!geteuid() || NULL == (home = getenv("HOME"))) { pw = getpwnam (user); if (pw == NULL) adios (NULL, "unable to get information about user"); - if (home == NULL) - home = pw->pw_dir; + home = pw->pw_dir; } status = checkmail (user, home, datesw, notifysw, 1); } else {