nmh-workers
[Top] [All Lists]

A minor bug with RPOP/POP

1994-08-16 12:01:24
I'm experimenting with various compile options and found in the inc and
msgchk commands that rpop=1 is hardcoded.  This means RPOP is the default
option even if I don't compile with the RPOP option.  Consequently, when
inc and msgchk should call ruserpass to get the password, they don't and
worse, they send "RPOP userid" instead of "PASS password".

I also found that msgchk.c didn't initialize the variable pass (char *pass)
so after fixing the first problem, I ran into the problem of specifying
"-nonotify all" caused the password to be blank.

The enclosed patch file (RPOP.patch) fixes both problems above in the inc.c
and msgchk.c files in the uip directory.

===================================================================
RCS file: RCS/inc.c,v
retrieving revision 1.22
diff -c -r1.22 inc.c
*** 1.22        1993/09/01 21:41:48
--- inc.c       1994/08/16 00:19:18
***************
*** 184,190 ****
--- 184,198 ----
            nbytes,
            p = 0,
  #endif        /* POP */
+ #if !defined(RPOP) && !defined(APOP)
+           rpop = 0,
+ #else /* RPOP || APOP */
+ #if defined(APOP)
+           rpop = -1,
+ #else /* RPOP */
            rpop = 1,
+ #endif /* APOP */
+ #endif /* !RPOP && !APOP */
              i,
            hghnum,
              msgnum;
===================================================================
RCS file: RCS/msgchk.c,v
retrieving revision 1.13
diff -c -r1.13 msgchk.c
*** 1.13        1993/09/01 21:44:19
--- msgchk.c    1994/08/16 17:11:02
***************
*** 103,109 ****
--- 103,117 ----
  {
      int     datesw = 1,
            notifysw = NT_ALL,
+ #if !defined(RPOP) && !defined(APOP)
+           rpop = 0,
+ #else /* RPOP || APOP */
+ #if defined(APOP)
+           rpop = -1,
+ #else /* RPOP */
            rpop = 1,
+ #endif /* APOP */
+ #endif /* !RPOP && !APOP */
            status = 0,
            snoop = 0,
            vecp = 0;
***************
*** 389,401 ****
      int     nmsgs,
              nbytes,
              status;
!     char   *pass;

!     if (user == NULL)
        user = getusr ();
!     if (rpop > 0)
        pass = getusr ();
!     else
        ruserpass (host, &user, &pass);

      if (pop_init (host, user, pass, snoop, rpop) == NOTOK
--- 397,409 ----
      int     nmsgs,
              nbytes,
              status;
!     char   *pass = NULL;

!     if (user == NULL)
        user = getusr ();
!     if (rpop > 0)
        pass = getusr ();
!     else
        ruserpass (host, &user, &pass);

      if (pop_init (host, user, pass, snoop, rpop) == NOTOK
I also found a statement in h/mh.h which I disagree with.  That is that
vfork must be fork of _AIX is defined.  That is true, unless the person
doing the compile has taken the time to set up the "bsdcc" command as
described in the AIX document /usr/lpp/bos/bsdport.tr.  So, I changed it
to say if _AIX but not _BSD were defined, then vfork must be fork.

===================================================================
RCS file: RCS/mh.h,v
retrieving revision 2.19
diff -c -r2.19 mh.h
*** 2.19        1993/02/26 21:53:29
--- mh.h        1994/08/15 20:23:41
***************
*** 23,29 ****
  #endif
  #define DMAXFOLDER       4    /* typical number of digits */

! #if (!defined(BSD42) && !defined(BSD41A) && !defined(VMUNIX) && 
!defined(hpux)) || defined(_AIX)
  #define       vfork           fork
  #endif        /* not BSD */           /* how sad... */

--- 23,29 ----
  #endif
  #define DMAXFOLDER       4    /* typical number of digits */

! #if (!defined(BSD42) && !defined(BSD41A) && !defined(VMUNIX) && 
!defined(hpux)) || (defined(_AIX) && !defined(_BSD))
  #define       vfork           fork
  #endif        /* not BSD */           /* how sad... */

--
Frank Swasey, IBM Microelectronics, Distributed Computing Services
e-mail: Frank_Swasey(_at_)vnet(_dot_)ibm(_dot_)com, 
fswasey(_at_)btv(_dot_)ibm(_dot_)com         ,,,
Tel: 802-769-4011 (tie: 446), Fax: 802-769-4253 (tie: 446)    (o o)
     "Smile, it makes people wonder what you're up to."  -oOO--(_)--OOo-
<Prev in Thread] Current Thread [Next in Thread>
  • A minor bug with RPOP/POP, Frank Swasey <=