10 #ifndef UNUNPACK_GLOBALS_H
11 #define UNUNPACK_GLOBALS_H
15 char Version[]=COMMIT_HASH;
17 char Version[]=
"0.9.9";
64 {
"",
"",
"",
"",
"",CMD_NULL,0,0177000,0177000, },
65 {
"application/gzip",
"zcat",
"",
"> '%s' 2>/dev/null",
"",CMD_PACK,1,0177000,0177000, },
66 {
"application/x-gzip",
"zcat",
"",
"> '%s' 2>/dev/null",
"",CMD_PACK,1,0177000,0177000, },
67 {
"application/x-compress",
"zcat",
"",
"> '%s' 2>/dev/null",
"",CMD_PACK,1,0177000,0177000, },
68 {
"application/x-bzip",
"bzcat",
"",
"> '%s' 2>/dev/null",
"",CMD_PACK,1,0177000,0177000, },
69 {
"application/x-bzip2",
"bzcat",
"",
"> '%s' 2>/dev/null",
"",CMD_PACK,1,0177000,0177000, },
71 {
"application/x-upx",
"upx",
"-d -o'%s'",
">/dev/null 2>&1",
"",CMD_PACK,1,0177000,0177000, },
73 {
"application/pdf",
"pdftotext",
"-htmlmeta",
"'%s' >/dev/null 2>&1",
"",CMD_PACK,1,0100000,0100000, },
74 {
"application/x-pdf",
"pdftotext",
"-htmlmeta",
"'%s' >/dev/null 2>&1",
"",CMD_PACK,1,0100000,0100000, },
75 {
"application/x-zip",
"unzip",
"-q -P none -o",
"-x / >/dev/null 2>&1",
"unzip -Zhzv '%s' > '%s'",CMD_ARC,1,0177000,0177000, },
76 {
"application/zip",
"unzip",
"-q -P none -o",
"-x / >/dev/null 2>&1",
"unzip -Zhzv '%s' > '%s'",CMD_ARC,1,0177000,0177000, },
77 {
"application/x-tar",
"tar",
"-xSf",
"2>&1 ; echo ''",
"",CMD_ARC,1,0177000,0177777, },
78 {
"application/x-gtar",
"tar",
"-xSf",
"2>&1 ; echo ''",
"",CMD_ARC,1,0177000,0177777, },
79 {
"application/x-cpio",
"cpio",
"--no-absolute-filenames -i -d <",
">/dev/null 2>&1",
"",CMD_ARC,1,0177777,0177777, },
80 {
"application/x-rar",
"unrar",
"x -o+ -p-",
">/dev/null 2>&1",
"",CMD_ARC,1,0177000,0177000, },
81 {
"application/x-cab",
"cabextract",
"",
">/dev/null 2>&1",
"",CMD_ARC,1,0177000,0177000, },
82 {
"application/x-7z-compressed",
"7z",
"x -y -pjunk",
">/dev/null 2>&1",
"",CMD_ARC,1,0177000,0177000, },
83 {
"application/x-7z-w-compressed",
"7z",
"x -y -pjunk",
">/dev/null 2>&1",
"",CMD_ARC,1,0177000,0177000, },
84 {
"application/x-rpm",
"rpm2cpio",
"",
"> '%s' 2> /dev/null",
"rpm -qip '%s' > '%s' 2>&1",CMD_RPM,1,0177000,0177000, },
85 {
"application/x-archive",
"ar",
"x",
">/dev/null 2>&1",
"",CMD_AR,1,0177000,0177777, },
86 {
"application/x-debian-package",
"ar",
"x",
">/dev/null 2>&1",
"dpkg -I '%s' > '%s'",CMD_AR,1,0177000,0177777, },
87 {
"application/x-iso",
"",
"",
"",
"isoinfo -d -i '%s' > '%s'",CMD_ISO,1,0177777,0177777, },
88 {
"application/x-iso9660-image",
"",
"",
"",
"isoinfo -d -i '%s' > '%s'",CMD_ISO,1,0177777,0177777, },
89 {
"application/x-fat",
"fat",
"",
"",
"",CMD_DISK,1,0177700,0177777, },
90 {
"application/x-ntfs",
"ntfs",
"",
"",
"",CMD_DISK,1,0177700,0177777, },
91 {
"application/x-ext2",
"linux-ext",
"",
"",
"",CMD_DISK,1,0177777,0177777, },
92 {
"application/x-ext3",
"linux-ext",
"",
"",
"",CMD_DISK,1,0177777,0177777, },
93 {
"application/x-x86_boot",
"departition",
"",
"> /dev/null 2>&1",
"",CMD_PARTITION,1,0177000,0177000, },
94 {
"application/x-debian-source",
"dpkg-source",
"-x",
"'%s' >/dev/null 2>&1",
"",CMD_DEB,1,0177000,0177000, },
95 {
"application/x-xz",
"tar",
"-JxSf",
">/dev/null 2>&1",
"",CMD_ARC,1,0177000,0177777, },
96 {
"application/jar",
"unzip",
"-q -P none -o",
"-x / >/dev/null 2>&1",
"unzip -Zhzv '%s' > '%s'",CMD_ARC,1,0177000,0177000, },
97 {
"application/java-archive",
"unzip",
"-q -P none -o",
"-x / >/dev/null 2>&1",
"unzip -Zhzv '%s' > '%s'",CMD_ARC,1,0177000,0177000, },
98 {
"application/x-dosexec",
"7z",
"x -y -pjunk",
">/dev/null 2>&1",
"",CMD_ARC,1,0177000,0177000, },
99 {
"application/vnd.debian.binary-package",
"ar",
"x",
">/dev/null 2>&1",
"dpkg -I '%s' > '%s'",CMD_AR,1,0177000,0177777, },
100 {
"application/zstd",
"zstd",
"-d",
">/dev/null 2>&1",
"zstd -lv '%s' > '%s'", CMD_ZSTD, 1, 0177000, 0177000, },
101 {
"application/x-lz4",
"zstd",
"-d",
">/dev/null 2>&1",
"", CMD_ZSTD, 1, 0177000, 0177000, },
102 {
"application/x-lzma",
"zstd",
"-d",
">/dev/null 2>&1",
"", CMD_ZSTD, 1, 0177000, 0177000, },
103 {
"",
"",
"",
">/dev/null 2>&1",
"",CMD_DEFAULT,1,0177000,0177000, },
104 { NULL,NULL,NULL,NULL,NULL,-1,-1,0177000,0177000, },
Command table's single row.
Queue for files to be unpacked.
int SetContainerArtifact
Should initial container be an artifact?
char * Pfile_Pk
Pfile pk in DB.
int ReunpackSwitch
Set if the uploadtree records are missing from db.
int UseRepository
Using files from the repository?
char uploadtree_tablename[19]
upload.uploadtree_tablename
int MaxThread
Value between 1 and MAXCHILD.
int UnlinkSource
Remove recursive sources after unpacking?
char * Pfile
Pfile name (SHA1.MD5.Size)
int TotalDirectories
Number of directories.
unpackqueue Queue[MAXCHILD+1]
Manage children.
int Quiet
Run in quiet mode?
int Thread
Number of threads in execution.
int TotalFiles
Number of regular files.
int TotalArtifacts
Number of artifacts.
PGconn * pgConn
Database connection.
cmdlist CMD[]
Global command table.
int PruneFiles
Remove links? >1 hard links, zero files, etc.
int TotalContainers
Number of containers.
char UploadFileName[FILENAME_MAX]
Upload file name.
magic_t MagicCookie
for Magic
int Verbose
Verbose level for log.
char * Upload_Pk
Upload pk in DB.
int UnlinkAll
Remove ALL unpacked files when done (clean up)?
char REP_FILES[16]
Files repository name.
FILE * ListOutFile
File to store unpack list.
char REP_GOLD[16]
Gold repository name.
long TotalItems
Number of records inserted.
int IgnoreSCMData
1: Ignore SCM data, 0: dont ignore it.
int TotalCompressedFiles
Number of compressed files.
int ForceDuplicate
When using db, should it process duplicates?
int ForceContinue
Force continue when unpack tool fails?