65#define IS_ABSOLUTE_PATH(P) ISSLASH((P)[0])
66#define IS_PATH_WITH_DIR(P) (strchr(P, '/') != NULL)
76prepare_to_extract(
char const *file_name,
int typeflag,
tar_extractor_t *fun);
79extract_file(
char *file_name,
int typeflag);
99extract_skip(
char *file_name,
int typeflag);
102extract_failure(
char *file_name,
int typeflag);
105open_output_file(
char const *file_name,
int typeflag, mode_t mode,
106 int file_created, mode_t *current_mode,
107 mode_t *current_mode_mask,
char *constructed_filename_kp);
135extract_dir(
char *file_name_in_arp,
int typeflag)
143 strcpy(
error_message_k,
"Path above wide path limit 32767 characters Unicode, aborting...");
148 strcpy(file_name, file_name_in_arp);
156 if (0 == strcmp(
".", file_name))
161 if (0 == strcmp(
"..", file_name))
182 strcat(destination_folder_kp, file_name);
206 tm_k = 1 ? *_gmtime64(&s) : *_localtime64(&s);
210 WCHAR *ar_temp = (
void *)malloc(r_temp);
211 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
214 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
217 FILE_FLAG_BACKUP_SEMANTICS,
223 if (INVALID_HANDLE_VALUE != hFile)
225 st.wYear = (WORD)tm_k.tm_year + 1900;
226 st.wMonth = (WORD)tm_k.tm_mon + 1;
227 st.wDayOfWeek = (WORD)tm_k.tm_wday;
228 st.wDay = (WORD)tm_k.tm_mday;
229 st.wHour = (WORD)tm_k.tm_hour;
230 st.wMinute = (WORD)tm_k.tm_min;
231 st.wSecond = (WORD)tm_k.tm_sec;
232 st.wMilliseconds = 0;
233 SystemTimeToFileTime(&st, &ftLocal);
234 SetFileTime(hFile, &ftLocal,
NULL, &ftLocal);
239 pedro_dprintf(2,
"%s: Cannot set filetime on folder\n", file_name);
256extract_dir_VAL(
char *file_name_in_arp)
261 memset(file_name, 0,
sizeof(file_name));
266 strcpy(
error_message_k,
"Path came from Linux and is above 32767, aborting...");
271 strcpy(file_name, file_name_in_arp);
276 if (0 == strcmp(
".", file_name))
281 if (0 == strcmp(
"..", file_name))
303 strcat(destination_folder_kp, file_name);
338 tm_k = 1 ? *_gmtime64(&s) : *_localtime64(&s);
341 WCHAR *ar_temp = (
void *)malloc(r_temp);
342 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
345 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
348 FILE_FLAG_BACKUP_SEMANTICS,
353 if (INVALID_HANDLE_VALUE != hFile)
355 st.wYear = (WORD)tm_k.tm_year + 1900;
356 st.wMonth = (WORD)tm_k.tm_mon + 1;
357 st.wDayOfWeek = (WORD)tm_k.tm_wday;
358 st.wDay = (WORD)tm_k.tm_mday;
359 st.wHour = (WORD)tm_k.tm_hour;
360 st.wMinute = (WORD)tm_k.tm_min;
361 st.wSecond = (WORD)tm_k.tm_sec;
362 st.wMilliseconds = 0;
363 SystemTimeToFileTime(&st, &ftLocal);
364 SetFileTime(hFile, &ftLocal,
NULL, &ftLocal);
369 pedro_dprintf(2,
"%s: Cannot set filetime on folder\n", file_name);
377 WCHAR *ar_temp = (
void *)malloc(r_temp);
378 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
381 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
384 FILE_FLAG_BACKUP_SEMANTICS,
389 if (INVALID_HANDLE_VALUE != hFile)
402 pedro_dprintf(2,
"%s: Cannot set filetime on folder\n", file_name);
434 WCHAR *ar_temp = (
void *)malloc(r_temp);
435 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
441 if ((
int)0xffffffff != (
int)
ret)
443 if (
ret & (0x00000010))
471 char *sc2, *psc1, *ps1;
476 ps1 =
s1 + strlen(
s1);
480 for (psc1 = ps1, sc2 = s2;;)
482 if (*(psc1++) != *(sc2++))
486 else if (*sc2 ==
'\0')
488 return ((
char *)ps1);
492 return ((
char *)((
void *)0));
517 strcpy(onlypath, path),
518 onlypath[ptr - path] = 0;
523 strcpy(onlyfilename, &path[ptr - path + 1]);
530 strcpy(onlypath,
"");
534 strcpy(onlyfilename, path);
564 strcpy(onlypath, path),
565 onlypath[ptr - path] = 0;
570 strcpy(onlyfilename, &path[ptr - path + 1]);
577 strcpy(onlypath,
"");
581 strcpy(onlyfilename, path);
601 if (strlen(ptr_i) == strlen(substr))
621 char *whole_path_copy_arp = filename_in_z;
824 char *whole_path_copy_arp = filename_in_z;
828 strcat(filename_out_z,
".tar.Z2");
834 strcat(filename_out_z,
".val.Z2");
839 strcat(filename_out_z,
".tar.lzo2");
845 strcat(filename_out_z,
".tar.br2");
851 strcat(filename_out_z,
".tar.lz5");
857 strcat(filename_out_z,
".val.lzo2");
862 strcat(filename_out_z,
".val.br2");
867 strcat(filename_out_z,
".val.lz5");
873 strcat(filename_out_z,
".tar.gz");
879 strcat(filename_out_z,
".tar.gzip2");
885 strcat(filename_out_z,
".val.gzip2");
891 strcat(filename_out_z,
".tar.bzip3");
897 strcat(filename_out_z,
".val.bzip3");
903 strcat(filename_out_z,
".tar.lzma");
909 strcat(filename_out_z,
".tar.lz");
915 strcat(filename_out_z,
".tar.xz");
921 strcat(filename_out_z,
".tar.Z");
927 strcat(filename_out_z,
".tar.lzo");
933 strcat(filename_out_z,
".tar.lz4");
939 strcat(filename_out_z,
".tar.bz2");
945 strcat(filename_out_z,
".tar.br");
951 strcat(filename_out_z,
".tar.zst");
957 strcat(filename_out_z,
".val.gz");
963 strcat(filename_out_z,
".val.lzma");
969 strcat(filename_out_z,
".val.lz");
975 strcat(filename_out_z,
".val.xz");
981 strcat(filename_out_z,
".val.Z");
987 strcat(filename_out_z,
".val.lzo");
993 strcat(filename_out_z,
".val.lz4");
999 strcat(filename_out_z,
".val.bz2");
1005 strcat(filename_out_z,
".val.br");
1011 strcat(filename_out_z,
".val.zst");
1017 strcat(filename_out_z,
".tar");
1023 strcat(filename_out_z,
".val");
1029 strcat(filename_out_z,
".iso");
1047 char *whole_path_arp,
1048 char *new_extension_arp,
1054 strcpy(whole_path_copy_arp, whole_path_arp);
1058 strcpy(ptr_arp,
".");
1059 strcat(ptr_arp, new_extension_arp);
1060 strcpy(out_data_arp, whole_path_copy_arp);
1066 strcpy(ptr_arp,
".");
1067 strcat(ptr_arp, new_extension_arp);
1068 strcpy(out_data_arp, whole_path_copy_arp);
1074 strcpy(ptr_arp,
".");
1075 strcat(ptr_arp, new_extension_arp);
1076 strcpy(out_data_arp, whole_path_copy_arp);
1082 strcpy(ptr_arp,
".");
1083 strcat(ptr_arp, new_extension_arp);
1084 strcpy(out_data_arp, whole_path_copy_arp);
1090 strcpy(ptr_arp,
".");
1091 strcat(ptr_arp, new_extension_arp);
1092 strcpy(out_data_arp, whole_path_copy_arp);
1098 strcpy(ptr_arp,
".");
1099 strcat(ptr_arp, new_extension_arp);
1100 strcpy(out_data_arp, whole_path_copy_arp);
1106 strcpy(ptr_arp,
".");
1107 strcat(ptr_arp, new_extension_arp);
1108 strcpy(out_data_arp, whole_path_copy_arp);
1114 strcpy(ptr_arp,
".");
1115 strcat(ptr_arp, new_extension_arp);
1116 strcpy(out_data_arp, whole_path_copy_arp);
1122 strcpy(ptr_arp,
".");
1123 strcat(ptr_arp, new_extension_arp);
1124 strcpy(out_data_arp, whole_path_copy_arp);
1130 strcpy(ptr_arp,
".");
1131 strcat(ptr_arp, new_extension_arp);
1132 strcpy(out_data_arp, whole_path_copy_arp);
1138 strcpy(ptr_arp,
".");
1139 strcat(ptr_arp, new_extension_arp);
1140 strcpy(out_data_arp, whole_path_copy_arp);
1146 strcpy(ptr_arp,
".");
1147 strcat(ptr_arp, new_extension_arp);
1148 strcpy(out_data_arp, whole_path_copy_arp);
1154 strcpy(ptr_arp,
".");
1155 strcat(ptr_arp, new_extension_arp);
1156 strcpy(out_data_arp, whole_path_copy_arp);
1162 strcpy(ptr_arp,
".");
1163 strcat(ptr_arp, new_extension_arp);
1164 strcpy(out_data_arp, whole_path_copy_arp);
1169 strcpy(ptr_arp,
".");
1170 strcat(ptr_arp, new_extension_arp);
1171 strcpy(out_data_arp, whole_path_copy_arp);
1177 strcpy(ptr_arp,
".");
1178 strcat(ptr_arp, new_extension_arp);
1179 strcpy(out_data_arp, whole_path_copy_arp);
1185 strcpy(ptr_arp,
".");
1186 strcat(ptr_arp, new_extension_arp);
1187 strcpy(out_data_arp, whole_path_copy_arp);
1193 strcpy(ptr_arp,
".");
1194 strcat(ptr_arp, new_extension_arp);
1195 strcpy(out_data_arp, whole_path_copy_arp);
1201 strcpy(ptr_arp,
".");
1202 strcat(ptr_arp, new_extension_arp);
1203 strcpy(out_data_arp, whole_path_copy_arp);
1209 strcpy(ptr_arp,
".");
1210 strcat(ptr_arp, new_extension_arp);
1211 strcpy(out_data_arp, whole_path_copy_arp);
1217 strcpy(ptr_arp,
".");
1218 strcat(ptr_arp, new_extension_arp);
1219 strcpy(out_data_arp, whole_path_copy_arp);
1225 strcpy(ptr_arp,
".");
1226 strcat(ptr_arp, new_extension_arp);
1227 strcpy(out_data_arp, whole_path_copy_arp);
1233 strcpy(ptr_arp,
".");
1234 strcat(ptr_arp, new_extension_arp);
1235 strcpy(out_data_arp, whole_path_copy_arp);
1241 strcpy(ptr_arp,
".");
1242 strcat(ptr_arp, new_extension_arp);
1243 strcpy(out_data_arp, whole_path_copy_arp);
1249 strcpy(ptr_arp,
".");
1250 strcat(ptr_arp, new_extension_arp);
1251 strcpy(out_data_arp, whole_path_copy_arp);
1257 strcpy(ptr_arp,
".");
1258 strcat(ptr_arp, new_extension_arp);
1259 strcpy(out_data_arp, whole_path_copy_arp);
1265 strcpy(ptr_arp,
".");
1266 strcat(ptr_arp, new_extension_arp);
1267 strcpy(out_data_arp, whole_path_copy_arp);
1273 strcpy(ptr_arp,
".");
1274 strcat(ptr_arp, new_extension_arp);
1275 strcpy(out_data_arp, whole_path_copy_arp);
1281 strcpy(ptr_arp,
".");
1282 strcat(ptr_arp, new_extension_arp);
1283 strcpy(out_data_arp, whole_path_copy_arp);
1289 strcpy(ptr_arp,
".");
1290 strcat(ptr_arp, new_extension_arp);
1291 strcpy(out_data_arp, whole_path_copy_arp);
1297 strcpy(ptr_arp,
".");
1298 strcat(ptr_arp, new_extension_arp);
1299 strcpy(out_data_arp, whole_path_copy_arp);
1305 strcpy(ptr_arp,
".");
1306 strcat(ptr_arp, new_extension_arp);
1307 strcpy(out_data_arp, whole_path_copy_arp);
1313 strcpy(ptr_arp,
".");
1314 strcat(ptr_arp, new_extension_arp);
1315 strcpy(out_data_arp, whole_path_copy_arp);
1321 strcpy(ptr_arp,
".");
1322 strcat(ptr_arp, new_extension_arp);
1323 strcpy(out_data_arp, whole_path_copy_arp);
1329 strcpy(ptr_arp,
".");
1330 strcat(ptr_arp, new_extension_arp);
1331 strcpy(out_data_arp, whole_path_copy_arp);
1337 strcpy(ptr_arp,
".");
1338 strcat(ptr_arp, new_extension_arp);
1339 strcpy(out_data_arp, whole_path_copy_arp);
1345 strcpy(ptr_arp,
".");
1346 strcat(ptr_arp, new_extension_arp);
1347 strcpy(out_data_arp, whole_path_copy_arp);
1353 strcpy(ptr_arp,
".");
1354 strcat(ptr_arp, new_extension_arp);
1355 strcpy(out_data_arp, whole_path_copy_arp);
1361 strcpy(ptr_arp,
".");
1362 strcat(ptr_arp, new_extension_arp);
1363 strcpy(out_data_arp, whole_path_copy_arp);
1369 strcpy(ptr_arp,
".");
1370 strcat(ptr_arp, new_extension_arp);
1371 strcpy(out_data_arp, whole_path_copy_arp);
1377 strcpy(ptr_arp,
".");
1378 strcat(ptr_arp, new_extension_arp);
1379 strcpy(out_data_arp, whole_path_copy_arp);
1383 strcpy(out_data_arp, whole_path_arp);
1384 strcat(out_data_arp,
".");
1385 strcat(out_data_arp, new_extension_arp);
1390#define e_malloc malloc
1405 strcpy(path, path1);
1407 if (path[
ret - 1] !=
'\\')
1418 WCHAR *ar_temp = (
void *)malloc(r_temp);
1419 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1425 ret = GetTempFileNameW(path_w_ar, L
"BW_AR_", 0, fixo_w_ar);
1470 strcpy(path, path1);
1473 if (path[
ret - 1] !=
'\\')
1484 WCHAR *ar_temp = (
void *)malloc(r_temp);
1546 if (x[0] ==
'\\' && x[1] ==
'\\')
1551 if (tolower(x[0]) <
'a')
1557 if (tolower(x[0]) >
'z')
1563 if (tolower(x[1]) !=
':')
1573 WCHAR *ar_temp = (
void *)malloc(r_temp);
1574 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1580 if ((
int)0xffffffff != (
int)
ret)
1582 if (0x00000010 &
ret)
1635 if (x[0] ==
'\\' && x[1] ==
'\\')
1640 if (tolower(x[0]) <
'a')
1646 if (tolower(x[0]) >
'z')
1662 WCHAR *ar_temp = (
void *)malloc(r_temp);
1663 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1671 if ((
int)0xffffffff != (
int)
ret)
1673 if (
ret & (0x00000010))
1721 if (temp[
ret - 1] ==
'\\')
1728 if (temp[0] ==
'\\' && temp[1] ==
'\\')
1733 if (tolower(temp[0]) <
'a' || tolower(temp[0]) >
'z' || temp[1] !=
':')
1741 for (
i = 0;
i <
ret;
i++)
1743 if (temp[
i] ==
'\\')
1746 temp1 = temp[
i + 1];
1751 WCHAR *ar_temp = (
void *)malloc(r_temp);
1752 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1761 if (strlen(temp) != 3)
1765 strcpy(temp4, temp);
1767 temp4[strlen(temp4) - 1] = 0;
1770 temp[
i + 1] = temp1;
1776 WCHAR *ar_temp = (
void *)malloc(r_temp);
1777 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1818 for (
i = 0;
i <
ret;
i++)
1825 if (temp[
i] ==
'\\')
1828 temp1 = temp[
i + 1];
1833 WCHAR *ar_temp = (
void *)malloc(r_temp);
1834 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1843 if (strlen(temp) != 3)
1848 strcpy(temp4, temp);
1850 temp4[strlen(temp4) - 1] = 0;
1862 temp[
i + 1] = temp1;
1868 WCHAR *ar_temp = (
void *)malloc(r_temp);
1869 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1946 if (temp[
ret - 1] ==
'\\')
1953 if (temp[0] ==
'\\' && temp[1] ==
'\\')
1958 if (tolower(temp[0]) <
'a' || tolower(temp[0]) >
'z' || temp[1] !=
':')
1966 for (
i = 0;
i <
ret;
i++)
1968 if (temp[
i] ==
'\\')
1971 temp1 = temp[
i + 1];
1976 WCHAR *ar_temp = (
void *)malloc(r_temp);
1977 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
1986 if (strlen(temp) != 3)
1990 strcpy(temp4, temp);
1992 temp4[strlen(temp4) - 1] = 0;
1996 temp[
i + 1] = temp1;
2002 WCHAR *ar_temp = (
void *)malloc(r_temp);
2003 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2018 for (
i = 0;
i <
ret;
i++)
2025 if (temp[
i] ==
'\\')
2028 temp1 = temp[
i + 1];
2032 WCHAR *ar_temp = (
void *)malloc(r_temp);
2033 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2041 if (strlen(temp) != 3)
2045 strcpy(temp4, temp);
2047 temp4[strlen(temp4) - 1] = 0;
2058 temp[
i + 1] = temp1;
2063 WCHAR *ar_temp = (
void *)malloc(r_temp);
2064 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2097 for (
i = 0;
i <
ret;
i++)
2118open_output_file(
char const *file_name,
int typeflag,
__attribute__((unused)) mode_t mode,
2120 __attribute__((unused)) mode_t *current_mode_mask,
char *constructed_filename_kp)
2122 constructed_filename_kp[0] = 0;
2125 int openflag = (O_WRONLY |
O_BINARY | O_CREAT | O_TRUNC);
2129 static int conttype_diagnosed;
2131 if (!conttype_diagnosed)
2133 conttype_diagnosed = 1;
2135 pedro_dprintf(2,
"Extracting contiguous files as regular files");
2136 printf(
"Extracting contiguous files as regular files");
2145 strcat(destination_file_kp, file_name);
2147 assert(
'\\' != file_name[strlen(file_name) - 1]);
2149 assert(strlen(path_to_create_kp) != strlen(destination_file_kp));
2151 strcpy(constructed_filename_kp, destination_file_kp);
2154 WCHAR *ar_temp = (
void *)malloc(r_temp);
2155 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2168 sprintf(
warning_info,
"Cannot open file %s to write", file_name);
2198open_output_file_VAL(
char const *file_name,
2206 constructed_filename_kp[0] = 0;
2209 int openflag = (O_WRONLY |
O_BINARY | O_CREAT | O_TRUNC);
2215 memset(destination_file_kp, 0,
sizeof(destination_file_kp));
2216 memset(path_to_create_kp, 0,
sizeof(path_to_create_kp));
2219 strcat(destination_file_kp, file_name);
2221 assert(
'\\' != file_name[strlen(file_name) - 1]);
2223 assert(strlen(path_to_create_kp) != strlen(destination_file_kp));
2225 strcpy(constructed_filename_kp, destination_file_kp);
2229 WCHAR *ar_temp = (
void *)malloc(r_temp);
2230 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2231 if (!SetFileAttributesW(
2243 WCHAR *ar_temp = (
void *)malloc(r_temp);
2244 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2246 openflag, _S_IWRITE);
2251 pedro_dprintf(-1,
"val %d abrindo arquivo com perm %s\n", fd, destination_file_kp);
2261 sprintf(
warning_info,
"Cannot open file %s to write", file_name);
2298 int64_t filesize_arp_b;
2299 char buffer_arp[300];
2309 WCHAR *ar_temp = (
void *)malloc(r_temp);
2310 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2318 len_arp = fread(&
ret_arp_, 1, 4, amanda_file);
2332 len_arp = fread(buffer_arp, 1, 64, amanda_file);
2337 len_arp = fread(&filesize_arp_b, 1, 8, amanda_file);
2342 if (filesize_arp == (filesize_arp_b + 4 + 64 + 8))
2351 case 0x706c6176 - 1:
2355 case 0x706c6176 - 2:
2359 case 0x706c6176 - 3:
2363 case 0x706c6176 - 4:
2367 case 0x706c6176 - 5:
2372 fclose(amanda_file);
2378 else if ((0x706c6176 - 6) ==
ret_arp_ ||
2388 case 0x706c6176 - 6:
2393 case 0x706c6176 - 7:
2398 case 0x706c6176 - 8:
2403 case 0x706c6176 - 9:
2408 case 0x706c6176 - 10:
2413 case 0x706c6176 - 11:
2418 fclose(amanda_file);
2423 fclose(amanda_file);
2429#define ARCHIVE_LITERAL_LL(x) x##ll
2430#define ARCHIVE_LITERAL_ULL(x) x##ull
2431#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000)
2432#define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME) + \
2433 (((nsec) / 1000) * 10))
2436 struct timeval times[2];
2437 ULARGE_INTEGER wintm;
2439 SYSTEMTIME l_amanda_fmtime;
2441 times[0].tv_sec = a_m;
2442 times[0].tv_usec = b_m;
2444 wintm.QuadPart =
WINTIME(times[0].tv_sec , times[0].tv_usec);
2447 memset(smtime, 0,
sizeof(SYSTEMTIME));
2448 FileTimeToSystemTime(
2452 SystemTimeToTzSpecificLocalTime(
NULL, &l_amanda_fmtime, smtime);
2466extract_file(
char *file_name_in_arp,
int typeflag)
2468 __int64 value_for_ftell = 0;
2476 time_t mtime_tv_sec_arp = 0;
2477 union block *data_block;
2483 strcpy(
error_message_k,
"Path above limit of 32767 characters, aborting...");
2488 strcpy(file_name, file_name_in_arp);
2492 int file_created = 0;
2497 fd = open_output_file(file_name, typeflag, mode,
2499 NULL, constructed_filename_kp);
2533 if (written > (
size_t)
size)
2540 if (count != written)
2559 struct _utimbuf ut = { 0 };
2572 strcpy(temp_file_arp, constructed_filename_kp);
2573 strcat(temp_file_arp,
".$_$arp.tmp");
2586 WCHAR *ar_temp = (
void *)malloc(r_temp);
2587 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2596 WCHAR *ar_temp = (
void *)malloc(r_temprr1);
2597 WCHAR *ar_temp2 = (
void *)malloc(r_temprr1);
2599 WCHAR *ar_temp3 = (
void *)malloc(r_temprr2);
2600 WCHAR *ar_temp4 = (
void *)malloc(r_temprr2);
2614 WCHAR *ar_temp = (
void *)malloc(r_temp);
2615 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2625 WCHAR *ar_temp = (
void *)malloc(r_temp);
2626 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2642 WCHAR *ar_temp = (
void *)malloc(r_temp);
2643 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2653 WCHAR *ar_temp = (
void *)malloc(r_temp);
2654 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2677 SYSTEMTIME l_amanda_fmtime = {0};
2679 (void)l_amanda_fmtime;
2704 WCHAR *ar_temp = (
void *)malloc(r_temp);
2705 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2708 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
2711 FILE_FLAG_BACKUP_SEMANTICS,
2717 if (INVALID_HANDLE_VALUE != hFile)
2719 SetFileTime(hFile, &ftime,
NULL, &ftime);
2724 pedro_dprintf(2,
"%s: Cannot set filetime on folder\n", file_name);
2756extract_file_VAL(
char *file_name_in_arp)
2759 const uint64_t TAMANHO_AMANDA = (1 << 16) * 8;
2762 char *buffer_arp =
NULL;
2766 __time64_t mtime_tv_sec_arp;
2767 __int64 value_for_ftell;
2776 memset(file_name, 0,
sizeof(file_name));
2783 strcpy(file_name, file_name_in_arp);
2786 int file_created = 0;
2791 fd = open_output_file_VAL(file_name, 0, mode,
2793 NULL, constructed_filename_kp);
2808 value_for_ftell = 0;
2817 buffer_arp = malloc(TAMANHO_AMANDA);
2832 uint64_t result =
min((
int)10000,
a);
2859 len_arp = fread(buffer_arp, 1, (
int)(
min(TAMANHO_AMANDA, remaining_arp)),
decoder_file_z);
2911 if ((
int)count != (
int)len_arp)
2917 remaining_arp -= len_arp;
2935 strcpy(temp_file_arp, constructed_filename_kp);
2936 strcat(temp_file_arp,
".$_$arp.tmp");
2948 WCHAR *ar_temp = (
void *)malloc(r_temp);
2949 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2959 WCHAR *ar_temp = (
void *)malloc(r_temprr1);
2960 WCHAR *ar_temp2 = (
void *)malloc(r_temprr1);
2962 WCHAR *ar_temp3 = (
void *)malloc(r_temprr2);
2963 WCHAR *ar_temp4 = (
void *)malloc(r_temprr2);
2978 WCHAR *ar_temp = (
void *)malloc(r_temp);
2979 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
2989 WCHAR *ar_temp = (
void *)malloc(r_temp);
2990 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
3006 WCHAR *ar_temp = (
void *)malloc(r_temp);
3007 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
3016 WCHAR *ar_temp = (
void *)malloc(r_temp);
3017 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
3063 WCHAR *ar_temp = (
void *)malloc(r_temp);
3064 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
3068 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
3071 FILE_FLAG_BACKUP_SEMANTICS,
3077 if (INVALID_HANDLE_VALUE != hFile)
3089 SetFileTime(hFile, &ftime_in,
NULL, &ftime_in);
3094 pedro_dprintf(2,
"%s: Cannot set filetime on file\n", file_name);
3102 WCHAR *ar_temp = (
void *)malloc(r_temp);
3103 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
3107 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
3110 FILE_FLAG_BACKUP_SEMANTICS,
3117 if (INVALID_HANDLE_VALUE != hFile)
3127 pedro_dprintf(2,
"%s: Cannot set filetime on file\n", file_name);
3132 WCHAR *ar_temp = (
void *)malloc(r_temp);
3133 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
3134 if (!SetFileAttributesW(
3183prepare_to_extract(
char const *file_name,
int typeflag,
tar_extractor_t *fun)
3189 *fun = extract_file;
3200 *fun = extract_file;
3206 *fun = extract_skip;
3210 *fun = extract_skip;
3216 *fun = extract_skip;
3222 *fun = extract_skip;
3226#if HAVE_MKFIFO || defined mkfifo
3228 *fun = extract_skip;
3238 *fun = extract_skip;
3244 *fun = extract_skip;
3252 *fun = extract_failure;
3257 pedro_dprintf(2,
"%s: Unknown file type '%c', extracted as normal file", file_name, typeflag);
3259 *fun = extract_file;
3278 if (p[0] ==
'.' && p[1] ==
'.' && (
ISSLASH(p[2]) || !p[2]))
3298 bool skip_dotdot_name;
3305 if (skip_dotdot_name)
#define FILE_ATTRIBUTE_ARCHIVE
Definition 7zTypes.h:147
#define wcscpy
Definition SfxSetup.c:32
#define AMANDA__SIZE
Definition arp.h:149
@ ARP_RC4
Definition arp.h:200
@ ARP_SERPENT
Definition arp.h:202
@ ARP_RC4_MT
Definition arp.h:212
@ ARP_SERPENT_MT
Definition arp.h:214
@ ARP_AES
Definition arp.h:198
@ ARP_TWOFISH
Definition arp.h:208
@ ARP_RC6
Definition arp.h:206
@ ARP_MARS
Definition arp.h:204
@ ARP_MARS_MT
Definition arp.h:216
@ ARP_AES_MT
Definition arp.h:210
@ ARP_TWOFISH_MT
Definition arp.h:220
@ ARP_RC6_MT
Definition arp.h:218
wchar_t * permissive_name_m_(const wchar_t *wname, WCHAR *ar_temp)
Definition tar_1_33.c:279
int size_of_WCHAR_mem_r(char *in_string)
Definition tar_1_33.c:694
#define AMANDA__SIZE_ww
Definition be_xml.c:64
void pedro_dprintf(int amanda_level, char *format,...)
Definition pedro.c:43
WCHAR * amanda_asciitowide_1_(char *pUTF8, WCHAR *ar_temp)
Definition tar_1_33.c:677
#define assert(condition)
Definition lz4.c:273
#define __attribute__(unused_ric_since_2004)
Definition main_cr.c:84
__int64 getfilesize_ar(char *infile_ar)
Definition tar_1_33.c:2432
mode
Definition automated_benchmarking.py:304
#define O_BINARY
Definition compress42.c:385
#define min(a, b)
Definition compress42.c:304
void yasmin_charlotte_pereira_dprintf(int amanda_level, char *format,...)
Definition pedro.c:35
size_t blocking_write(int fd, void const *buf, size_t count)
Definition sparse_2_k.c:3423
#define FILE_SYSTEM_PREFIX_LEN(P)
Definition sparse_2_k.c:109
enum dump_status sparse_extract_file(int fd, struct tar_stat_info *st, off_t *size)
Definition sparse_2_k.c:2742
void skip_file(off_t size)
Definition tar_1_33.c:4709
#define ISSLASH(C)
Definition sparse_2_k.c:110
bool sparse_member_p(struct tar_stat_info *st)
Definition sparse_2_k.c:2869
DWORD dwHighDateTime
Definition 7zMain.c:326
DWORD dwLowDateTime
Definition 7zMain.c:325
bool dont_t_free_now_dl
Definition arp.h:175
DWORD VAL_attributes
Definition arp.h:162
time_t VAL_timestamp
Definition arp.h:171
int64_t VAL_file_size
Definition arp.h:170
bool Val_is_using_filetime
Definition arp.h:155
FILETIME LastWriteTime__junior
Definition arp.h:165
FILETIME CreationTime___junior
Definition arp.h:163
FILETIME LastAccessTime_junior
Definition arp.h:164
__time64_t VAL_timestamp64
Definition arp.h:154
int VAL_is_encrypted
Definition arp.h:168
bool had_trailing_slash
Definition tar.h:291
char * file_name
Definition tar.h:289
struct _stat stat
Definition tar.h:306
bool is_sparse
Definition tar.h:317
char * orig_file_name
Definition tar.h:288
struct timespec mtime
Definition tar.h:311
#define DIRTYPE
Definition tar.h:57
#define BLKTYPE
Definition tar.h:56
#define CONTTYPE
Definition tar.h:59
#define CHRTYPE
Definition tar.h:55
#define FIFOTYPE
Definition tar.h:58
#define GNUTYPE_MULTIVOL
Definition tar.h:181
#define GNUTYPE_DUMPDIR
Definition tar.h:172
#define GNUTYPE_LONGLINK
Definition tar.h:175
#define GNUTYPE_SPARSE
Definition tar.h:184
#define REGTYPE
Definition tar.h:51
#define GNUTYPE_LONGNAME
Definition tar.h:178
#define LNKTYPE
Definition tar.h:53
#define SYMTYPE
Definition tar.h:54
#define GNUTYPE_VOLHDR
Definition tar.h:187
#define AREGTYPE
Definition tar.h:52
#define __amandacall
Definition tar_1_33.c:79
char the_pass_arp[1024+1]
Definition tar_1_33.c:804
wchar_t * permissive_name_m_v27(const wchar_t *wname, WCHAR *ar_temp)
copy of permissive_name_m_, because in some API calls you need to conversions to a wide path this is ...
Definition tar_1_33.c:376
bool extract_cancel_flag
Definition tar_1_33.c:629
FILE * decoder_file_z
Definition tar_1_33.c:556
void set_next_block_after(union block *block)
Definition tar_1_33.c:5178
#define GLOBAL
Definition tar_1_33.c:3287
void add_more_one_is_amanda_update_(char *filename_k_ar, __int64 size_of_file_arp, time_t mtime_tv_sec_arp, int is_directory_arp, __int64 position_on_file_arp, DWORD VAL_attributes, int VAL_is_encrypted, __time64_t VAL_timestamp64, VAL_data *VAL_data__arp)
Definition tar_1_33.c:1977
char extract_folder_final[AMANDA__SIZE]
Definition tar_1_33.c:3184
char encryption_format_S2_[300]
Definition tar_1_33.c:124
int decrypt_arp(char *inputfile, char *outputfile, char *key, int64_t *the_arp_file_size, char *encryption_method_i, int *cores_S2)
Definition tar_1_33.c:1471
@ AAKP_EXTRACT_PROCESS
Definition tar_1_33.c:2111
size_t available_space_after(union block *pointer)
Definition tar_1_33.c:5169
int ret_arp_
Definition tar_1_33.c:592
void mv_begin_read(struct tar_stat_info *st)
Definition tar_1_33.c:4751
tar_list_function_ar my_func_ar_
Definition tar_1_33.c:2947
char * valquiria_wide_to_utf8(WCHAR *pUSC2_maria, char *ar_temp_char)
Definition tar_1_33.c:766
char error_message_k[AMANDA__SIZE]
Definition tar_1_33.c:176
int cores_used_z
Definition tar_1_33.c:157
bool extract_pause__flag
Definition tar_1_33.c:628
bool mode_is_update_arp
Definition tar_1_33.c:636
int our_update_file_open__arp
Definition tar_1_33.c:641
GLOBAL struct tar_stat_info current_stat_info
Definition tar_1_33.c:3295
union block * find_next_block(void)
Definition tar_1_33.c:6798
void mv_end(void)
Definition tar_1_33.c:4691
wchar_t * remove_permissive_name_m_(wchar_t *wname, WCHAR *ar_temp)
as the name says it will convert a wide characters (up to 32767 characters) path to a standard path (...
Definition tar_1_33.c:236
void skip_member(void)
Definition tar_1_33.c:4761
int got_a_warning_ar
Definition tar_1_33.c:2400
void update_progress_arp(int64_t *bytes_read_arp__)
Definition tar_1_33.c:1418
union block * current_header
Definition tar_1_33.c:3201
char extracting_filename_ar[AMANDA__SIZE]
Definition tar_1_33.c:2405
char warning_info[AMANDA__SIZE]
Definition tar_1_33.c:2406
void mv_size_left(off_t size)
Definition tar_1_33.c:4699
char encryption_method__i[300]
Definition tar_1_33.c:138
VAL_data my_VAL_data_arp
Definition tar_1_33.c:587
WCHAR * amanda_utf8towide_2_(char *pUTF8, WCHAR *ar_temp)
Definition tar_1_33.c:729
char creating_folder_maria[AMANDA__SIZE]
Definition tar_1_33.c:649
int fatal_exit_k
Definition tar_1_33.c:3217
struct posix_header header
Definition tar.h:375
char buffer[BLOCKSIZE]
Definition tar.h:374
__int64 _telli64(int handle)
int __stdcall status(int newvalue)
Definition bzip2dll.c:513
#define SEEK_CUR
Definition zconf.h:499
#define s1(x)
Definition Sha256.c:142
#define a(i)
Definition sha256.c:41
lzma_index ** i
Definition index.h:629
#define NULL
Definition getopt1.c:37
char name[NAME_LEN_MAX+1]
Name of the filter.
Definition string_conversion.c:450
const char * str
Table column heading string.
Definition list.c:109
signature_z[3]
Definition zlib_interface.c:37
ret
Definition zlib_interface.c:30