#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.94 2009/12/03 12:46:30 stelian Exp $";
+ "$Id: tape.c,v 1.96 2010/03/22 15:40:55 stelian Exp $";
#endif /* not lint */
#include <config.h>
}
case IFIFO:
+ {
+ uid_t luid = curfile.dip->di_uid;
+ gid_t lgid = curfile.dip->di_gid;
+
Vprintf(stdout, "extract fifo %s\n", name);
skipfile();
if (Nflag)
return (FAIL);
}
}
- (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
+ (void) chown(name, luid, lgid);
(void) chmod(name, mode);
extractattr(name);
utimes(name, timep);
#endif
#endif
return (GOOD);
-
+ }
case IFCHR:
case IFBLK:
+ {
+ uid_t luid = curfile.dip->di_uid;
+ gid_t lgid = curfile.dip->di_gid;
+ int lrdev = (int)curfile.dip->di_rdev;
+
Vprintf(stdout, "extract special file %s\n", name);
skipfile();
if (Nflag)
if (! (spcl.c_flags & DR_METAONLY)) {
if (uflag)
(void)unlink(name);
- if (mknod(name, mode, (int)curfile.dip->di_rdev) < 0) {
+ if (mknod(name, mode, lrdev) < 0) {
warn("%s: cannot create special file", name);
return (FAIL);
}
}
- (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
+ (void) chown(name, luid, lgid);
(void) chmod(name, mode);
extractattr(name);
utimes(name, timep);
#endif
#endif
return (GOOD);
-
+ }
case IFREG:
{
uid_t luid = curfile.dip->di_uid;
skipfile();
return (FAIL);
}
-
+
memset(xattrbuf, 0, XATTR_MAXSIZE);
xattrlen = 0;
+ /*
+ * ugly hack: cope with invalid spcl.c_addr[] records written by
+ * old versions of dump.
+ */
+ readmapflag = 1;
+
getfile(xtrxattr, xtrnull);
+ readmapflag = 0;
+
memcpy(buffer, xattrbuf, XATTR_MAXSIZE);
return (GOOD);