nmh-commits
[Top][All Lists]
Advanced

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

[Nmh-commits] nmh ChangeLog h/prototypes.h sbr/ruserpass.c


From: Peter Maydell
Subject: [Nmh-commits] nmh ChangeLog h/prototypes.h sbr/ruserpass.c
Date: Sun, 04 May 2008 20:58:36 +0000

CVSROOT:        /cvsroot/nmh
Module name:    nmh
Changes by:     Peter Maydell <pm215>   08/05/04 20:58:36

Modified files:
        .              : ChangeLog 
        h              : prototypes.h 
        sbr            : ruserpass.c 

Log message:
        bug #23167: sbr/ruserpass.c (ruserpass): make bad permissions on .netrc 
be
        an instantly fatal error. Previously we returned an error value; 
however, no
        caller was checking it. So now ruserpass() has a void return type.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/ChangeLog?cvsroot=nmh&r1=1.263&r2=1.264
http://cvs.savannah.gnu.org/viewcvs/nmh/h/prototypes.h?cvsroot=nmh&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/nmh/sbr/ruserpass.c?cvsroot=nmh&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/nmh/nmh/ChangeLog,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -b -r1.263 -r1.264
--- ChangeLog   4 May 2008 16:09:08 -0000       1.263
+++ ChangeLog   4 May 2008 20:58:35 -0000       1.264
@@ -1,5 +1,10 @@
 2008-05-04  Peter Maydell  <address@hidden>
 
+       * bug #23167: sbr/ruserpass.c (ruserpass): make bad permissions
+       on .netrc be an instantly fatal error. Previously we returned
+       an error value; however, no caller was checking it. So now
+       ruserpass() has a void return type.
+
        * bug #23163: various minor fixes for the benefit of
        older Unixes (specifically SunOS 4):
        reintroduce strerror() substitute implementation

Index: h/prototypes.h
===================================================================
RCS file: /cvsroot/nmh/nmh/h/prototypes.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- h/prototypes.h      8 Nov 2007 02:28:38 -0000       1.20
+++ h/prototypes.h      4 May 2008 20:58:36 -0000       1.21
@@ -2,7 +2,7 @@
 /*
  * prototypes.h -- various prototypes
  *
- * $Id: prototypes.h,v 1.20 2007/11/08 02:28:38 jjr Exp $
+ * $Id: prototypes.h,v 1.21 2008/05/04 20:58:36 pm215 Exp $
  */
 
 /*
@@ -98,7 +98,7 @@
 char *r1bindex(char *, int);
 void readconfig (struct node **, FILE *, char *, int);
 int refile (char **, char *);
-int ruserpass(char *, char **, char **);
+void ruserpass(char *, char **, char **);
 int remdir (char *);
 int seq_addmsg (struct msgs *, char *, int, int, int);
 int seq_addsel (struct msgs *, char *, int, int);

Index: sbr/ruserpass.c
===================================================================
RCS file: /cvsroot/nmh/nmh/sbr/ruserpass.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- sbr/ruserpass.c     8 Mar 2006 12:14:16 -0000       1.7
+++ sbr/ruserpass.c     4 May 2008 20:58:36 -0000       1.8
@@ -15,7 +15,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Id: ruserpass.c,v 1.7 2006/03/08 12:14:16 bress Exp $
+ * $Id: ruserpass.c,v 1.8 2008/05/04 20:58:36 pm215 Exp $
  */
 
 #include <h/mh.h>
@@ -61,7 +61,7 @@
 static int token(void);
 
 
-int
+void
 ruserpass(char *host, char **aname, char **apass)
 {
     char *hdir, buf[BUFSIZ];
@@ -108,9 +108,9 @@
                case PASSWD:
                    if (fstat(fileno(cfile), &stb) >= 0 &&
                        (stb.st_mode & 077) != 0) {
-                       fprintf(stderr, "Error - .netrc file not correct 
mode.\n");
-                       fprintf(stderr, "Remove password or correct mode.\n");
-                       goto bad;
+                       /* We make this a fatal error to force the user to 
correct it */
+                       advise(NULL, "Error - ~/.netrc file must not be world 
or group readable.");
+                       adios(NULL, "Remove password or correct file 
permissions.");
                    }
                    if (token() && *apass == 0) {
                        *apass = mh_xmalloc((size_t) strlen(tokval) + 1);
@@ -173,10 +173,6 @@
        strcpy (*apass, mypass);
     }
 
-    return(0);
-bad:
-    fclose(cfile);
-    return(-1);
 }
 
 static int




reply via email to

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