If the output is not a regular file, it's okay to add it to the archive.
In particular, /dev/st0 can be added to an archive being written to /dev/st0. Thanks to: Jaakko Heinonen
This commit is contained in:
parent
21240a6daf
commit
ebf75b4df5
@ -125,8 +125,15 @@ file_open(struct archive *a, void *client_data)
|
|||||||
return (ARCHIVE_FATAL);
|
return (ARCHIVE_FATAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
a->skip_file_dev = pst->st_dev;
|
/*
|
||||||
a->skip_file_ino = pst->st_ino;
|
* If the output file is a regular file, don't add it to
|
||||||
|
* itself. If it's a device file, it's okay to add the device
|
||||||
|
* entry to the output archive.
|
||||||
|
*/
|
||||||
|
if (S_ISREG(pst->st_mode)) {
|
||||||
|
a->skip_file_dev = pst->st_dev;
|
||||||
|
a->skip_file_ino = pst->st_ino;
|
||||||
|
}
|
||||||
|
|
||||||
return (ARCHIVE_OK);
|
return (ARCHIVE_OK);
|
||||||
}
|
}
|
||||||
|
@ -125,8 +125,15 @@ file_open(struct archive *a, void *client_data)
|
|||||||
return (ARCHIVE_FATAL);
|
return (ARCHIVE_FATAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
a->skip_file_dev = pst->st_dev;
|
/*
|
||||||
a->skip_file_ino = pst->st_ino;
|
* If the output file is a regular file, don't add it to
|
||||||
|
* itself. If it's a device file, it's okay to add the device
|
||||||
|
* entry to the output archive.
|
||||||
|
*/
|
||||||
|
if (S_ISREG(pst->st_mode)) {
|
||||||
|
a->skip_file_dev = pst->st_dev;
|
||||||
|
a->skip_file_ino = pst->st_ino;
|
||||||
|
}
|
||||||
|
|
||||||
return (ARCHIVE_OK);
|
return (ARCHIVE_OK);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user