pwcntl fix on 3.0 systems

Craig Johnson vince at tc.fluke.COM
Thu Dec 22 06:53:22 AEST 1988


First, thanks Dave for a neat program!  I too found my password lurking in
/etc/pwcntl as a failed login entry and I was anxious to clean it up.

I've just finished installing pwcntl on my 3.0 system, which went pretty
well until I encountered an apparent printf bug which caused some grief.
I don't know if you'll see this on newer systems or not.  The symptom I
saw was the last login time field was being written with the same value
as the login creation time field in "dump" output.  I was finally able
to correct the problem simply  by breaking the printf statement into two
pieces.

Other than that, I found it necessary to change a couple of long symbol
names, remove setvbuf.o from the makefile (can anybody explain why this
was here?  It wasn't referenced anywhere), and delete several lines from
Ifile.sh to reinstate some termcap symbols.

Here is a summary of my changes (sorry, I'm not a "patch" expert):

*** pwcntl.c    Wed Dec 21 12:22:49 1988
--- pwcntl.c-   Wed Dec 21 00:08:59 1988
***************
*** 132,139
  #define STATUS_Y      21
  #define STATUS_X      8
  
! #define       RECSTATY        3
! #define       RECSTATX        0
  
  #define CURREC_Y      1
  #define CURREC_X      16
 
--- 132,139 -----
  #define STATUS_Y      21
  #define STATUS_X      8
  
! #define       RECSTAT_Y       3
! #define       RECSTAT_X       0
  
  #define CURREC_Y      1
  #define CURREC_X      16
***************
*** 442,451
                if(rec_sts == ' ' && invflag)
                        continue;
  
!               (void) printf("%-8.8s %4.4d %c   %24.24s  ",
                        pw->logon,pw->uid,pw->expert,
!                       ctime(&pw->timecr));
!               (void) printf("%24.24s  %5.5ld %c\n",
                        ((pw->timecr!=pw->timeon)?ctime(&pw->timeon):"** NEVER LOGGED ON **"),
                        pw->space,rec_sts);

--- 442,450 -----
                if(rec_sts == ' ' && invflag)
                        continue;
  
!               (void)printf("%-8.8s %4.4d %c   %24.24s  %24.24s  %5.5ld %c\n",                         pw->logon,pw->uid,pw->expert,
!                       ctime(&pw->timecr),
                        ((pw->timecr!=pw->timeon)?ctime(&pw->timeon):"** NEVER LOGGED ON **"),
                        pw->space,rec_sts);
***************
*** 698,704
        standout(); 
  
        /* Always clear out the error status line. */
!       move(RECSTATY,RECSTATX);
        clrtoeol();
        
        /* Load the current record number (one-based) */
 
--- 697,703 -----
        standout();
  
        /* Always clear out the error status line. */
!       move(RECSTAT_Y,RECSTAT_X);
        clrtoeol();
        
        /* Load the current record number (one-based) */

*** Makefile    Wed Dec 21 00:28:09 1988
--- Makefile-   Wed Dec 21 00:08:48 1988
***************
*** 13,18
  #LIBC= /lib/libc.a
  
  OBJECTS =     pwcntl.o \
                doprnt.o
  
  pwcntl:       $(OBJECTS) shlib_c.ifile
 
--- 13,19 -----
  #LIBC= /lib/libc.a
  
  OBJECTS =     pwcntl.o \
+               setvbuf.o \
                doprnt.o
  
  pwcntl:       $(OBJECTS) shlib_c.ifile

*** Ifile.sh    Wed Dec 21 00:28:09 1988
--- Ifile.sh-   Wed Dec 21 00:08:46 1988
***************
*** 5,10
  1,\$s/^ospeed/xospeed/
  1,\$s/^LINES/xLINES/
  1,\$s/^COLS/xCOLS/
  1,\$s/^wrefresh/xwrefresh/
  1,\$s/^initscr/xinitscr/
  1,\$s/^cbreak/xcbreak/
 
--- 5,16 -----
  1,\$s/^ospeed/xospeed/
  1,\$s/^LINES/xLINES/
  1,\$s/^COLS/xCOLS/
+ 1,\$s/^tgetflag/xtgetflag/
+ 1,\$s/^tgetent/xtgetent/
+ 1,\$s/^tgetstr/xtgetstr/
+ 1,\$s/^tgetnum/xtgetnum/
+ 1,\$s/^tgoto/xtgoto/
+ 1,\$s/^tputs/xtputs/
  1,\$s/^wrefresh/xwrefresh/
  1,\$s/^initscr/xinitscr/
  1,\$s/^cbreak/xcbreak/

------------------------------------------------------------------------
	Craig V. Johnson		...!fluke!vince
	John Fluke Mfg. Co.
	Everett, WA
------------------------------------------------------------------------



More information about the Unix-pc.general mailing list