-/* $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 $ */
/*-
{"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},
-.\" $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
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
-/* $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 $ */
/*-
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 */
/* $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
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;
-/* $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 $ */
/*-
#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 */
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);