=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/chpass/Attic/pw_yp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/chpass/Attic/pw_yp.c 1996/06/26 05:31:58 1.2 --- src/usr.bin/chpass/Attic/pw_yp.c 1996/08/30 13:09:41 1.3 *************** *** 1,4 **** ! /* $OpenBSD: pw_yp.c,v 1.2 1996/06/26 05:31:58 deraadt Exp $ */ /* $NetBSD: pw_yp.c,v 1.5 1995/03/26 04:55:33 glass Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: pw_yp.c,v 1.3 1996/08/30 13:09:41 deraadt Exp $ */ /* $NetBSD: pw_yp.c,v 1.5 1995/03/26 04:55:33 glass Exp $ */ /* *************** *** 37,43 **** #if 0 static char sccsid[] = "@(#)pw_yp.c 1.0 2/2/93"; #else ! static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.2 1996/06/26 05:31:58 deraadt Exp $"; #endif #endif /* not lint */ --- 37,43 ---- #if 0 static char sccsid[] = "@(#)pw_yp.c 1.0 2/2/93"; #else ! static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.3 1996/08/30 13:09:41 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 207,218 **** return (pwent); } struct passwd * ypgetpwnam(nam) char *nam; { static struct passwd pwent; - static char line[1024]; char *val; int reason, vallen; --- 207,219 ---- return (pwent); } + static char *__yplin; + struct passwd * ypgetpwnam(nam) char *nam; { static struct passwd pwent; char *val; int reason, vallen; *************** *** 235,244 **** break; } val[vallen] = '\0'; ! strcpy(line, val); free(val); ! return(interpret(&pwent, line)); } struct passwd * --- 236,248 ---- break; } val[vallen] = '\0'; ! if (__yplin) ! free(__yplin); ! __yplin = (char *)malloc(vallen + 1); ! strcpy(__yplin, val); free(val); ! return(interpret(&pwent, __yplin)); } struct passwd * *************** *** 246,252 **** uid_t uid; { static struct passwd pwent; - static char line[1024]; char *val; int reason, vallen; char namebuf[16]; --- 250,255 ---- *************** *** 268,277 **** break; } val[vallen] = '\0'; ! strcpy(line, val); free(val); ! return(interpret(&pwent, line)); } #endif /* YP */ --- 271,283 ---- break; } val[vallen] = '\0'; ! if (__yplin) ! free(__yplin); ! __yplin = (char *)malloc(vallen + 1); ! strcpy(__yplin, val); free(val); ! return(interpret(&pwent, __yplin)); } #endif /* YP */