Commit 208ca071 authored by Jonathan Vollebregt's avatar Jonathan Vollebregt Committed by Alexandre Julliard

reg: Add sane_path function to do preliminary key validation.

parent b7664e60
......@@ -11522,7 +11522,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "خطأ : معاملات سطر الاوامر غير سليمة\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "خطأ : تعذر إضافة المفاتيح للجهاز البعيد\n"
#: reg.rc:38
......
......@@ -11347,7 +11347,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11747,7 +11747,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Error: Paràmetres de línia d'ordres no vàlids\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Error: No es pot afegir els claus a un equip remot\n"
#: reg.rc:38
......
......@@ -11398,7 +11398,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Chyba: Neplatné parametry příkazové řádky\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Chyba: Nepodařilo se přidat klíče na vzdálený stroj\n"
#: reg.rc:38
......
......@@ -11655,7 +11655,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Fejl: Ugyldige kommando linje parametre\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Fejl: Kunne ikke tilføje nøgler til fjern maskinen\n"
#: reg.rc:38
......
......@@ -11577,7 +11577,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Fehler: Ungültige Befehlszeilenargumente\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Fehler: Konnte Schlüssel nicht zum Remoterechner hinzufügen\n"
#: reg.rc:38
......
......@@ -11141,7 +11141,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11500,8 +11500,8 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Error: Invalid command line parameters\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgstr "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Error: Unable to access remote machine\n"
#: reg.rc:38
msgid ""
......
......@@ -11500,8 +11500,8 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Error: Invalid command line parameters\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgstr "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Error: Unable to access remote machine\n"
#: reg.rc:38
msgid ""
......
......@@ -11033,7 +11033,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11735,7 +11735,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Error: parámetros de línea de comandos inválidos\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Error: No se puede agregar claves al equipo remoto\n"
#: reg.rc:38
......
......@@ -11140,7 +11140,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11486,7 +11486,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Virhe: Viallisia komentoriviparametreja\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Virhe: Etäkoneelle ei voitu lisätä avaimia\n"
#: reg.rc:38
......
......@@ -11642,7 +11642,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Erreur : paramètre de ligne de commande invalide\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Erreur : impossible d'ajouter des clés à une machine distante\n"
#: reg.rc:38
......
......@@ -11716,7 +11716,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Error: Invalid command line parameters\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Error: Unable to add keys to remote machine\n"
#: reg.rc:38
......
......@@ -10953,7 +10953,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11218,7 +11218,7 @@ msgstr ""
"Greška: uneseni su nepoznati ili neispravni parametri naredbene linije\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11659,7 +11659,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Hiba: Érvénytelen parancssor paraméterek\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Hiba: nem lehet kulcsokat hozzáadni a távoli gépnél\n"
#: reg.rc:38
......
......@@ -11736,7 +11736,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Errore: parametri della linea di comando non validi\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Errore: impossibile aggiungere chiavi alla macchina remota\n"
#: reg.rc:38
......
......@@ -11492,7 +11492,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "エラー: コマンド ライン引数が無効です\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "エラー: リモート マシンにキーを追加できませんでした\n"
#: reg.rc:38
......
......@@ -11546,7 +11546,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "오류:올바르지 않은 명령라인 매개변수\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "오류: 원격 머신에 키를 더하는 것은 가능하지 않습니다\n"
#: reg.rc:38
......
......@@ -11507,7 +11507,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Klaida: Netinkami komandos eilutės parametrai\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Klaida: Negalima pridėti raktų nuotoliniame kompiuteryje\n"
#: reg.rc:38
......
......@@ -10953,7 +10953,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11561,7 +11561,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Feil: Ugyldige parametere på kommandolinjen\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Feil: Kan ikke legge til nøkler på ekstern maskin\n"
#: reg.rc:38
......
......@@ -11702,7 +11702,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Fout: Foutieve commandoregel-parameters\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Fout: Sleutels konden niet toegevoegd worden aan de remote machine\n"
#: reg.rc:38
......
......@@ -10953,7 +10953,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -10953,7 +10953,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11555,7 +11555,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Błąd: Niewłaściwe parametry wiersza poleceń\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Błąd: Nie można dodać kluczy do zdalnej maszyny\n"
#: reg.rc:38
......
......@@ -11560,7 +11560,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Erro: Parâmetros da linha de comandos inválidos\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Erro: Incapaz de adicionar chaves à máquina remota\n"
#: reg.rc:38
......
......@@ -11529,7 +11529,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Erro: Parâmetros da linha de comandos inválidos\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Erro: Incapaz de adicionar chaves à máquina remota\n"
#: reg.rc:38
......
......@@ -11031,7 +11031,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11743,7 +11743,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Eroare: Parametri nevalizi pentru linia de comandă\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Eroare: Nu se pot adăuga chei pe calculatorul de la distanță\n"
#: reg.rc:38
......
......@@ -11512,7 +11512,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Ошибка: неправильные параметры командной строки\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Ошибка: нельзя добавлять разделы на удалённом компьютере\n"
#: reg.rc:38
......
......@@ -11181,8 +11181,10 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgstr ""
#, fuzzy
#| msgid "Error: Unable to terminate process \"%1\".\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Chyba: Nemožno ukončiť proces \"%1\".\n"
#: reg.rc:38
msgid ""
......
......@@ -11686,7 +11686,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Napaka: neveljaven parameter v ukazni vrstici\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Napaka: ni mogoče dodati ključa na oddaljen računalnik\n"
#: reg.rc:38
......
......@@ -11584,7 +11584,7 @@ msgstr ""
"Грешка: унесени су непознати или неисправни параметри наредбене линије\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11722,7 +11722,7 @@ msgstr ""
"Greška: uneseni su nepoznati ili neispravni parametri naredbene linije\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11452,7 +11452,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Fel: Ogiltiga kommandoradsparametrar\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Fel: Kan inte lägga till nycklar till fjärrmaskin\n"
#: reg.rc:38
......
......@@ -10953,7 +10953,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11178,7 +11178,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11514,7 +11514,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11594,7 +11594,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "Помилка: неправильні параметри командного рядка\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "Помилка: неможливо додати ключі на віддаленій машині\n"
#: reg.rc:38
......
......@@ -11083,7 +11083,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -10892,7 +10892,7 @@ msgid "Error: Invalid command line parameters\n"
msgstr ""
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr ""
#: reg.rc:38
......
......@@ -11044,7 +11044,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "错误:命令行参数无效\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "错误:无法将键添加到远程机器\n"
#: reg.rc:38
......
......@@ -11431,7 +11431,9 @@ msgid "Error: Invalid command line parameters\n"
msgstr "錯誤:無效的命令列參數\n"
#: reg.rc:37
msgid "Error: Unable to add keys to remote machine\n"
#, fuzzy
#| msgid "Error: Unable to add keys to remote machine\n"
msgid "Error: Unable to access remote machine\n"
msgstr "錯誤:無法加入索引鍵到遠端機器\n"
#: reg.rc:38
......
......@@ -179,6 +179,17 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r
return out_data;
}
static BOOL sane_path(const WCHAR *key)
{
if (key[0] == '\\' && key[1] == '\\' && key[2] != '\\')
{
reg_message(STRING_NO_REMOTE);
return FALSE;
}
return TRUE;
}
static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
WCHAR *type, WCHAR separator, WCHAR *data, BOOL force)
{
......@@ -189,11 +200,8 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
reg_printfW(stubW, key_name, value_name, value_empty, type, data, force);
if (key_name[0]=='\\' && key_name[1]=='\\')
{
reg_message(STRING_NO_REMOTE);
if (!sane_path(key_name))
return 1;
}
p = strchrW(key_name,'\\');
if (!p)
......@@ -262,11 +270,8 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
,0};
reg_printfW(stubW, key_name, value_name, value_empty, value_all, force);
if (key_name[0]=='\\' && key_name[1]=='\\')
{
reg_message(STRING_NO_REMOTE);
if (!sane_path(key_name))
return 1;
}
p = strchrW(key_name,'\\');
if (!p)
......
......@@ -33,6 +33,6 @@ STRINGTABLE
STRING_SUCCESS, "The operation completed successfully\n"
STRING_INVALID_KEY, "Error: Invalid key name\n"
STRING_INVALID_CMDLINE, "Error: Invalid command line parameters\n"
STRING_NO_REMOTE, "Error: Unable to add keys to remote machine\n"
STRING_NO_REMOTE, "Error: Unable to access remote machine\n"
STRING_CANNOT_FIND, "Error: The system was unable to find the specified registry key or value\n"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment