diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-12-20 18:13:45 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-12-20 18:13:45 +0000 |
commit | b1592778d33c2728daae2b3de3c30c86cd24412f (patch) | |
tree | e87e794347946fd1513ac68d63756b8d3b9c8bce | |
parent | 276a39682e7b08b533a35d39633f2fa36c3cca6f (diff) |
Add back "optional" keyword that got nuked in merge of FreeBSD mods.
-rw-r--r-- | usr.sbin/mtree/misc.c | 3 | ||||
-rw-r--r-- | usr.sbin/mtree/mtree.8 | 5 | ||||
-rw-r--r-- | usr.sbin/mtree/mtree.h | 37 | ||||
-rw-r--r-- | usr.sbin/mtree/spec.c | 4 | ||||
-rw-r--r-- | usr.sbin/mtree/verify.c | 6 |
5 files changed, 31 insertions, 24 deletions
diff --git a/usr.sbin/mtree/misc.c b/usr.sbin/mtree/misc.c index 24712c2b328..3ac2095dd24 100644 --- a/usr.sbin/mtree/misc.c +++ b/usr.sbin/mtree/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.3 1996/12/10 08:26:08 deraadt Exp $ */ +/* $OpenBSD: misc.c,v 1.4 1996/12/20 18:13:42 millert Exp $ */ /* $NetBSD: misc.c,v 1.4 1995/03/07 21:26:23 cgd Exp $ */ /*- @@ -63,6 +63,7 @@ static KEY keylist[] = { {"md5digest", F_MD5, NEEDVALUE}, {"mode", F_MODE, NEEDVALUE}, {"nlink", F_NLINK, NEEDVALUE}, + {"optional", F_OPT, 0}, {"size", F_SIZE, NEEDVALUE}, {"time", F_TIME, NEEDVALUE}, {"type", F_TYPE, NEEDVALUE}, diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8 index cb54d93cba0..a2ca1149698 100644 --- a/usr.sbin/mtree/mtree.8 +++ b/usr.sbin/mtree/mtree.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mtree.8,v 1.3 1996/12/10 08:26:08 deraadt Exp $ +.\" $OpenBSD: mtree.8,v 1.4 1996/12/20 18:13:42 millert Exp $ .\" $NetBSD: mtree.8,v 1.4 1995/03/07 21:26:25 cgd Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 @@ -144,6 +144,9 @@ The current file's permissions as a numeric (octal) or symbolic value. .It Cm nlink The number of hard links the file is expected to have. +.It Cm optional +The file is optional; don't complain about the file if it's +not in the file hierarchy. .It Cm uid The file owner as a numeric value. .It Cm uname diff --git a/usr.sbin/mtree/mtree.h b/usr.sbin/mtree/mtree.h index 60e8108195b..4c495ab17dc 100644 --- a/usr.sbin/mtree/mtree.h +++ b/usr.sbin/mtree/mtree.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mtree.h,v 1.3 1996/12/10 08:26:09 deraadt Exp $ */ +/* $OpenBSD: mtree.h,v 1.4 1996/12/20 18:13:43 millert Exp $ */ /* $NetBSD: mtree.h,v 1.7 1995/03/07 21:26:27 cgd Exp $ */ /*- @@ -58,23 +58,24 @@ typedef struct _node { mode_t st_mode; /* mode */ nlink_t st_nlink; /* link count */ -#define F_CKSUM 0x0001 /* check sum */ -#define F_DONE 0x0002 /* directory done */ -#define F_GID 0x0004 /* gid */ -#define F_GNAME 0x0008 /* group name */ -#define F_IGN 0x0010 /* ignore */ -#define F_MAGIC 0x0020 /* name has magic chars */ -#define F_MODE 0x0040 /* mode */ -#define F_NLINK 0x0080 /* number of links */ -#define F_SIZE 0x0100 /* size */ -#define F_SLINK 0x0200 /* link count */ -#define F_TIME 0x0400 /* modification time */ -#define F_TYPE 0x0800 /* file type */ -#define F_UID 0x1000 /* uid */ -#define F_UNAME 0x2000 /* user name */ -#define F_VISIT 0x4000 /* file visited */ -#define F_MD5 0x8000 /* MD5 digest */ - u_short flags; /* items set */ +#define F_CKSUM 0x00001 /* check sum */ +#define F_DONE 0x00002 /* directory done */ +#define F_GID 0x00004 /* gid */ +#define F_GNAME 0x00008 /* group name */ +#define F_IGN 0x00010 /* ignore */ +#define F_MAGIC 0x00020 /* name has magic chars */ +#define F_MD5 0x00040 /* MD5 digest */ +#define F_MODE 0x00080 /* mode */ +#define F_NLINK 0x00100 /* number of links */ +#define F_OPT 0x00200 /* existence optional */ +#define F_SIZE 0x00400 /* size */ +#define F_SLINK 0x00800 /* link count */ +#define F_TIME 0x01000 /* modification time */ +#define F_TYPE 0x02000 /* file type */ +#define F_UID 0x04000 /* uid */ +#define F_UNAME 0x08000 /* user name */ +#define F_VISIT 0x10000 /* file visited */ + u_int32_t flags; /* items set */ #define F_BLOCK 0x001 /* block special */ #define F_CHAR 0x002 /* char special */ diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c index 104675b428e..7686b28a4b1 100644 --- a/usr.sbin/mtree/spec.c +++ b/usr.sbin/mtree/spec.c @@ -1,5 +1,5 @@ /* $NetBSD: spec.c,v 1.6 1995/03/07 21:12:12 cgd Exp $ */ -/* $OpenBSD: spec.c,v 1.3 1996/12/10 08:26:10 deraadt Exp $ */ +/* $OpenBSD: spec.c,v 1.4 1996/12/20 18:13:44 millert Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -218,7 +218,7 @@ set(t, ip) err("invalid link count %s", val); break; case F_SIZE: - ip->st_size = strtoq(val, &ep, 10); + ip->st_size = strtouq(val, &ep, 10); if (*ep) err("invalid size %s", val); break; diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c index 328ce38e663..01e991f853f 100644 --- a/usr.sbin/mtree/verify.c +++ b/usr.sbin/mtree/verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verify.c,v 1.3 1996/12/10 08:26:10 deraadt Exp $ */ +/* $OpenBSD: verify.c,v 1.4 1996/12/20 18:13:44 millert Exp $ */ /* $NetBSD: verify.c,v 1.10 1995/03/07 21:26:28 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: verify.c,v 1.3 1996/12/10 08:26:10 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: verify.c,v 1.4 1996/12/20 18:13:44 millert Exp $"; #endif #endif /* not lint */ @@ -164,6 +164,8 @@ miss(p, tail) register char *tp; for (; p; p = p->next) { + if ((p->flags & F_OPT) && !(p->flags & F_VISIT)) + continue; if (p->type != F_DIR && (dflag || p->flags & F_VISIT)) continue; (void)strcpy(tail, p->name); |