X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Ftape.c;h=3d673b62b740c9c1057e70a2ef6c3d0cd9dec469;hp=e60921bf3b86b1afff5ce0a8666978da04fe89d7;hb=d2816d4c6c4eec401565da957145316d432d8fd5;hpb=cca7148b36e60b4671518602ff9a7c2d0c22a7b2 diff --git a/restore/tape.c b/restore/tape.c index e60921b..3d673b6 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.89 2005/05/02 15:10:46 stelian Exp $"; + "$Id: tape.c,v 1.92 2007/02/22 20:16:23 stelian Exp $"; #endif /* not lint */ #include @@ -346,6 +346,7 @@ setup(void) #endif FLUSHTAPEBUF(); findtapeblksize(); + cvtflag = 0; if (gethead(&spcl) == FAIL) { blkcnt--; /* push back this block */ blksread--; @@ -569,6 +570,8 @@ again: } if (haderror || (bot_code && !Mflag)) { haderror = 0; + if (compare_errors) + fprintf(stderr, "%d compare errors so far\n", compare_errors); #ifdef sunos fprintf(stderr, "Mount volume %ld\n", (long)newvol); #else @@ -905,6 +908,8 @@ extractfile(struct entry *ep, int doremove) } (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); (void) chmod(name, mode); + extractattr(name); + utimes(name, timep); if (flags) #ifdef __linux__ (void) lsetflags(name, flags); @@ -919,8 +924,6 @@ extractfile(struct entry *ep, int doremove) #endif #endif skipfile(); - extractattr(name); - utimes(name, timep); return (GOOD); case IFCHR: @@ -941,6 +944,8 @@ extractfile(struct entry *ep, int doremove) } (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); (void) chmod(name, mode); + extractattr(name); + utimes(name, timep); if (flags) #ifdef __linux__ { @@ -961,8 +966,6 @@ extractfile(struct entry *ep, int doremove) #endif #endif skipfile(); - extractattr(name); - utimes(name, timep); return (GOOD); case IFREG: @@ -991,6 +994,8 @@ extractfile(struct entry *ep, int doremove) skipfile(); (void) chown(name, luid, lgid); (void) chmod(name, mode); + extractattr(name); + utimes(name, timep); if (flags) #ifdef __linux__ (void) lsetflags(name, flags); @@ -1004,8 +1009,6 @@ extractfile(struct entry *ep, int doremove) (void) chflags(name, flags); #endif #endif - extractattr(name); - utimes(name, timep); return (GOOD); } } @@ -1213,8 +1216,8 @@ extractresourceufs(char *name) (void) fchown(ofile, uid, gid); (void) fchmod(ofile, mode); (void) close(ofile); - (void) lsetflags(oFileRsrc, flags); utimes(oFileRsrc, timep); + (void) lsetflags(oFileRsrc, flags); return (GOOD); } /* NOTREACHED */ @@ -2412,6 +2415,7 @@ findtapeblksize(void) errx(1, "Tape read error on first record"); memcpy(&spclpt, tapebuf, TP_BSIZE); + cvtflag = 0; if (converthead(&spclpt) == FAIL) { cvtflag++; if (converthead(&spclpt) == FAIL) { @@ -2622,7 +2626,7 @@ converthead(struct s_spcl *buf) if (checksum((int *)buf) == FAIL) return (FAIL); if (Bcvt) - swabst((u_char *)"8i4s31i528bi192b3i", (u_char *)buf); + swabst((u_char *)"8i4s1l29i528bi192b4i", (u_char *)buf); goto good; } memcpy(&u_ospcl.s_ospcl, buf, TP_BSIZE);