pw_group.c (286196) | pw_group.c (286199) |
---|---|
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_group.c 286196 2015-08-02 12:47:50Z bapt $"; | 29 "$FreeBSD: head/usr.sbin/pw/pw_group.c 286199 2015-08-02 12:56:25Z bapt $"; |
30#endif /* not lint */ 31 32#include <ctype.h> 33#include <err.h> 34#include <grp.h> 35#include <inttypes.h> 36#include <libutil.h> 37#include <paths.h> --- 503 unchanged lines hidden (view full) --- 541 break; 542 } 543 } 544 545 if (quiet) 546 freopen(_PATH_DEVNULL, "w", stderr); 547 if (name == NULL) 548 errx(EX_DATAERR, "group name required"); | 30#endif /* not lint */ 31 32#include <ctype.h> 33#include <err.h> 34#include <grp.h> 35#include <inttypes.h> 36#include <libutil.h> 37#include <paths.h> --- 503 unchanged lines hidden (view full) --- 541 break; 542 } 543 } 544 545 if (quiet) 546 freopen(_PATH_DEVNULL, "w", stderr); 547 if (name == NULL) 548 errx(EX_DATAERR, "group name required"); |
549 if (GETGRNAM(name) != NULL) 550 errx(EX_DATAERR, "group name `%s' already exists", name); |
|
549 cnf = get_userconfig(cfg); 550 rc = groupadd(cnf, name, gr_gidpolicy(cnf, id), members, fd, dryrun, 551 pretty, precrypted); 552 if (nis && rc == EXIT_SUCCESS && nis_update() == 0) 553 pw_log(cnf, M_ADD, W_GROUP, "NIS maps updated"); 554 555 return (rc); 556} --- 129 unchanged lines hidden --- | 551 cnf = get_userconfig(cfg); 552 rc = groupadd(cnf, name, gr_gidpolicy(cnf, id), members, fd, dryrun, 553 pretty, precrypted); 554 if (nis && rc == EXIT_SUCCESS && nis_update() == 0) 555 pw_log(cnf, M_ADD, W_GROUP, "NIS maps updated"); 556 557 return (rc); 558} --- 129 unchanged lines hidden --- |