Correct old style entries so nothing has to be done for the admin.
diff from Manuel Giraud (manuel (at) ledu-giraud.fr) Thanks!
-.\" $OpenBSD: dump.8,v 1.48 2014/07/17 19:58:05 jmc Exp $
+.\" $OpenBSD: dump.8,v 1.49 2015/05/03 01:44:34 guenther Exp $
.\" $NetBSD: dump.8,v 1.17 1997/06/05 11:15:06 lukem Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\"
.\" @(#)dump.8 8.1 (Berkeley) 6/16/93
.\"
-.Dd $Mdocdate: July 17 2014 $
+.Dd $Mdocdate: May 3 2015 $
.Dt DUMP 8
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm dump
.Bk -words
-.Op Fl 0123456789acnSUuWw
+.Op Fl 0123456789acnSuWw
.Op Fl B Ar records
.Op Fl b Ar blocksize
.Op Fl d Ar density
flag is mutually exclusive from the
.Fl u
flag.
-.It Fl U
-Use the
-.Xr disklabel 8
-UID instead of the device name when updating
-.Pa /etc/dumpdates
-and when searching for the date of the latest
-lower-level dump.
.It Fl u
Update the file
.Pa /etc/dumpdates
.Pa /etc/dumpdates
is human readable, consisting of one
free format record per line:
-filesystem name,
+filesystem name (defaults to
+.Xr disklabel 8
+UID when possible),
increment level
and
.Xr ctime 3
-/* $OpenBSD: dump.h,v 1.22 2014/09/03 02:34:34 guenther Exp $ */
+/* $OpenBSD: dump.h,v 1.23 2015/05/03 01:44:34 guenther Exp $ */
/* $NetBSD: dump.h,v 1.11 1997/06/05 11:13:20 lukem Exp $ */
/*-
char lastlevel; /* dump level of previous dump */
char level; /* dump level of this dump */
int uflag; /* update flag */
-int Uflag; /* use duids in dumpdates flag */
int diskfd; /* disk file descriptor */
int tapefd; /* tape file descriptor */
int pipeout; /* true => output to standard output */
-/* $OpenBSD: itime.c,v 1.19 2015/01/16 06:39:57 deraadt Exp $ */
+/* $OpenBSD: itime.c,v 1.20 2015/05/03 01:44:34 guenther Exp $ */
/* $NetBSD: itime.c,v 1.4 1997/04/15 01:09:50 lukem Exp $ */
/*-
int i;
char *fname;
- fname = Uflag ? duid : disk;
+ fname = duid ? duid : disk;
#ifdef FDEBUG
msg("Looking for name %s in dumpdates = %s for level = %c\n",
fname, dumpdates, level);
* and older date
*/
ITITERATE(i, ddp) {
- if (strncmp(fname, ddp->dd_name, sizeof(ddp->dd_name)) != 0)
+ if ((strncmp(fname, ddp->dd_name, sizeof(ddp->dd_name)) != 0) &&
+ (strncmp(disk, ddp->dd_name, sizeof(ddp->dd_name)) != 0))
continue;
if (ddp->dd_level >= level)
continue;
quit("cannot rewrite %s: %s\n", dumpdates, strerror(errno));
fd = fileno(df);
(void) flock(fd, LOCK_EX);
- fname = Uflag ? duid : disk;
+ fname = duid ? duid : disk;
free((char *)ddatev);
ddatev = 0;
nddates = 0;
quit("fseek: %s\n", strerror(errno));
spcl.c_ddate = 0;
ITITERATE(i, dtwalk) {
- if (strncmp(fname, dtwalk->dd_name,
- sizeof(dtwalk->dd_name)) != 0)
+ if ((strncmp(fname, dtwalk->dd_name,
+ sizeof(dtwalk->dd_name)) != 0) &&
+ (strncmp(disk, dtwalk->dd_name,
+ sizeof(dtwalk->dd_name)) != 0))
continue;
if (dtwalk->dd_level != level)
continue;
-/* $OpenBSD: main.c,v 1.54 2015/01/20 18:22:20 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.55 2015/05/03 01:44:34 guenther Exp $ */
/* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */
/*-
usage();
obsolete(&argc, &argv);
- while ((ch = getopt(argc, argv, "0123456789aB:b:cd:f:h:ns:ST:UuWw")) != -1)
+ while ((ch = getopt(argc, argv, "0123456789aB:b:cd:f:h:ns:ST:uWw")) != -1)
switch (ch) {
/* dump level */
case '0': case '1': case '2': case '3': case '4':
lastlevel = '?';
break;
- case 'U':
- Uflag = 1; /* use duids */
- break;
-
case 'u': /* update /etc/dumpdates */
uflag = 1;
break;
}
if (ioctl(diskfd, DIOCGDINFO, (char *)&lab) < 0)
err(1, "ioctl (DIOCGDINFO)");
- if (!Uflag)
- ;
- else if (memcmp(lab.d_uid, &zero_uid, sizeof(lab.d_uid)) == 0) {
- msg("Cannot find DUID of disk %s\n", disk);
- exit(X_STARTUP);
- } else if (asprintf(&duid,
- "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx.%c",
- lab.d_uid[0], lab.d_uid[1], lab.d_uid[2], lab.d_uid[3],
- lab.d_uid[4], lab.d_uid[5], lab.d_uid[6], lab.d_uid[7],
- disk[strlen(disk)-1]) == -1) {
- msg("Cannot malloc duid\n");
- exit(X_STARTUP);
+
+ if (memcmp(lab.d_uid, &zero_uid, sizeof(lab.d_uid)) != 0) {
+ if (asprintf(&duid,
+ "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx.%c",
+ lab.d_uid[0], lab.d_uid[1], lab.d_uid[2], lab.d_uid[3],
+ lab.d_uid[4], lab.d_uid[5], lab.d_uid[6], lab.d_uid[7],
+ disk[strlen(disk)-1]) == -1) {
+ msg("Cannot malloc duid\n");
+ exit(X_STARTUP);
+ }
}
if (!Tflag)
getdumptime(); /* /etc/dumpdates snarfed */
{
extern char *__progname;
- (void)fprintf(stderr, "usage: %s [-0123456789acnSUuWw] [-B records] "
+ (void)fprintf(stderr, "usage: %s [-0123456789acnSuWw] [-B records] "
"[-b blocksize] [-d density]\n"
"\t[-f file] [-h level] [-s feet] "
"[-T date] files-to-dump\n",