void **ptr_array = malloc(sizeof(void *) * 2);
ptr_array[0] = abs_filenames;
ptr_array[1] = (void *)state->parsed->user_cwd;
- if (simple_archiver_list_get(filenames_pruned, filenames_to_abs_map_fn, ptr_array)) {
+ if (simple_archiver_list_get(filenames_pruned,
+ filenames_to_abs_map_fn,
+ ptr_array)) {
free(ptr_array);
return SDAS_FAILED_TO_CREATE_MAP;
}
snprintf(format_str, 64, FILE_COUNTS_OUTPUT_FORMAT_STR_1, state->digits,
state->digits);
fprintf(stderr, format_str, state->count, state->max);
- if (simple_archiver_list_get(filenames_pruned, write_files_fn_file_v0, state)) {
+ if (simple_archiver_list_get(filenames_pruned,
+ write_files_fn_file_v0,
+ state)) {
if (is_sig_int_occurred) {
return SDAS_SIGINT;
}
const size_t prefix_length = strlen(state->parsed->prefix);
filename_with_prefix = malloc(heap_buf_str_len + prefix_length + 1);
memcpy(filename_with_prefix, state->parsed->prefix, prefix_length);
- memcpy(filename_with_prefix + prefix_length, uc_heap_buf, heap_buf_str_len);
+ memcpy(filename_with_prefix + prefix_length,
+ uc_heap_buf,
+ heap_buf_str_len);
filename_with_prefix[prefix_length + heap_buf_str_len] = 0;
}
}
link_name[link_name_length] = 0;
- const uint_fast8_t lists_allowed = simple_archiver_helper_string_allowed_lists(
- link_name,
- state->parsed->flags & 0x20000 ? 1 : 0,
- state->parsed);
+ const uint_fast8_t lists_allowed =
+ simple_archiver_helper_string_allowed_lists(
+ link_name,
+ state->parsed->flags & 0x20000 ? 1 : 0,
+ state->parsed);
if (lists_allowed) {
fprintf(stderr, "SYMLINK %3" PRIu32 " of %3" PRIu32 "\n", idx + 1, u32);
if (do_extract && state && state->parsed->prefix) {
link_name_prefixed = malloc(prefix_length + link_name_length + 1);
memcpy(link_name_prefixed, state->parsed->prefix, prefix_length);
- memcpy(link_name_prefixed + prefix_length, link_name, link_name_length + 1);
+ memcpy(link_name_prefixed + prefix_length,
+ link_name,
+ link_name_length + 1);
link_name_prefixed[prefix_length + link_name_length] = 0;
}
if (do_extract && state && state->parsed->prefix) {
filename_prefixed = malloc(prefix_length + filename_length + 1);
memcpy(filename_prefixed, state->parsed->prefix, prefix_length);
- memcpy(filename_prefixed + prefix_length, file_info->filename, filename_length + 1);
+ memcpy(filename_prefixed + prefix_length,
+ file_info->filename,
+ filename_length + 1);
filename_prefixed[prefix_length + filename_length] = 0;
}
if (do_extract && state && state->parsed->prefix) {
filename_prefixed = malloc(prefix_length + filename_length + 1);
memcpy(filename_prefixed, state->parsed->prefix, prefix_length);
- memcpy(filename_prefixed + prefix_length, file_info->filename, filename_length + 1);
+ memcpy(filename_prefixed + prefix_length,
+ file_info->filename,
+ filename_length + 1);
filename_prefixed[prefix_length + filename_length] = 0;
}
buf[u16] = 0;
- const uint_fast8_t lists_allowed = simple_archiver_helper_string_allowed_lists(
- buf,
- state->parsed->flags & 0x20000 ? 1 : 0,
- state->parsed);
+ const uint_fast8_t lists_allowed =
+ simple_archiver_helper_string_allowed_lists(
+ buf,
+ state->parsed->flags & 0x20000 ? 1 : 0,
+ state->parsed);
uint8_t perms_flags[4];
if (fread(perms_flags, 1, 2, in_f) != 2) {
}
link_name[link_name_length] = 0;
- const uint_fast8_t lists_allowed = simple_archiver_helper_string_allowed_lists(
- link_name,
- state->parsed->flags & 0x20000 ? 1 : 0,
- state->parsed);
+ const uint_fast8_t lists_allowed =
+ simple_archiver_helper_string_allowed_lists(
+ link_name,
+ state->parsed->flags & 0x20000 ? 1 : 0,
+ state->parsed);
if (!do_extract && lists_allowed) {
fprintf(stderr, "SYMLINK %3" PRIu32 " of %3" PRIu32 "\n", idx + 1, count);
if (do_extract && state && state->parsed->prefix) {
link_name_prefixed = malloc(prefix_length + link_name_length + 1);
memcpy(link_name_prefixed, state->parsed->prefix, prefix_length);
- memcpy(link_name_prefixed + prefix_length, link_name, link_name_length + 1);
+ memcpy(link_name_prefixed + prefix_length,
+ link_name,
+ link_name_length + 1);
link_name_prefixed[prefix_length + link_name_length] = 0;
}
}
uint32_t out_gid;
- if (simple_archiver_get_gid_mapping(state->parsed->mappings, state->parsed->users_infos, gid, &out_gid, NULL) == 0) {
+ if (simple_archiver_get_gid_mapping(state->parsed->mappings,
+ state->parsed->users_infos,
+ gid,
+ &out_gid,
+ NULL) == 0) {
gid_remapped = malloc(sizeof(uint32_t));
*gid_remapped = out_gid;
}
? simple_archiver_internal_permissions_to_mode_t(
state->parsed->dir_permissions)
: (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH),
- (state->parsed->flags & 0x400) ? state->parsed->uid : file_info->uid,
- (state->parsed->flags & 0x800) ? state->parsed->gid : file_info->gid);
+ (state->parsed->flags & 0x400)
+ ? state->parsed->uid
+ : file_info->uid,
+ (state->parsed->flags & 0x800)
+ ? state->parsed->gid
+ : file_info->gid);
int ret = read_decomp_to_out_file(
filename_prefixed ? filename_prefixed : file_info->filename,
pipe_outof_read,
? simple_archiver_internal_permissions_to_mode_t(
state->parsed->dir_permissions)
: (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH),
- (state->parsed->flags & 0x400) ? state->parsed->uid : file_info->uid,
- (state->parsed->flags & 0x800) ? state->parsed->gid : file_info->gid);
+ (state->parsed->flags & 0x400)
+ ? state->parsed->uid
+ : file_info->uid,
+ (state->parsed->flags & 0x800)
+ ? state->parsed->gid
+ : file_info->gid);
__attribute__((cleanup(simple_archiver_helper_cleanup_FILE)))
FILE *out_fd = fopen(filename_prefixed
? filename_prefixed
const SDArchiverParsed *parsed) {
if (parsed->whitelist_contains_any) {
uint_fast8_t contains_any = 0;
- for (const SDArchiverLLNode *node = parsed->whitelist_contains_any->head->next;
+ for (const SDArchiverLLNode *node
+ = parsed->whitelist_contains_any->head->next;
node != parsed->whitelist_contains_any->tail;
node = node->next) {
if (node->data) {
}
}
if (parsed->whitelist_contains_all) {
- for (const SDArchiverLLNode *node = parsed->whitelist_contains_all->head->next;
+ for (const SDArchiverLLNode *node
+ = parsed->whitelist_contains_all->head->next;
node != parsed->whitelist_contains_all->tail;
node = node->next) {
if (node->data) {
}
if (parsed->blacklist_contains_any) {
- for (const SDArchiverLLNode *node = parsed->blacklist_contains_any->head->next;
+ for (const SDArchiverLLNode *node
+ = parsed->blacklist_contains_any->head->next;
node != parsed->blacklist_contains_any->tail;
node = node->next) {
if (node->data) {
}
if (parsed->blacklist_contains_all) {
uint_fast8_t contains_all = 1;
- for (const SDArchiverLLNode *node = parsed->blacklist_contains_all->head->next;
+ for (const SDArchiverLLNode *node
+ = parsed->blacklist_contains_all->head->next;
node != parsed->blacklist_contains_all->tail;
node = node->next) {
if (node->data) {