pwupd.c (302408) | pwupd.c (308815) |
---|---|
1/*- 2 * Copyright (C) 1996 3 * David L. Nugent. 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 --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = | 1/*- 2 * Copyright (C) 1996 3 * David L. Nugent. 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 --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = |
29 "$FreeBSD: stable/11/usr.sbin/pw/pwupd.c 286201 2015-08-02 13:22:46Z bapt $"; | 29 "$FreeBSD: stable/11/usr.sbin/pw/pwupd.c 308815 2016-11-18 22:28:57Z asomers $"; |
30#endif /* not lint */ 31 32#include <sys/wait.h> 33 34#include <err.h> 35#include <errno.h> 36#include <pwd.h> 37#include <libutil.h> --- 68 unchanged lines hidden (view full) --- 106 err(1, "pw_lock()"); 107 } 108 if ((tfd = pw_tmp(-1)) == -1) { 109 pw_fini(); 110 err(1, "pw_tmp()"); 111 } 112 if (pw_copy(pfd, tfd, pw, old_pw) == -1) { 113 pw_fini(); | 30#endif /* not lint */ 31 32#include <sys/wait.h> 33 34#include <err.h> 35#include <errno.h> 36#include <pwd.h> 37#include <libutil.h> --- 68 unchanged lines hidden (view full) --- 106 err(1, "pw_lock()"); 107 } 108 if ((tfd = pw_tmp(-1)) == -1) { 109 pw_fini(); 110 err(1, "pw_tmp()"); 111 } 112 if (pw_copy(pfd, tfd, pw, old_pw) == -1) { 113 pw_fini(); |
114 close(tfd); |
|
114 err(1, "pw_copy()"); 115 } | 115 err(1, "pw_copy()"); 116 } |
117 close(tfd); |
|
116 /* 117 * in case of deletion of a user, the whole database 118 * needs to be regenerated 119 */ 120 if (pw_mkdb(pw != NULL ? pw->pw_name : NULL) == -1) { 121 pw_fini(); 122 err(1, "pw_mkdb()"); 123 } --- 26 unchanged lines hidden --- | 118 /* 119 * in case of deletion of a user, the whole database 120 * needs to be regenerated 121 */ 122 if (pw_mkdb(pw != NULL ? pw->pw_name : NULL) == -1) { 123 pw_fini(); 124 err(1, "pw_mkdb()"); 125 } --- 26 unchanged lines hidden --- |