Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Sep 1995 12:48:41 -0400 (EDT)
From:      Mark Hittinger <bugs@ns1.win.net>
To:        bugs@freebsd.org
Subject:   chpass -p broken
Message-ID:  <199509211648.MAA07319@ns1.win.net>

next in thread | raw e-mail | index | archive | help

While experimenting with Guido's pwd_mkdb improvements I noticed that
the chpass "-p" option appears to be broken by some of the YP changes
around August...  

The call to use_yp resets the value of pw_pw_passwd to the original
value.  Below is a patch:

*** /usr/src/usr.bin/chpass/chpass.c	Sat Aug 26 05:03:10 1995
--- ./chpass.c	Thu Sep 21 12:29:45 1995
***************
*** 87,88 ****
--- 87,89 ----
  	char *arg;
+ 	char *new_password ;
  
***************
*** 101,103 ****
  			op = NEWPW;
! 			arg = optarg;
  			break;
--- 102,104 ----
  			op = NEWPW;
! 			new_password = optarg;
  			break;
***************
*** 150,152 ****
  		}
! 		pw->pw_passwd = arg;
  	}
--- 151,153 ----
  		}
! 		pw->pw_passwd = new_password ;
  	}
***************
*** 168,169 ****
--- 169,171 ----
  	_use_yp = use_yp(pw->pw_name);
+ 	if (op == NEWPW) pw->pw_passwd = new_password ;
  #endif /* YP */
***************

Regards,

Mark Hittinger
Internet Manager
WinNET Communications, Inc.
bugs@win.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509211648.MAA07319>