X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Ftape.c;h=754da610152cb9732c855c854209486f4466c3ff;hp=9e1e28c2594a70d94f4bc21ab66d49f34b9ca692;hb=08ebf8d7df645851cb5597fd7f755551655c5aa8;hpb=ddd2ef55b78a62c4bc3daad18bef8a90e85a2052 diff --git a/restore/tape.c b/restore/tape.c index 9e1e28c..754da61 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -2,8 +2,7 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999 - * + * Stelian Pop , 1999 */ /* @@ -45,11 +44,8 @@ */ #ifndef lint -#if 0 -static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95"; -#endif static const char rcsid[] = - "$Id: tape.c,v 1.3 1999/10/11 12:59:21 stelian Exp $"; + "$Id: tape.c,v 1.7 1999/11/05 22:02:19 tiniou Exp $"; #endif /* not lint */ #include @@ -583,7 +579,9 @@ extractfile(char *name) } if (linkit(lnkbuf, name, SYMLINK) == FAIL) return (FAIL); - (void) chown(name, luid, lgid); +#ifdef HAVE_LCHOWN + (void) lchown(name, luid, lgid); +#endif return (GOOD); } @@ -602,10 +600,11 @@ extractfile(char *name) } (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); (void) chmod(name, mode); + if (flags) #ifdef __linux__ - (void) fsetflags(name, flags); + (void) fsetflags(name, flags); #else - (void) chflags(name, flags); + (void) chflags(name, flags); #endif skipfile(); utimes(name, timep); @@ -627,10 +626,14 @@ extractfile(char *name) } (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); (void) chmod(name, mode); + if (flags) #ifdef __linux__ - (void) fsetflags(name, flags); + { + warn("%s: fsetflags called on a special file", name); + (void) fsetflags(name, flags); + } #else - (void) chflags(name, flags); + (void) chflags(name, flags); #endif skipfile(); utimes(name, timep); @@ -652,10 +655,11 @@ extractfile(char *name) } (void) fchown(ofile, curfile.dip->di_uid, curfile.dip->di_gid); (void) fchmod(ofile, mode); + if (flags) #ifdef __linux__ - (void) fsetflags(ofile, flags); + (void) setflags(ofile, flags); #else - (void) fchflags(ofile, flags); + (void) fchflags(ofile, flags); #endif getfile(xtrfile, xtrskip); (void) close(ofile);