spec.c (50479) | spec.c (54375) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/usr.sbin/mtree/spec.c 50479 1999-08-28 01:35:59Z peter $"; | 39 "$FreeBSD: head/usr.sbin/mtree/spec.c 54375 1999-12-09 20:38:36Z joe $"; |
40#endif /* not lint */ 41 42#include <sys/types.h> 43#include <sys/stat.h> 44#include <ctype.h> 45#include <err.h> 46#include <errno.h> 47#include <fts.h> --- 119 unchanged lines hidden (view full) --- 167 } 168 } 169 return (root); 170} 171 172static void 173set(t, ip) 174 char *t; | 40#endif /* not lint */ 41 42#include <sys/types.h> 43#include <sys/stat.h> 44#include <ctype.h> 45#include <err.h> 46#include <errno.h> 47#include <fts.h> --- 119 unchanged lines hidden (view full) --- 167 } 168 } 169 return (root); 170} 171 172static void 173set(t, ip) 174 char *t; |
175 register NODE *ip; | 175 NODE *ip; |
176{ 177 register int type; | 176{ 177 register int type; |
178 register char *kw, *val = NULL; | 178 char *kw, *val = NULL; |
179 struct group *gr; 180 struct passwd *pw; 181 mode_t *m; 182 int value; 183 char *ep; 184 185 for (; (kw = strtok(t, "= \t\n")); t = NULL) { 186 ip->flags |= type = parsekey(kw, &value); --- 19 unchanged lines hidden (view full) --- 206 } 207 break; 208 case F_RMD160: 209 ip->rmd160digest = strdup(val); 210 if(!ip->rmd160digest) { 211 errx(1, "strdup"); 212 } 213 break; | 179 struct group *gr; 180 struct passwd *pw; 181 mode_t *m; 182 int value; 183 char *ep; 184 185 for (; (kw = strtok(t, "= \t\n")); t = NULL) { 186 ip->flags |= type = parsekey(kw, &value); --- 19 unchanged lines hidden (view full) --- 206 } 207 break; 208 case F_RMD160: 209 ip->rmd160digest = strdup(val); 210 if(!ip->rmd160digest) { 211 errx(1, "strdup"); 212 } 213 break; |
214 case F_FLAGS: 215 if (strcmp("none", val) == 0) 216 ip->st_flags = 0; 217 else if (string_to_flags(&val, &ip->st_flags,NULL) != 0) 218 errx(1, "line %d: invalid flag %s",lineno, val); 219 break; |
|
214 case F_GID: 215 ip->st_gid = strtoul(val, &ep, 10); 216 if (*ep) 217 errx(1, "line %d: invalid gid %s", lineno, val); 218 break; 219 case F_GNAME: 220 if ((gr = getgrnam(val)) == NULL) 221 errx(1, "line %d: unknown group %s", lineno, val); --- 96 unchanged lines hidden --- | 220 case F_GID: 221 ip->st_gid = strtoul(val, &ep, 10); 222 if (*ep) 223 errx(1, "line %d: invalid gid %s", lineno, val); 224 break; 225 case F_GNAME: 226 if ((gr = getgrnam(val)) == NULL) 227 errx(1, "line %d: unknown group %s", lineno, val); --- 96 unchanged lines hidden --- |