nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] nmh/uip msgchk.c


From: Joel Reicher
Subject: [Nmh-commits] nmh/uip msgchk.c
Date: Fri, 14 Apr 2006 08:21:35 +0000

CVSROOT:        /sources/nmh
Module name:    nmh
Branch:         
Changes by:     Joel Reicher <address@hidden>   06/04/14 08:21:35

Modified files:
        uip            : msgchk.c 

Log message:
        Sanitised some dodgy homedir finding code, but it still might not make
        sense.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/uip/msgchk.c.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: nmh/uip/msgchk.c
diff -u nmh/uip/msgchk.c:1.11 nmh/uip/msgchk.c:1.12
--- nmh/uip/msgchk.c:1.11       Thu Jan 27 16:34:21 2005
+++ nmh/uip/msgchk.c    Fri Apr 14 08:21:35 2006
@@ -2,7 +2,7 @@
 /*
  * msgchk.c -- check for mail
  *
- * $Id: msgchk.c,v 1.11 2005/01/27 16:34:21 opk Exp $
+ * $Id: msgchk.c,v 1.12 2006/04/14 08:21:35 jjr Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -307,13 +307,12 @@
     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 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]