Deleted Added
full compact
pw.c (285996) pw.c (286152)
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: head/usr.sbin/pw/pw.c 285996 2015-07-29 06:22:41Z bapt $";
29 "$FreeBSD: head/usr.sbin/pw/pw.c 286152 2015-08-01 10:25:55Z bapt $";
30#endif /* not lint */
31
32#include <err.h>
33#include <fcntl.h>
34#include <locale.h>
35#include <paths.h>
36#include <stdbool.h>
37#include <sys/wait.h>

--- 219 unchanged lines hidden (view full) ---

257 nis = true;
258 break;
259 case 'a':
260 conf.all = true;
261 break;
262 case 'c':
263 conf.gecos = pw_checkname(optarg, 1);
264 break;
30#endif /* not lint */
31
32#include <err.h>
33#include <fcntl.h>
34#include <locale.h>
35#include <paths.h>
36#include <stdbool.h>
37#include <sys/wait.h>

--- 219 unchanged lines hidden (view full) ---

257 nis = true;
258 break;
259 case 'a':
260 conf.all = true;
261 break;
262 case 'c':
263 conf.gecos = pw_checkname(optarg, 1);
264 break;
265 case 'e':
266 conf.expire_days = strtonum(optarg, 0, INT_MAX, &errstr);
267 if (errstr)
268 errx(EX_USAGE, "Invalid expired days: %s", optarg);
269 break;
265 case 'g':
266 if (which == 0) { /* for user* */
267 addarg(&arglist, 'g', optarg);
268 break;
269 }
270 if (strspn(optarg, "0123456789") != strlen(optarg))
271 errx(EX_USAGE, "-g expects a number");
272 id = strtounum(optarg, 0, GID_MAX, &errstr);

--- 43 unchanged lines hidden (view full) ---

316 "file descriptor or '-'");
317 } else
318 errx(EX_USAGE, "'-h' expects a file "
319 "descriptor or '-'");
320 break;
321 case 'o':
322 conf.checkduplicate = false;
323 break;
270 case 'g':
271 if (which == 0) { /* for user* */
272 addarg(&arglist, 'g', optarg);
273 break;
274 }
275 if (strspn(optarg, "0123456789") != strlen(optarg))
276 errx(EX_USAGE, "-g expects a number");
277 id = strtounum(optarg, 0, GID_MAX, &errstr);

--- 43 unchanged lines hidden (view full) ---

321 "file descriptor or '-'");
322 } else
323 errx(EX_USAGE, "'-h' expects a file "
324 "descriptor or '-'");
325 break;
326 case 'o':
327 conf.checkduplicate = false;
328 break;
329 case 'p':
330 conf.password_days = strtonum(optarg, 0, INT_MAX, &errstr);
331 if (errstr)
332 errx(EX_USAGE, "Invalid password days: %s", optarg);
333 break;
324 case 'q':
325 conf.quiet = true;
326 break;
327 case 'r':
328 conf.deletehome = true;
329 break;
330 default:
331 addarg(&arglist, ch, optarg);

--- 275 unchanged lines hidden ---
334 case 'q':
335 conf.quiet = true;
336 break;
337 case 'r':
338 conf.deletehome = true;
339 break;
340 default:
341 addarg(&arglist, ch, optarg);

--- 275 unchanged lines hidden ---