23 #define _WGET_AGENT_H 1 26 #define __USE_LARGEFILE64 31 #include <sys/types.h> 40 #define lstat64(x,y) lstat(x,y) 41 #define stat64(x,y) stat(x,y) 42 #define systemError(line, error, cmd) LOG_FATAL("[%s:%d] Error exit: %d, CMD:%s\n", __FILE__, line, WEXITSTATUS(error), cmd); 44 typedef struct stat stat_t;
48 #include "../../ununpack/agent/checksum.h" 54 extern char SQL[STRMAX];
70 int IsFile(
char *Fname,
int Link);
74 int TaintURL(
char *Sin,
char *Sout,
int SoutSize);
75 int GetURL(
char *TempFile,
char *URL,
char *TempFileDir);
76 void SetEnv(
char *S,
char *TempFileDir);
79 void Usage (
char *Name);
81 int Archivefs(
char *Path,
char *TempFile,
char *TempFileDir,
struct stat Status);
char * PathCheck(char *DirPath)
Check if path contains a "%U" or "%H". If so, substitute a unique ID for U.
void MaskPassword()
Get the username from GlobalParam and create new parameters without password.
gid_t ForceGroup
Set to group id to be used for download files.
int Archivefs(char *Path, char *TempFile, char *TempFileDir, struct stat Status)
Copy downloaded files to temporary directory.
int GetPosition(char *URL)
Get the position (ending + 1) of http|https|ftp:// of one url.
PGconn * pgConn
Database connection.
int IsFile(long mode)
Check if the pfile_id is a file.
long GlobalUploadKey
Input for this system.
char * GetVersionControlCommand(int withPassword)
get the command to run to get files from version control system
char GlobalParam[STRMAX]
Additional parameters.
int GetURL(char *TempFile, char *URL, char *TempFileDir)
Do the wget.
char GlobalType[STRMAX]
Type of download (FILE/version control)
void replace_url_with_auth()
Translate authentication of git clone.
void GetProxy()
Get proxy from fossology.conf.
char GlobalURL[URLMAX]
URL to download.
void SetEnv(char *S, char *TempFileDir)
Convert input pairs into globals.
void DBLoadGold()
Insert a file into the database and repository.
char SQL[256]
SQL query to execute.
char GlobalTempFile[STRMAX]
Temp file to be used.
Usage()
Print Usage statement.
int GetVersionControl()
Get source code from version control system.
The main FOSSology C library.
int GlobalImportGold
Set to 0 to not store file in gold repository.
int TaintURL(char *Sin, char *Sout, int SoutSize)
Given a URL string, taint-protect it.
void SafeExit(int rc)
Close scheduler and database connections, then exit.