Index: yppasswdd_server.c =================================================================== --- yppasswdd_server.c (revision 343372) +++ yppasswdd_server.c (working copy) @@ -471,6 +471,8 @@ char *passfile_hold; char passfile_buf[MAXPATHLEN + 2]; char passfile_hold_buf[MAXPATHLEN + 2]; + char *passdir; + char passdir_buf[MAXPATHLEN + 2]; char *domain = yppasswd_domain; static struct sockaddr_in clntaddr; static struct timeval t_saved, t_test; @@ -603,10 +605,13 @@ "%s.hold", passfile); passfile_hold = (char *)&passfile_hold_buf; + /* Hold a copy of the passfile in passdir */ + snprintf(passdir_buf, sizeof(passdir_buf), "%s", passfile); + passdir = (char *)&passdir_buf; /* Step 5: make a new password file with the updated info. */ - if (pw_init(dirname(passfile), passfile)) { + if (pw_init(dirname(passdir), passfile)) { yp_error("pw_init() failed"); return &result; } @@ -729,6 +734,8 @@ char *passfile_hold; char passfile_buf[MAXPATHLEN + 2]; char passfile_hold_buf[MAXPATHLEN + 2]; + char *passdir; + char passdir_buf[MAXPATHLEN + 2]; struct sockaddr_in *rqhost; SVCXPRT *transp; struct passwd newpasswd; @@ -829,7 +836,11 @@ "%s.hold", passfile); passfile_hold = (char *)&passfile_hold_buf; - if (pw_init(dirname(passfile), passfile)) { + /* Hold a copy of the passfile in passdir */ + snprintf(passdir_buf, sizeof(passdir_buf), "%s", passfile); + passdir = (char *)&passdir_buf; + + if (pw_init(dirname(passdir), passfile)) { yp_error("pw_init() failed"); return &result; }