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