From ae377ae8cafea7a5454d1b1b0b0966bbf1f4b6f4 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 25 Jun 2022 11:45:15 +0200 Subject: [PATCH 1/2] [iso] fix support for multi-extent files when Joliet is in use * See https://lists.gnu.org/archive/html/libcdio-devel/2022-06/msg00000.html * This partially fixes ISO mode support for Gentoo Live, though, since the Gentoo maintainers appear not to have a kernel NTFS driver in the current images, the installer still fails to mount the installation media. --- src/libcdio/iso9660/iso9660_fs.c | 88 ++++++++++++++++++++++++-------- src/rufus.rc | 10 ++-- 2 files changed, 73 insertions(+), 25 deletions(-) diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 079b3b03..bb896a53 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -795,6 +795,49 @@ _iso9660_is_rock_ridge_enabled(void* p_image) return true; } +/*! + Convert a directory record name to a 0-terminated string. + One of parameters alloc_result and cpy_result should be non-NULL to take + the result. +*/ +static bool +_iso9660_recname_to_cstring(const char *src, size_t src_len, + cdio_utf8_t **alloc_result, + cdio_utf8_t *cpy_result, uint8_t u_joliet_level) +{ +#ifdef HAVE_JOLIET + if (u_joliet_level) { + int i_inlen = src_len; + cdio_utf8_t *p_psz_out = NULL; + + if (cdio_charset_to_utf8(src, i_inlen, &p_psz_out, "UCS-2BE")) { + if (cpy_result != NULL) + strcpy(cpy_result, p_psz_out); + if (alloc_result != NULL) + *alloc_result = p_psz_out; + else + free(p_psz_out); + } else { + return false; + } + } else +#endif /*HAVE_JOLIET*/ + { + if (alloc_result != NULL) { + *alloc_result = calloc(1, src_len + 1); + if (*alloc_result == NULL) + return false; + strncpy(*alloc_result, src, src_len); + (*alloc_result)[src_len] = 0; + } + if (cpy_result != NULL) { + strncpy(cpy_result, src, src_len); + cpy_result[src_len] = 0; + } + } + return true; +} + static iso9660_stat_t * _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, iso9660_stat_t *last_p_stat, @@ -868,8 +911,17 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) { /* Check if this is the last part of a multiextent file */ if (!first_extent) { - if (strlen(p_stat->filename) != i_fname || - strncmp(p_stat->filename, &p_iso9660_dir->filename.str[1], i_fname) != 0) { + cdio_utf8_t *p_psz_out = NULL; + int bad_multi; + int i_inlen = i_fname; + + if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1], + i_inlen, &p_psz_out, NULL, + u_joliet_level)) + goto fail; + bad_multi = (strcmp(p_stat->filename, p_psz_out) != 0); + free(p_psz_out); + if (bad_multi) { cdio_warn("Non consecutive multiextent file parts for '%s'", p_stat->filename); goto fail; @@ -895,30 +947,26 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, } strncpy(p_stat->filename, rr_fname, i_rr_fname+1); } else { - if ('\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname) + if ('\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname) { strncpy (p_stat->filename, ".", strlen(".")+1); - else if ('\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname) + } else if ('\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname) { strncpy (p_stat->filename, "..", strlen("..")+1); -#ifdef HAVE_JOLIET - else if (u_joliet_level) { + } else { int i_inlen = i_fname; - cdio_utf8_t *p_psz_out = NULL; - if (cdio_charset_to_utf8(&p_iso9660_dir->filename.str[1], i_inlen, - &p_psz_out, "UCS-2BE")) { - strncpy(p_stat->filename, p_psz_out, i_fname); - free(p_psz_out); - } else { - goto fail; - } - } -#endif /*HAVE_JOLIET*/ - else { - strncpy (p_stat->filename, &p_iso9660_dir->filename.str[1], i_fname); + + if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1], + i_inlen, NULL, p_stat->filename, + u_joliet_level)) + goto fail; } } } else { - /* Use the plain ISO-9660 name when dealing with a multiextent file part */ - strncpy(p_stat->filename, &p_iso9660_dir->filename.str[1], i_fname); + int i_inlen = i_fname; + + if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1], + i_inlen, NULL, p_stat->filename, + u_joliet_level)) + goto fail; } iso9660_get_dtime(&(p_iso9660_dir->recording_time), true, &(p_stat->tm)); diff --git a/src/rufus.rc b/src/rufus.rc index 202968cb..b7378c13 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.19.1907" +CAPTION "Rufus 3.19.1908" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,19,1907,0 - PRODUCTVERSION 3,19,1907,0 + FILEVERSION 3,19,1908,0 + PRODUCTVERSION 3,19,1908,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.19.1907" + VALUE "FileVersion", "3.19.1908" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.19.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.19.1907" + VALUE "ProductVersion", "3.19.1908" END END BLOCK "VarFileInfo" From 6c8432ebf6d6fc3e31bbd7b227657d2f877ac5f2 Mon Sep 17 00:00:00 2001 From: Marcos Mello Date: Tue, 28 Jun 2022 00:14:52 +0100 Subject: [PATCH 2/2] [loc] update Brazilian Portuguese translation to latest * Closes #1948 --- res/loc/po/pt-BR.po | 18 +++++++++--------- res/loc/rufus.loc | 16 ++++++++-------- src/rufus.rc | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/res/loc/po/pt-BR.po b/res/loc/po/pt-BR.po index a544b2ee..3308aa18 100644 --- a/res/loc/po/pt-BR.po +++ b/res/loc/po/pt-BR.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: 3.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" "POT-Creation-Date: 2022-06-07 16:25+0100\n" -"PO-Revision-Date: 2022-06-07 16:28+0100\n" +"PO-Revision-Date: 2022-06-27 23:47+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: pt_BR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Portuguese Brazilian (Português do Brasil)\n" "X-Rufus-LCID: 0x0416\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.1\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -348,14 +348,14 @@ msgstr "BIOS ou UEFI" #. #. Number of bad block check passes (singular for 1 pass) msgid "%d pass" -msgstr "%d passo" +msgstr "%d passada" #. • MSG_035 #. #. Number of bad block check passes (plural for 2 or more passes). #. See MSG_087 for the message that %s gets replaced with. msgid "%d passes %s" -msgstr "%d passa %s" +msgstr "%d passadas %s" #. • MSG_036 msgid "ISO Image" @@ -603,11 +603,11 @@ msgstr "para %s NAND" #. • MSG_088 msgid "Image is too big" -msgstr "Imagem ISO muito grande" +msgstr "Imagem é muito grande" #. • MSG_089 msgid "The image is too big for the selected target." -msgstr "A imagem ISO é muito grande para o destino selecionado." +msgstr "A imagem é muito grande para o destino selecionado." #. • MSG_090 msgid "Unsupported ISO" @@ -1162,13 +1162,13 @@ msgstr "Drive incompatível detectado" #. #. Used in MSG_235 msgid "Write pass" -msgstr "Passo de gravação" +msgstr "Verificação de escrita" #. • MSG_192 #. #. Used in MSG_235 msgid "Read pass" -msgstr "Passo de leitura" +msgstr "Verificação de leitura" #. • MSG_193 msgid "Downloaded %s" @@ -1770,7 +1770,7 @@ msgstr "Múltiplos botões" #. • MSG_316 msgid "Number of passes" -msgstr "Número de passes" +msgstr "Número de passadas" #. • MSG_317 msgid "Disk ID" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index bb5826fc..870127a9 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -9597,8 +9597,8 @@ t MSG_030 "%s (Padrão)" t MSG_031 "BIOS (ou UEFI-CSM)" t MSG_032 "UEFI (não CSM)" t MSG_033 "BIOS ou UEFI" -t MSG_034 "%d passo" -t MSG_035 "%d passa %s" +t MSG_034 "%d passada" +t MSG_035 "%d passadas %s" t MSG_036 "Imagem ISO" t MSG_037 "Aplicativo" t MSG_038 "Abortar" @@ -9651,8 +9651,8 @@ t MSG_084 "Parece que esta imagem ISO usa uma versão obsoleta do arquivo '%s'.\ t MSG_085 "Baixando %s" t MSG_086 "Nenhuma imagem ISO foi selecionada" t MSG_087 "para %s NAND" -t MSG_088 "Imagem ISO muito grande" -t MSG_089 "A imagem ISO é muito grande para o destino selecionado." +t MSG_088 "Imagem é muito grande" +t MSG_089 "A imagem é muito grande para o destino selecionado." t MSG_090 "ISO não suportada" t MSG_091 "Quando se usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis do tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS." t MSG_092 "Sistema de arquivos não suportado" @@ -9752,8 +9752,8 @@ t MSG_187 "Imagem inválida para a opção de inicialização selecionada" t MSG_188 "A imagem atual não combina com a opção de inicialização selecionada. Por favor, use uma imagem diferente ou escolha uma opção de inicialização diferente." t MSG_189 "Esta imagem ISO não é compatível com o sistema de arquivos selecionado" t MSG_190 "Drive incompatível detectado" -t MSG_191 "Passo de gravação" -t MSG_192 "Passo de leitura" +t MSG_191 "Verificação de escrita" +t MSG_192 "Verificação de leitura" t MSG_193 "Baixado(s) %s" t MSG_194 "Não foi possível baixar %s" t MSG_195 "Usando a versão incorporada do(s) arquivo(s) %s" @@ -9866,7 +9866,7 @@ t MSG_303 "Exibir o registro" t MSG_304 "Criar uma imagem do dispositivo selecionado" t MSG_305 "Use esta opção caso queira instalar o Windows neste dispositivo ou em outro, ou se deseja rodar o Windows direto deste dispositivo (Windows To Go)." t MSG_306 "Modo expresso de zerar o disco: %s" -t MSG_307 "Isso pode demorar um pouco" +t MSG_307 "isso pode demorar um pouco" t MSG_308 "Detecção de VHD" t MSG_309 "Arquivo comprimido" t MSG_310 "O ISO que você selecionou usa UEFI e é pequeno o suficiente para ser escrito como uma partição do sistema EFI (ESP). Escrever para uma ESP, em vez de escrever para uma partição genérica de dados que ocupa o disco todo, pode ser preferível para alguns tipos de instalações.\n\nPor favor, selecione o modo que pretende utilizar para escrever esta imagem:" @@ -9875,7 +9875,7 @@ t MSG_312 "Hashes extra (SHA512)" t MSG_313 "Salvar em VHD" t MSG_314 "Calcular cheksums da imagem" t MSG_315 "Múltiplos botões" -t MSG_316 "Número de passes" +t MSG_316 "Número de passadas" t MSG_317 "ID do Disco" t MSG_318 "Prioridade padrão da thread: %d" t MSG_319 "Ignorar marcador de inicialização" diff --git a/src/rufus.rc b/src/rufus.rc index b7378c13..075df05d 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.19.1908" +CAPTION "Rufus 3.19.1909" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,19,1908,0 - PRODUCTVERSION 3,19,1908,0 + FILEVERSION 3,19,1909,0 + PRODUCTVERSION 3,19,1909,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.19.1908" + VALUE "FileVersion", "3.19.1909" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.19.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.19.1908" + VALUE "ProductVersion", "3.19.1909" END END BLOCK "VarFileInfo"