| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: passwd.c,v 1.50 2010/08/18 08:32:02 christos Exp $ */ | | 1 | /* $NetBSD: passwd.c,v 1.51 2011/04/24 01:56:44 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1987, 1993, 1994, 1995 | | 4 | * Copyright (c) 1987, 1993, 1994, 1995 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | #if defined(LIBC_SCCS) && !defined(lint) | | 33 | #if defined(LIBC_SCCS) && !defined(lint) |
34 | __RCSID("$NetBSD: passwd.c,v 1.50 2010/08/18 08:32:02 christos Exp $"); | | 34 | __RCSID("$NetBSD: passwd.c,v 1.51 2011/04/24 01:56:44 christos Exp $"); |
35 | #endif /* LIBC_SCCS and not lint */ | | 35 | #endif /* LIBC_SCCS and not lint */ |
36 | | | 36 | |
37 | #include <sys/types.h> | | 37 | #include <sys/types.h> |
38 | #include <sys/param.h> | | 38 | #include <sys/param.h> |
39 | #include <sys/stat.h> | | 39 | #include <sys/stat.h> |
40 | #include <sys/time.h> | | 40 | #include <sys/time.h> |
41 | #include <sys/resource.h> | | 41 | #include <sys/resource.h> |
42 | #include <sys/wait.h> | | 42 | #include <sys/wait.h> |
43 | | | 43 | |
44 | #include <assert.h> | | 44 | #include <assert.h> |
45 | #include <ctype.h> | | 45 | #include <ctype.h> |
46 | #include <err.h> | | 46 | #include <err.h> |
47 | #include <errno.h> | | 47 | #include <errno.h> |
| @@ -162,27 +162,27 @@ pw_mkdb(username, secureonly) | | | @@ -162,27 +162,27 @@ pw_mkdb(username, secureonly) |
162 | | | 162 | |
163 | args[i++] = pw_filename(_PATH_MASTERPASSWD_LOCK); | | 163 | args[i++] = pw_filename(_PATH_MASTERPASSWD_LOCK); |
164 | args[i] = NULL; | | 164 | args[i] = NULL; |
165 | execv(_PATH_PWD_MKDB, (char * const *)__UNCONST(args)); | | 165 | execv(_PATH_PWD_MKDB, (char * const *)__UNCONST(args)); |
166 | _exit(1); | | 166 | _exit(1); |
167 | } | | 167 | } |
168 | pid = waitpid(pid, &pstat, 0); | | 168 | pid = waitpid(pid, &pstat, 0); |
169 | if (pid == -1) { | | 169 | if (pid == -1) { |
170 | warn("error waiting for pid %lu", (unsigned long)pid); | | 170 | warn("error waiting for pid %lu", (unsigned long)pid); |
171 | return -1; | | 171 | return -1; |
172 | } | | 172 | } |
173 | if (WIFEXITED(pstat)) { | | 173 | if (WIFEXITED(pstat)) { |
174 | if (WEXITSTATUS(pstat) != 0) { | | 174 | if (WEXITSTATUS(pstat) != 0) { |
175 | warnx("pwd_mkdb exited with static %d", | | 175 | warnx("pwd_mkdb exited with status %d", |
176 | WEXITSTATUS(pstat)); | | 176 | WEXITSTATUS(pstat)); |
177 | return -1; | | 177 | return -1; |
178 | } | | 178 | } |
179 | } else if (WIFSIGNALED(pstat)) { | | 179 | } else if (WIFSIGNALED(pstat)) { |
180 | warnx("pwd_mkdb exited with signal %d", WTERMSIG(pstat)); | | 180 | warnx("pwd_mkdb exited with signal %d", WTERMSIG(pstat)); |
181 | return -1; | | 181 | return -1; |
182 | } | | 182 | } |
183 | return 0; | | 183 | return 0; |
184 | } | | 184 | } |
185 | | | 185 | |
186 | int | | 186 | int |
187 | pw_abort(void) | | 187 | pw_abort(void) |
188 | { | | 188 | { |