yppasswdd_server.c (188766) | yppasswdd_server.c (231994) |
---|---|
1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c 188766 2009-02-18 22:27:46Z imp $"); | 34__FBSDID("$FreeBSD: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c 231994 2012-02-22 06:27:20Z kevlo $"); |
35 36#include <sys/param.h> 37#include <sys/fcntl.h> 38#include <sys/socket.h> 39#include <sys/stat.h> 40#include <sys/wait.h> 41 42#include <arpa/inet.h> --- 412 unchanged lines hidden (view full) --- 455 struct sockaddr_in *rqhost; 456 DBT key, data; 457 int rval = 0; 458 int pfd, tfd; 459 int pid; 460 int passwd_changed = 0; 461 int shell_changed = 0; 462 int gecos_changed = 0; | 35 36#include <sys/param.h> 37#include <sys/fcntl.h> 38#include <sys/socket.h> 39#include <sys/stat.h> 40#include <sys/wait.h> 41 42#include <arpa/inet.h> --- 412 unchanged lines hidden (view full) --- 455 struct sockaddr_in *rqhost; 456 DBT key, data; 457 int rval = 0; 458 int pfd, tfd; 459 int pid; 460 int passwd_changed = 0; 461 int shell_changed = 0; 462 int gecos_changed = 0; |
463 char *cryptpw; |
|
463 char *oldshell = NULL; 464 char *oldgecos = NULL; 465 char *passfile_hold; 466 char passfile_buf[MAXPATHLEN + 2]; 467 char passfile_hold_buf[MAXPATHLEN + 2]; 468 char *domain = yppasswd_domain; 469 static struct sockaddr_in clntaddr; 470 static struct timeval t_saved, t_test; --- 61 unchanged lines hidden (view full) --- 532 533 /* Nul terminate, please. */ 534 *((char *)data.data + data.size) = '\0'; 535 536 copy_yp_pass(data.data, 1, data.size); 537 538 /* Step 2: check that the supplied oldpass is valid. */ 539 | 464 char *oldshell = NULL; 465 char *oldgecos = NULL; 466 char *passfile_hold; 467 char passfile_buf[MAXPATHLEN + 2]; 468 char passfile_hold_buf[MAXPATHLEN + 2]; 469 char *domain = yppasswd_domain; 470 static struct sockaddr_in clntaddr; 471 static struct timeval t_saved, t_test; --- 61 unchanged lines hidden (view full) --- 533 534 /* Nul terminate, please. */ 535 *((char *)data.data + data.size) = '\0'; 536 537 copy_yp_pass(data.data, 1, data.size); 538 539 /* Step 2: check that the supplied oldpass is valid. */ 540 |
540 if (strcmp(crypt(argp->oldpass, yp_password.pw_passwd), 541 yp_password.pw_passwd)) { | 541 cryptpw = crypt(argp->oldpass, yp_password.pw_passwd); 542 if (cryptpw == NULL || strcmp(cryptpw, yp_password.pw_passwd)) { |
542 yp_error("rejected change attempt -- bad password"); 543 yp_error("client address: %s username: %s", 544 inet_ntoa(rqhost->sin_addr), 545 argp->newpw.pw_name); 546 return(&result); 547 } 548 549 /* Step 3: validate the arguments passed to us by the client. */ --- 369 unchanged lines hidden --- | 543 yp_error("rejected change attempt -- bad password"); 544 yp_error("client address: %s username: %s", 545 inet_ntoa(rqhost->sin_addr), 546 argp->newpw.pw_name); 547 return(&result); 548 } 549 550 /* Step 3: validate the arguments passed to us by the client. */ --- 369 unchanged lines hidden --- |