FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ununpack.c
Go to the documentation of this file.
1 /*******************************************************************
2  Ununpack: The universal unpacker.
3 
4  Copyright (C) 2007-2013 Hewlett-Packard Development Company, L.P.
5  Copyright (C) 2015 Siemens AG
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License
9  version 2 as published by the Free Software Foundation.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *******************************************************************/
106 #define _GNU_SOURCE
107 #include "ununpack.h"
108 #include "ununpack_globals.h"
109 
110 #ifdef COMMIT_HASH_S
111 char BuildVersion[]="ununpack build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
112 #else
113 char BuildVersion[]="ununpack build version: NULL.\n";
114 #endif
115 
116 /***********************************************************************/
117 int main(int argc, char *argv[])
118 {
119  int Pid;
120  int c;
121  int rvExist1=0, rvExist2=0;
122  PGresult *result;
123  char *NewDir=".";
124  char *AgentName = "ununpack";
125  char *AgentARSName = "ununpack_ars";
126  char *agent_desc = "Unpacks archives (iso, tar, etc)";
127  int Recurse=0;
128  int ars_pk = 0;
129  int user_pk = 0;
130  long Pfile_size = 0;
131  char *ListOutName=NULL;
132  char *Fname = NULL;
133  char *FnameCheck = NULL;
134  char *COMMIT_HASH;
135  char *VERSION;
136  char agent_rev[PATH_MAX];
137  struct stat Stat;
138 
139  /* connect to the scheduler */
140  fo_scheduler_connect(&argc, argv, &pgConn);
141 
142  while((c = getopt(argc,argv,"ACc:d:FfHhL:m:PQiIqRr:T:t:U:VvXx")) != -1)
143  {
144  switch(c)
145  {
146  case 'A': SetContainerArtifact=0; break;
147  case 'C': ForceContinue=1; break;
148  case 'c': break; /* handled by fo_scheduler_connect() */
149  case 'd':
150  /* if there is a %U in the path, substitute a unique ID */
151  NewDir=PathCheck(optarg);
152  break;
153  case 'F': UseRepository=1; break;
154  case 'f': ForceDuplicate=1; break;
155  case 'L': ListOutName=optarg; break;
156  case 'm':
157  MaxThread = atoi(optarg);
158  if (MaxThread < 1) MaxThread=1;
159  break;
160  case 'P': PruneFiles=1; break;
161  case 'R': Recurse=-1; break;
162  case 'r': Recurse=atoi(optarg); break;
163  case 'i':
164  if (!IsExe("dpkg-source",Quiet))
165  LOG_WARNING("dpkg-source is not available on this system. This means that debian source packages will NOT be unpacked.");
166  SafeExit(0);
167  break; /* never reached */
168  case 'I': IgnoreSCMData=1; break;
169  case 'Q':
170  UseRepository=1;
171 
172  user_pk = fo_scheduler_userID(); /* get user_pk for user who queued the agent */
173 
174  /* Get the upload_pk from the scheduler */
175  if((Upload_Pk = fo_scheduler_next()) == NULL) SafeExit(0);
176  break;
177  case 'q': Quiet=1; break;
178  case 'T':
179  memset(REP_GOLD,0,sizeof(REP_GOLD));
180  strncpy(REP_GOLD,optarg,sizeof(REP_GOLD)-1);
181  break;
182  case 't':
183  memset(REP_FILES,0,sizeof(REP_FILES));
184  strncpy(REP_FILES,optarg,sizeof(REP_FILES)-1);
185  break;
186  case 'U':
187  UseRepository = 1;
188  Recurse = -1;
189  Upload_Pk = optarg;
190  break;
191  case 'V': printf("%s", BuildVersion);SafeExit(0);
192  case 'v': Verbose++; break;
193  case 'X': UnlinkSource=1; break;
194  case 'x': UnlinkAll=1; break;
195  default:
196  Usage(argv[0], BuildVersion);
197  SafeExit(25);
198  }
199  }
200 
201  /* Open DB and Initialize CMD table */
202  if (UseRepository)
203  {
204  /* Check Permissions */
205  if (GetUploadPerm(pgConn, atoi(Upload_Pk), user_pk) < PERM_WRITE)
206  {
207  LOG_ERROR("You have no update permissions on upload %s", Upload_Pk);
208  SafeExit(100);
209  }
210 
211  COMMIT_HASH = fo_sysconfig(AgentName, "COMMIT_HASH");
212  VERSION = fo_sysconfig(AgentName, "VERSION");
213  sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
214  /* Get the unpack agent key */
215  agent_pk = fo_GetAgentKey(pgConn, AgentName, atoi(Upload_Pk), agent_rev,agent_desc);
216 
217  InitCmd();
218 
219  /* Make sure ars table exists */
220  if (!fo_CreateARSTable(pgConn, AgentARSName)) SafeExit(0);
221 
222  /* Has this user previously unpacked this upload_pk successfully?
223  * In this case we are done. No new ars record is needed since no
224  * processing is initiated.
225  * The unpack version is ignored.
226  */
227  snprintf(SQL,MAXSQL,
228  "SELECT ars_pk from %s where upload_fk='%s' and ars_success=TRUE",
229  AgentARSName, Upload_Pk);
230  result = PQexec(pgConn, SQL);
231  if (fo_checkPQresult(pgConn, result, SQL, __FILE__, __LINE__)) SafeExit(101);
232 
233  if (PQntuples(result) > 0) /* if there is a value */
234  {
235  PQclear(result);
236  LOG_WARNING("Upload_pk %s, has already been unpacked. No further action required",
237  Upload_Pk)
238  SafeExit(0);
239  }
240  PQclear(result);
241 
242  /* write the unpack_ars start record */
243  ars_pk = fo_WriteARS(pgConn, ars_pk, atoi(Upload_Pk), agent_pk, AgentARSName, 0, 0);
244 
245  /* Get Pfile path and Pfile_Pk, from Upload_Pk */
246  snprintf(SQL,MAXSQL,
247  "SELECT pfile.pfile_sha1 || '.' || pfile.pfile_md5 || '.' || pfile.pfile_size AS pfile, pfile_fk, pfile_size FROM upload INNER JOIN pfile ON upload.pfile_fk = pfile.pfile_pk WHERE upload.upload_pk = '%s'",
248  Upload_Pk);
249  result = PQexec(pgConn, SQL);
250  if (fo_checkPQresult(pgConn, result, SQL, __FILE__, __LINE__)) SafeExit(102);
251 
252  if (PQntuples(result) > 0) /* if there is a value */
253  {
254  Pfile = strdup(PQgetvalue(result,0,0));
255  Pfile_Pk = strdup(PQgetvalue(result,0,1));
256  Pfile_size = atol(PQgetvalue(result, 0, 2));
257  if (Pfile_size == 0)
258  {
259  PQclear(result);
260  LOG_WARNING("Uploaded file (Upload_pk %s), is zero length. There is nothing to unpack.",
261  Upload_Pk)
262  SafeExit(0);
263  }
264 
265  PQclear(result);
266  }
267 
268  // Determine if uploadtree records should go into a separate table.
269  // If the input file size is > 500MB, then create a separate uploadtree_{upload_pk} table
270  // that inherits from the master uploadtree table.
271  // Save uploadtree_tablename, it will get written to upload.uploadtree_tablename later.
272  if (Pfile_size > 500000000)
273  {
274  sprintf(uploadtree_tablename, "uploadtree_%s", Upload_Pk);
275  if (!fo_tableExists(pgConn, uploadtree_tablename))
276  {
277  snprintf(SQL,MAXSQL,"CREATE TABLE %s (LIKE uploadtree INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING INDEXES); ALTER TABLE %s ADD CONSTRAINT %s CHECK (upload_fk=%s); ALTER TABLE %s INHERIT uploadtree",
279  PQsetNoticeProcessor(pgConn, SQLNoticeProcessor, SQL); // ignore notice about implicit primary key index creation
280  result = PQexec(pgConn, SQL);
281  // Ignore postgres notice about creating an implicit index
282  if (PQresultStatus(result) != PGRES_NONFATAL_ERROR)
283  if (fo_checkPQcommand(pgConn, result, SQL, __FILE__, __LINE__)) SafeExit(103);
284  PQclear(result);
285  }
286  }
287  else
288  strcpy(uploadtree_tablename, "uploadtree_a");
289 
290  }
291 
293  if (NewDir) MkDir(NewDir);
294  if (Verbose) { fclose(stderr) ; stderr=stdout; } /* don't interlace! */
295  if (ListOutName != NULL)
296  {
297  if ((ListOutName[0]=='-') && (ListOutName[1]=='\0'))
298  ListOutFile=stdout;
299  else ListOutFile = fopen(ListOutName,"w");
300  if (!ListOutFile)
301  {
302  LOG_ERROR("pfile %s Unable to write to %s\n",Pfile_Pk,ListOutName)
303  SafeExit(104);
304  }
305  else
306  {
307  /* Start the file */
308  fputs("<xml tool=\"ununpack\" ",ListOutFile);
309  fputs("version=\"",ListOutFile);
310  fputs(Version,ListOutFile);
311  fputs("\" ",ListOutFile);
312  fputs("compiled_date=\"",ListOutFile);
313  fputs(__DATE__,ListOutFile);
314  fputs(" ",ListOutFile);
315  fputs(__TIME__,ListOutFile);
316  fputs("\"",ListOutFile);
317  fputs(">\n",ListOutFile);
318  }
319  /* Problem: When parallel processing, the XML may be generated out
320  of order. Solution? When using XML, only use 1 thread. */
321  MaxThread=1;
322  }
323 
324  // Set ReunpackSwitch if the uploadtree records are missing from the database.
326  {
327  snprintf(SQL,MAXSQL,"SELECT uploadtree_pk FROM uploadtree WHERE upload_fk=%s limit 1;",Upload_Pk);
328  result = PQexec(pgConn, SQL);
329  if (fo_checkPQresult(pgConn, result, SQL, __FILE__, __LINE__)) SafeExit(105);
330  if (PQntuples(result) == 0) ReunpackSwitch=1;
331  PQclear(result);
332  }
333 
334  /*** process files from command line ***/
335  for( ; optind<argc; optind++)
336  {
337  CksumFile *CF=NULL;
338  Cksum *Sum;
339  int i;
340  if (Fname) { free(Fname); Fname=NULL; }
341  if (ListOutName != NULL)
342  {
343  fprintf(ListOutFile,"<source source=\"%s\" ",argv[optind]);
344  if (UseRepository && !fo_RepExist(REP_FILES,argv[optind]))
345  {
346  /* make sure the source exists in the src repository */
347  if (fo_RepImport(argv[optind],REP_FILES,argv[optind],1) != 0)
348  {
349  LOG_ERROR("Failed to import '%s' as '%s' into the repository",argv[optind],argv[optind])
350  SafeExit(106);
351  }
352  }
353  }
354 
355  if (UseRepository)
356  {
357  if (fo_RepExist(REP_FILES,argv[optind]))
358  {
359  Fname=fo_RepMkPath(REP_FILES,argv[optind]);
360  }
361  else if (fo_RepExist(REP_GOLD,argv[optind]))
362  {
363  Fname=fo_RepMkPath(REP_GOLD,argv[optind]);
364  if (fo_RepImport(Fname,REP_FILES,argv[optind],1) != 0)
365  {
366  LOG_ERROR("Failed to import '%s' as '%s' into the repository",Fname,argv[optind])
367  SafeExit(107);
368  }
369  }
370 
371  if (Fname)
372  {
373  FnameCheck = Fname;
374  CF = SumOpenFile(Fname);
375  }
376  else
377  {
378  LOG_ERROR("NO file unpacked. File %s does not exist either in GOLD or FILES", Pfile);
379  SafeExit(108);
380  }
381  /* else: Fname is NULL and CF is NULL */
382  }
383  else
384  {
385  FnameCheck = argv[optind];
386  CF = SumOpenFile(argv[optind]);
387  }
388 
389  /* Check file to unpack. Does it exist? Is it zero length? */
390  if (stat(FnameCheck,&Stat))
391  {
392  LOG_ERROR("File to unpack is unavailable: %s, error: %s", Fname, strerror(errno));
393  SafeExit(109);
394  }
395  else
396  if (Stat.st_size < 1)
397  {
398  LOG_WARNING("File to unpack is empty: %s", Fname);
399  SafeExit(110);
400  }
401 
402  if (ListOutFile)
403  {
404  if (CF)
405  {
406  Sum = SumComputeBuff(CF);
407  SumCloseFile(CF);
408  if (Sum)
409  {
410  fputs("fuid=\"",ListOutFile);
411  for(i=0; i<20; i++)
412  { fprintf(ListOutFile,"%02X",Sum->SHA1digest[i]); }
413  fputs(".",ListOutFile);
414  for(i=0; i<16; i++)
415  { fprintf(ListOutFile,"%02X",Sum->MD5digest[i]); }
416  fputs(".",ListOutFile);
417  fprintf(ListOutFile,"%Lu",(long long unsigned int)Sum->DataLen);
418  fputs("\" ",ListOutFile);
419  free(Sum);
420  } /* if Sum */
421  } /* if CF */
422  else /* file too large to mmap (probably) */
423  {
424  FILE *Fin;
425  Fin = fopen(argv[optind],"rb");
426  if (Fin)
427  {
428  Sum = SumComputeFile(Fin);
429  if (Sum)
430  {
431  fputs("fuid=\"",ListOutFile);
432  for(i=0; i<20; i++)
433  { fprintf(ListOutFile,"%02X",Sum->SHA1digest[i]); }
434  fputs(".",ListOutFile);
435  for(i=0; i<16; i++)
436  { fprintf(ListOutFile,"%02X",Sum->MD5digest[i]); }
437  fputs(".",ListOutFile);
438  fprintf(ListOutFile,"%Lu",(long long unsigned int)Sum->DataLen);
439  fputs("\" ",ListOutFile);
440  free(Sum);
441  }
442  fclose(Fin);
443  }
444  } /* else no CF */
445  fprintf(ListOutFile,">\n"); /* end source XML */
446  }
447  if (Fname) TraverseStart(Fname,"called by main via args",NewDir,Recurse);
448  else TraverseStart(argv[optind],"called by main",NewDir,Recurse);
449  if (ListOutName != NULL) fprintf(ListOutFile,"</source>\n");
450  } /* end for */
451 
452  /* free memory */
453  if (Fname) { free(Fname); Fname=NULL; }
454 
455  /* process pfile from scheduler */
456  if (Pfile)
457  {
458  if (0 == (rvExist1 = fo_RepExist2(REP_FILES,Pfile)))
459  {
461  }
462  else if (0 == (rvExist2 = fo_RepExist2(REP_GOLD,Pfile)))
463  {
464  Fname=fo_RepMkPath(REP_GOLD,Pfile);
465  if (fo_RepImport(Fname,REP_FILES,Pfile,1) != 0)
466  {
467  LOG_ERROR("Failed to import '%s' as '%s' into the repository",Fname,Pfile)
468  SafeExit(111);
469  }
470  }
471  if (Fname)
472  {
473  TraverseStart(Fname,"called by main via env",NewDir,Recurse);
474  free(Fname);
475  Fname=NULL;
476  }
477  else
478  {
479  LOG_ERROR("NO file unpacked!");
480  if (rvExist1 > 0)
481  {
482  Fname=fo_RepMkPath(REP_FILES, Pfile);
483  LOG_ERROR("Error is %s for %s", strerror(rvExist1), Fname);
484  }
485  if (rvExist2 > 0)
486  {
487  Fname=fo_RepMkPath(REP_GOLD, Pfile);
488  LOG_ERROR("Error is %s for %s", strerror(rvExist2), Fname);
489  }
490  SafeExit(112);
491  }
492  }
493 
494  /* recurse on all the children */
495  if (Thread > 0) do
496  {
497  Pid = ParentWait();
498  Thread--;
499  if (Pid >= 0)
500  {
501  if (!Queue[Pid].ChildEnd)
502  {
503  /* copy over data */
504  if (Recurse > 0)
505  Traverse(Queue[Pid].ChildRecurse,NULL,"called by wait",NULL,Recurse-1,&Queue[Pid].PI);
506  else if (Recurse < 0)
507  Traverse(Queue[Pid].ChildRecurse,NULL,"called by wait",NULL,Recurse,&Queue[Pid].PI);
508  }
509  }
510  } while(Pid >= 0);
511 
512  if (MagicCookie) magic_close(MagicCookie);
513  if (ListOutFile)
514  {
515  fprintf(ListOutFile,"<summary files_regular=\"%d\" files_compressed=\"%d\" artifacts=\"%d\" directories=\"%d\" containers=\"%d\" />\n",
518  fputs("</xml>\n",ListOutFile);
519  }
520  if (pgConn)
521  {
522  /* If it completes, mark it! */
523  if (Upload_Pk)
524  {
525  snprintf(SQL,MAXSQL,"UPDATE upload SET upload_mode = (upload_mode | (1<<5)), uploadtree_tablename='%s' WHERE upload_pk = '%s';",uploadtree_tablename, Upload_Pk);
526  result = PQexec(pgConn, SQL); /* UPDATE upload */
527  if (fo_checkPQcommand(pgConn, result, SQL, __FILE__ ,__LINE__)) SafeExit(113);
528  PQclear(result);
529 
530  snprintf(SQL,MAXSQL,"UPDATE %s SET realparent = getItemParent(uploadtree_pk) WHERE upload_fk = '%s'",uploadtree_tablename, Upload_Pk);
531  result = PQexec(pgConn, SQL); /* UPDATE uploadtree */
532  if (fo_checkPQcommand(pgConn, result, SQL, __FILE__ ,__LINE__)) SafeExit(114);
533  PQclear(result);
534  }
535 
536  if (ars_pk) fo_WriteARS(pgConn, ars_pk, atoi(Upload_Pk), agent_pk, AgentARSName, 0, 1);
537  }
538  if (ListOutFile && (ListOutFile != stdout))
539  {
540  fclose(ListOutFile);
541  }
542 
543  if (UnlinkAll && MaxThread > 1)
544  {
545  /* Delete temporary files */
546  if (strcmp(NewDir, ".")) RemoveDir(NewDir);
547  }
548 
549  SafeExit(0);
550  return(0); // never executed but makes the compiler happy
551 }
char * PathCheck(char *DirPath)
Check if path contains a "%U" or "%H". If so, substitute a unique ID for U.
Definition: utils.c:1672
int fo_checkPQresult(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres SELECT.
Definition: libfossdb.c:181
int Quiet
Run in quiet mode?
int TotalFiles
Number of regular files.
char BuildVersion[]
Definition: buckets.c:79
Contains global declaration of variables.
int ParentWait()
Wait for a child. Sets child status.
Definition: utils.c:520
unpackqueue Queue[MAXCHILD+1]
Manage children.
CksumFile * SumOpenFile(char *Fname)
Open and mmap a file.
Definition: checksum.c:38
if(!$Test &&$OptionQ) if($stdin_flag) if($Verbose) else
Definition: cp2foss.php:551
PGconn * pgConn
Database connection.
Definition: adj2nest.c:98
int RemoveDir(char *dirpath)
Remove all files under dirpath (rm -rf)
Definition: utils.c:1651
int Thread
Number of threads in execution.
int Verbose
Verbose level.
Definition: util.c:28
int TotalCompressedFiles
Number of compressed files.
char * Pfile
Pfile name (SHA1.MD5.Size)
FILE * ListOutFile
File to store unpack list.
int s
The socket that the CLI will use to communicate.
Definition: fo_cli.c:48
char * Pfile_Pk
Pfile pk in DB.
if(!preg_match("/\s$projectGroup\s/", $groups)&&(posix_getgid()!=$gInfo['gid']))
get monk license list of one specified uploadtree_id
Definition: migratetest.php:44
void fo_scheduler_connect(int *argc, char **argv, PGconn **db_conn)
Establish a connection between an agent and the scheduler.
Cksum * SumComputeFile(FILE *Fin)
Compute the checksum, allocate and return a string containing the sum value.
Definition: checksum.c:127
int TotalArtifacts
Number of artifacts.
int Traverse(char *Filename, char *Basename, char *Label, char *NewDir, int Recurse, ParentInfo *PI)
Find all files, traverse all directories. This is a depth-first search, in inode order! ...
Definition: traverse.c:282
int IgnoreSCMData
1: Ignore SCM data, 0: dont ignore it.
int MkDir(char *Fname)
Smart mkdir.
Definition: utils.c:314
uint8_t SHA1digest[20]
SHA1 digest of the file.
Definition: checksum.h:42
void SQLNoticeProcessor(void *arg, const char *message)
Dummy postgresql notice processor. This prevents Notices from being written to stderr.
Definition: utils.c:1782
int ReunpackSwitch
Set if the uploadtree records are missing from db.
int IsExe(char *Exe, int Quiet)
Check if the executable exists.
Definition: utils.c:404
int fo_checkPQcommand(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres commands (not select) If an error occured, write the error to s...
Definition: libfossdb.c:215
uint8_t MD5digest[16]
MD5 digest of the file.
Definition: checksum.h:41
char SQL[256]
SQL query to execute.
Definition: adj2nest.c:90
int ForceDuplicate
When using db, should it process duplicates?
int UseRepository
Using files from the repository?
int fo_scheduler_userID()
Gets the id of the user that created the job that the agent is running.
Usage()
Print Usage statement.
Definition: fo_dbcheck.php:75
int PruneFiles
Remove links? >1 hard links, zero files, etc.
int TotalContainers
Number of containers.
void CheckCommands(int Show)
Make sure all commands are usable.
Definition: utils.c:578
char * NewDir
Test result directory.
Definition: run_tests.c:29
int UnlinkSource
Remove recursive sources after unpacking?
char * fo_RepMkPath(const char *Type, char *Filename)
Given a filename, construct the full path to the file.
Definition: libfossrepo.c:364
char * uploadtree_tablename
upload.uploadtree_tablename
Definition: adj2nest.c:112
FUNCTION int fo_CreateARSTable(PGconn *pgConn, const char *tableName)
Create ars table if it doesn&#39;t already exist.
Definition: libfossagent.c:284
Store check sum of a file.
Definition: checksum.h:39
int agent_pk
Definition: agent.h:85
int fo_tableExists(PGconn *pgConn, const char *tableName)
Check if table exists. Note, this assumes the database name is &#39;fossology&#39;.
Definition: libfossdb.c:243
FUNCTION int fo_GetAgentKey(PGconn *pgConn, const char *agent_name, long Upload_pk, const char *rev, const char *agent_desc)
Get the latest enabled agent key (agent_pk) from the database.
Definition: libfossagent.c:172
uint64_t DataLen
Size of the file.
Definition: checksum.h:43
char * fo_scheduler_next()
Get the next data to process from the scheduler.
FUNCTION int fo_WriteARS(PGconn *pgConn, int ars_pk, int upload_pk, int agent_pk, const char *tableName, const char *ars_status, int ars_success)
Write ars record.
Definition: libfossagent.c:228
char * Upload_Pk
Upload pk in DB.
int fo_RepExist2(char *Type, char *Filename)
Determine if a file exists.
Definition: libfossrepo.c:543
FUNCTION int GetUploadPerm(PGconn *pgConn, long UploadPk, int user_pk)
Get users permission to this upload.
Definition: libfossagent.c:385
magic_t MagicCookie
for Magic
Definition: finder.c:34
char REP_FILES[16]
Files repository name.
char REP_GOLD[16]
Gold repository name.
int TotalDirectories
Number of directories.
int MaxThread
Value between 1 and MAXCHILD.
int fo_RepImport(char *Source, char *Type, char *Filename, int Link)
Import a file into the repository.
Definition: libfossrepo.c:824
void SumCloseFile(CksumFile *CF)
Close a file that was opened with SumOpenFile()
Definition: checksum.c:95
void InitCmd()
Initialize the metahandler CMD table.
Definition: utils.c:119
Cksum * SumComputeBuff(CksumFile *CF)
Compute the checksum, allocate and return a Cksum containing the sum value.
Definition: checksum.c:194
const char * upload_pk
Definition: sqlstatements.h:93
void TraverseStart(char *Filename, char *Label, char *NewDir, int Recurse)
Find all files (assuming a directory) and process (unpack) all of them.
Definition: traverse.c:34
int UnlinkAll
Remove ALL unpacked files when done (clean up)?
void SafeExit(int rc)
Close scheduler and database connections, then exit.
Definition: utils.c:88
int Recurse
Level of unpack recursion. Default to infinite.
Definition: run_tests.c:30
int ForceContinue
Force continue when unpack tool fails?
char * fo_sysconfig(const char *sectionname, const char *variablename)
gets a system configuration variable from the configuration data.
int SetContainerArtifact
Should initial container be an artifact?
Store file handler and mmap of a file.
Definition: checksum.h:50
#define PERM_WRITE
Read-Write permission.
Definition: libfossology.h:45
int fo_RepExist(char *Type, char *Filename)
Determine if a file exists.
Definition: libfossrepo.c:498