Remove character and block devices from supported entry types
Closes #1.
This commit is contained in:
parent
eeb7bccda8
commit
28d1eab1c1
@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.8..3.22)
|
cmake_minimum_required(VERSION 3.8..3.22)
|
||||||
|
|
||||||
project(minitar LANGUAGES C VERSION 1.1.0)
|
project(minitar LANGUAGES C VERSION 1.2.0)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
src/tar.c
|
src/tar.c
|
||||||
|
@ -119,13 +119,9 @@ This enum lists all supported file types:
|
|||||||
|
|
||||||
`MTAR_REGULAR`: Regular files
|
`MTAR_REGULAR`: Regular files
|
||||||
|
|
||||||
`MTAR_BLKDEV`: Block special devices
|
|
||||||
|
|
||||||
`MTAR_CHRDEV`: Character special devices
|
|
||||||
|
|
||||||
`MTAR_DIRECTORY`: Directories
|
`MTAR_DIRECTORY`: Directories
|
||||||
|
|
||||||
Other file types supported in tar archives, such as FIFOs or symlinks, are not supported and minitar will throw an error when encountering one of them.
|
Other file types supported in tar archives, such as block/character devices, FIFOs, or symlinks, are not supported and minitar will throw an error when encountering one of them.
|
||||||
|
|
||||||
### minitar_entry_metadata
|
### minitar_entry_metadata
|
||||||
`struct minitar_entry_metadata`
|
`struct minitar_entry_metadata`
|
||||||
|
@ -15,8 +15,6 @@ struct minitar;
|
|||||||
enum minitar_file_type
|
enum minitar_file_type
|
||||||
{
|
{
|
||||||
MTAR_REGULAR,
|
MTAR_REGULAR,
|
||||||
MTAR_CHRDEV,
|
|
||||||
MTAR_BLKDEV,
|
|
||||||
MTAR_DIRECTORY
|
MTAR_DIRECTORY
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,8 +126,8 @@ void minitar_parse_metadata_from_tar_header(const struct tar_header* hdr, struct
|
|||||||
case '0': metadata->type = MTAR_REGULAR; break;
|
case '0': metadata->type = MTAR_REGULAR; break;
|
||||||
case '1': minitar_panic("Links to other files within a tar archive are unsupported");
|
case '1': minitar_panic("Links to other files within a tar archive are unsupported");
|
||||||
case '2': minitar_panic("Symbolic links are unsupported");
|
case '2': minitar_panic("Symbolic links are unsupported");
|
||||||
case '3': metadata->type = MTAR_CHRDEV; break;
|
case '3': minitar_panic("Character devices are unsupported");
|
||||||
case '4': metadata->type = MTAR_BLKDEV; break;
|
case '4': minitar_panic("Block devices are unsupported");
|
||||||
case '5': metadata->type = MTAR_DIRECTORY; break;
|
case '5': metadata->type = MTAR_DIRECTORY; break;
|
||||||
case '6': minitar_panic("FIFOs are unsupported");
|
case '6': minitar_panic("FIFOs are unsupported");
|
||||||
default: minitar_panic("Unknown entry type in tar header");
|
default: minitar_panic("Unknown entry type in tar header");
|
||||||
|
Loading…
Reference in New Issue
Block a user