pw_user.c (24214) | pw_user.c (26088) |
---|---|
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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * | 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * $Id: pw_user.c,v 1.18 1997/03/11 14:11:43 ache Exp $ | 26 * $Id: pw_user.c,v 1.19 1997/03/24 15:09:41 ache Exp $ |
27 */ 28 29#include <unistd.h> 30#include <fcntl.h> 31#include <ctype.h> 32#include <paths.h> 33#include <sys/param.h> 34#include <dirent.h> --- 195 unchanged lines hidden (view full) --- 230 } 231 if (extendarray(&cnf->groups, &cnf->numgroups, i + 2) != -1) 232 cnf->groups[i++] = newstr(grp->gr_name); 233 } 234 while (i < cnf->numgroups) 235 cnf->groups[i++] = NULL; 236 } 237 if ((arg = getarg(args, 'k')) != NULL) { | 27 */ 28 29#include <unistd.h> 30#include <fcntl.h> 31#include <ctype.h> 32#include <paths.h> 33#include <sys/param.h> 34#include <dirent.h> --- 195 unchanged lines hidden (view full) --- 230 } 231 if (extendarray(&cnf->groups, &cnf->numgroups, i + 2) != -1) 232 cnf->groups[i++] = newstr(grp->gr_name); 233 } 234 while (i < cnf->numgroups) 235 cnf->groups[i++] = NULL; 236 } 237 if ((arg = getarg(args, 'k')) != NULL) { |
238 if (stat(cnf->dotdir = arg->val, &st) == -1 || S_ISDIR(st.st_mode)) | 238 if (stat(cnf->dotdir = arg->val, &st) == -1 || !S_ISDIR(st.st_mode)) |
239 cmderr(EX_OSFILE, "skeleton `%s' is not a directory or does not exist\n", cnf->dotdir); 240 } 241 if ((arg = getarg(args, 's')) != NULL) 242 cnf->shell_default = arg->val; 243 244 if (mode == M_ADD && getarg(args, 'D')) { 245 if (getarg(args, 'n') != NULL) 246 cmderr(EX_DATAERR, "can't combine `-D' with `-n name'\n"); --- 859 unchanged lines hidden --- | 239 cmderr(EX_OSFILE, "skeleton `%s' is not a directory or does not exist\n", cnf->dotdir); 240 } 241 if ((arg = getarg(args, 's')) != NULL) 242 cnf->shell_default = arg->val; 243 244 if (mode == M_ADD && getarg(args, 'D')) { 245 if (getarg(args, 'n') != NULL) 246 cmderr(EX_DATAERR, "can't combine `-D' with `-n name'\n"); --- 859 unchanged lines hidden --- |