Skip to content

Commit

Permalink
feat: Delete of CLIENT conditional directives.
Browse files Browse the repository at this point in the history
The use of the CLIENT directive is deleted and all manager logic is removed.
  • Loading branch information
sdvendramini committed Aug 12, 2024
1 parent 604667d commit 7a253cc
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 699 deletions.
11 changes: 0 additions & 11 deletions src/common/file_op/include/file_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,17 +629,6 @@ int w_is_compressed_gz_file(const char * path);
*/
int w_is_compressed_bz2_file(const char * path);

#ifndef CLIENT
/**
* @brief Check if a file from a path is compressed in bunzip2 or gzip and uncompressed it
*
* @param path File location
* @retval -1 The file cannot be uncompressed
* @retval 0 The file has been uncompressed (.gz or .bz2)
*/
int w_uncompress_bz2_gz_file(const char * path, const char * dest);
#endif /* CLIENT */

/**
* @brief Get the Wazuh installation directory
*
Expand Down
21 changes: 0 additions & 21 deletions src/common/file_op/src/file_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -3432,27 +3432,6 @@ int w_is_compressed_bz2_file(const char * path) {
return retval;
}

#ifndef CLIENT

int w_uncompress_bz2_gz_file(const char * path, const char * dest) {
int result = 1;

if (w_is_compressed_bz2_file(path)) {
result = bzip2_uncompress(path, dest);
}

if (w_is_compressed_gz_file(path)) {
result = w_uncompress_gzfile(path, dest);
}

if (!result) {
mdebug1("The file '%s' was successfully uncompressed into '%s'", path, dest);
}

return result;
}
#endif

#ifndef WIN32
/**
* @brief Get the Wazuh installation directory
Expand Down
48 changes: 0 additions & 48 deletions src/common/syscheck_op/include/syscheck_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,44 +224,6 @@ typedef struct sk_sum_t {
long date_alert;
} sk_sum_t;

/**
* @brief Parse c_sum string
*
* @param [out] sum
* @param [in] c_sum
* @param [in] w_sum
* @return 0 if success, 1 when c_sum denotes a deleted file, -1 on failure
*/
int sk_decode_sum(sk_sum_t *sum, char *c_sum, char *w_sum);

/**
* @brief Parse fields changes and date_alert only provide for wazuh_db
*
* @param [out] sum
* @param [in] c_sum
* @return 0 if success, -1 on failure
*/
int sk_decode_extradata(sk_sum_t *sum, char *c_sum);

/**
* @brief Fill an event with specific data
*
* @param [out] lf Event to be filled
* @param [in] f_name File name for the event
* @param [in] sum File sum used to fill the event
*/
void sk_fill_event(Eventinfo *lf, const char *f_name, const sk_sum_t *sum);

/**
* @brief Fills a buffer with a specific file sum
*
* @param [in] sum File sum used to fill the buffer
* @param [out] output The output buffer to be written
* @param [in] size Size in bytes to be written into output
* @return 0 on success, -1 on failure
*/
int sk_build_sum(const sk_sum_t *sum, char *output, size_t size);

/**
* @brief Delete from path to parent all empty folders
*
Expand All @@ -270,13 +232,6 @@ int sk_build_sum(const sk_sum_t *sum, char *output, size_t size);
*/
int remove_empty_folders(const char *path);

/**
* @brief Frees from memory a sk_sum_t structure
*
* @param [out] sum The sk_sum_t object to be freed
*/
void sk_sum_clean(sk_sum_t *sum);

/**
* @brief Change in Windows paths all slashes for backslashes for compatibility
*
Expand All @@ -291,9 +246,6 @@ void normalize_path(char *path);
* @return A string with escaped characters
*/
char *escape_syscheck_field(char *field);
#ifndef CLIENT
char *unescape_syscheck_field(char *sum);
#endif

#ifndef WIN32

Expand Down
Loading

0 comments on commit 7a253cc

Please sign in to comment.