Skip to content

Commit 446e71f

Browse files
committed
[dbx] fix UTC epoch being interpreted as local time for DBX timestamp comparison
* Per MS documentation, _mktime64() *ALTERS* the time being passed to first add/substract the timezone offset before converting to an epoch. * This resulted in our evaluated epoch from the DBX GitHub commit being a few hours more recent than the epoch we store for our embedded files (which is UTC) for timezones that are behind of UTC, since their epoch have an offset added to convert localtime to UTC. * Fix this by using _mkgmtime64() that does not suffer an unwanted time manipulation. * For safety, also use -u for epoch format conversion in our script just in case. * Closes #2762. * Also comment the "unsupported check; not verifying file integrity" warning for XZ decompression, improve XZ ARM64 support and add an exception for some Samsung UFDs.
1 parent 94a2c7c commit 446e71f

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

res/dbx/dbx_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ get_commit_date() {
99
if [[ "${url}" =~ ^"${github_url}" ]]; then
1010
parts=($(awk -F'contents/' '{ for(i=1;i<=NF;i++) print $i }' <<< ${url}))
1111
date_url="${parts[0]}commits?path=${parts[1]//\//%2F}&page=1&per_page=1"
12-
epoch="$(curl -s -L ${date_url} | python -m json.tool | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -f - +%s)"
12+
epoch="$(curl -s -L ${date_url} | python -m json.tool | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -u -f - +%s)"
1313
fi
1414
echo ${epoch:-0}
1515
}

src/bled/decompress_unxz.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#include "bb_archive.h"
1212

1313
#define XZ_EXTERN static
14-
// We get XZ_OPTIONS_ERROR in xz_dec_stream if this is not defined
15-
#define XZ_DEC_ANY_CHECK
16-
1714
#define XZ_BUFSIZE BB_BUFSIZE
1815

1916
#include "xz_dec_bcj.c"
@@ -89,7 +86,7 @@ IF_DESKTOP(long long) int FAST_FUNC unpack_xz_stream(transformer_state_t *xstate
8986

9087
#ifdef XZ_DEC_ANY_CHECK
9188
if (ret == XZ_UNSUPPORTED_CHECK) {
92-
bb_error_msg("unsupported check; not verifying file integrity");
89+
// bb_error_msg("unsupported check; not verifying file integrity");
9390
continue;
9491
}
9592
#endif

src/bled/xz_config.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@
1010
#ifndef XZ_CONFIG_H
1111
#define XZ_CONFIG_H
1212

13+
// We get XZ_OPTIONS_ERROR in xz_dec_stream if this is not defined
14+
#define XZ_DEC_ANY_CHECK
15+
1316
/* Uncomment as needed to enable BCJ filter decoders. */
17+
#if defined(_M_AMD64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__)
1418
#define XZ_DEC_X86
19+
#endif
1520
/* #define XZ_DEC_POWERPC */
1621
/* #define XZ_DEC_IA64 */
17-
/* #define XZ_DEC_ARM */
22+
#if defined (_M_ARM) || defined(__arm__) || defined (_M_ARM64) || defined(__aarch64__)
23+
#define XZ_DEC_ARM
24+
#endif
1825
/* #define XZ_DEC_ARMTHUMB */
1926
/* #define XZ_DEC_SPARC */
2027

src/dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save)
419419
//#define FORCED_DEVICE
420420
#ifdef FORCED_DEVICE
421421
#define FORCED_VID 0x04E8
422-
#define FORCED_PID 0x61ED
423-
#define FORCED_NAME "Samsung uSD Card Reader USB Device"
422+
#define FORCED_PID 0x6300
423+
#define FORCED_NAME "Samsung Type-C USB Device"
424424
#endif
425425

426426
void ClearDrives(void)
@@ -929,7 +929,7 @@ BOOL GetDevices(DWORD devnum)
929929
((score = IsHDD(drive_index, (uint16_t)props.vid, (uint16_t)props.pid, buffer)) > 0)) {
930930
uprintf("Device eliminated because it was detected as a Hard Drive (score %d > 0)", score);
931931
if (!list_non_usb_removable_drives)
932-
uprintf("If this device is not a Hard Drive, please e-mail the author of this application");
932+
uprintf("If this device is not a Hard Drive or SSD, please e-mail the author of this application");
933933
uprintf("NOTE: You can enable the listing of Hard Drives under 'advanced drive properties'");
934934
safe_free(devint_detail_data);
935935
break;

src/hdd_vs_ufd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static vidpid_score_t vidpid_score[] = {
250250
{ 0x04e8, 0x0101, -20 }, // Connect3D Flash Drive
251251
{ 0x04e8, 0x1a23, -20 }, // 2 GB UFD
252252
{ 0x04e8, 0x5120, -20 }, // 4 GB UFD
253+
{ 0x04e8, 0x6300, -20 }, // 256 GB UFD (MUF-256DA/APC)
253254
{ 0x04e8, 0x6818, -20 }, // 8 GB UFD
254255
{ 0x04e8, 0x6845, -20 }, // 16 GB UFD
255256
{ 0x04e8, 0x685E, -20 }, // 16 GB UFD

src/net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static void CheckForDBXUpdates(int verbose)
493493
continue;
494494
t.tm_year -= 1900;
495495
t.tm_mon -= 1;
496-
timestamp = _mktime64(&t);
496+
timestamp = _mkgmtime64(&t);
497497
vuprintf("DBX update timestamp is %" PRId64, timestamp);
498498
static_sprintf(reg_name, "DBXTimestamp_%s", efi_archname[i + 1]);
499499
// Check if we have an external DBX that is newer than embedded/last downloaded

src/rufus.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
3333
IDD_DIALOG DIALOGEX 12, 12, 232, 326
3434
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
3535
EXSTYLE WS_EX_ACCEPTFILES
36-
CAPTION "Rufus 4.10.2259"
36+
CAPTION "Rufus 4.10.2260"
3737
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
3838
BEGIN
3939
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@@ -407,8 +407,8 @@ END
407407
//
408408

409409
VS_VERSION_INFO VERSIONINFO
410-
FILEVERSION 4,10,2259,0
411-
PRODUCTVERSION 4,10,2259,0
410+
FILEVERSION 4,10,2260,0
411+
PRODUCTVERSION 4,10,2260,0
412412
FILEFLAGSMASK 0x3fL
413413
#ifdef _DEBUG
414414
FILEFLAGS 0x1L
@@ -426,13 +426,13 @@ BEGIN
426426
VALUE "Comments", "https://rufus.ie"
427427
VALUE "CompanyName", "Akeo Consulting"
428428
VALUE "FileDescription", "Rufus"
429-
VALUE "FileVersion", "4.10.2259"
429+
VALUE "FileVersion", "4.10.2260"
430430
VALUE "InternalName", "Rufus"
431431
VALUE "LegalCopyright", "� 2011-2025 Pete Batard (GPL v3)"
432432
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
433433
VALUE "OriginalFilename", "rufus-4.10.exe"
434434
VALUE "ProductName", "Rufus"
435-
VALUE "ProductVersion", "4.10.2259"
435+
VALUE "ProductVersion", "4.10.2260"
436436
END
437437
END
438438
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)