tor-commits
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2019
- 21 participants
- 1482 discussions

[translation/tails-misc] Update translations for tails-misc
by translation@torproject.org 19 Jun '19
by translation@torproject.org 19 Jun '19
19 Jun '19
commit 1c97acb03989a5bb72a7f74d08f3cf5d3920984c
Author: Translation commit bot <translation(a)torproject.org>
Date: Wed Jun 19 12:16:38 2019 +0000
Update translations for tails-misc
---
fr.po | 214 ++++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 110 insertions(+), 104 deletions(-)
diff --git a/fr.po b/fr.po
index 8124c7ef1..c77ac392c 100644
--- a/fr.po
+++ b/fr.po
@@ -4,26 +4,32 @@
#
# Translators:
# bassmax, 2014-2015
-# Alex <z-transifex(a)demollien.net>, 2014
+# Alex <chioubaca(a)gmail.com>, 2014
# tneskovic <antoine_ecuador(a)yahoo.fr>, 2014
# AO <ao(a)localizationlab.org>, 2018-2019
# apaddlingduck, 2014
+# apaddlingduck, 2014
+# Athorcis, 2015
# Athorcis, 2015
# Curtis Baltimore <curtisbaltimore(a)protonmail.com>, 2019
# Domiho Zannou <zannou.gery(a)gmail.com>, 2018
# Emmanuel Simond <emmanuel.simond(a)gmail.com>, 2014
+# Emmanuel Simond <emmanuel.simond(a)gmail.com>, 2014
# Emma Peel, 2018
# AO <ao(a)localizationlab.org>, 2017-2018
-# AO <ao(a)localizationlab.org>, 2016-2017
+# French language coordinator <french.translation(a)rbox.me>, 2015-2017
# Gwennole Hangard <gwennole.hangard(a)gmail.com>, 2015
# Jean-Yves Toumit <saiolar-c(a)yahoo.fr>, 2013
# Lidija <llazic.bgd(a)gmail.com>, 2015
+# mosira <romain.moisan(a)gmail.com>, 2014
+# Onizuka, 2013
# Onizuka, 2013
# mosira <romain.moisan(a)gmail.com>, 2014
# Sabrina Cater <sabcat(a)gmx.fr>, 2015
# Simon-Olivier Morneau <smorn026(a)uottawa.ca>, 2018
# Thomas Chauchefoin <thomas(a)chauchefoin.fr>, 2016
# Thomas Prévost <thomasprevost85(a)gmail.com>, 2018
+# tneskovic <antoine_ecuador(a)yahoo.fr>, 2014
# Towinet, 2013-2016
# AO <ao(a)localizationlab.org>, 2015
msgid ""
@@ -31,8 +37,8 @@ msgstr ""
"Project-Id-Version: Tor Project\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-18 19:31+0200\n"
-"PO-Revision-Date: 2019-06-05 21:52+0000\n"
-"Last-Translator: AO <ao(a)localizationlab.org>\n"
+"PO-Revision-Date: 2019-06-19 12:14+0000\n"
+"Last-Translator: xin\n"
"Language-Team: French (http://www.transifex.com/otf/torproject/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -63,19 +69,19 @@ msgid ""
"an opportunity for eavesdroppers, like your email or Internet provider, to\n"
"confirm that you are using Tails.\n"
"</p>\n"
-msgstr "<h1>Aidez-nous à corriger votre bogue !</h1>\n<p>Lisez <a href=\"%s\">nos instructions sur les relevés de bogue</a>.</p>\n<p><strong>N’incluez pas plus de renseignements personnels que nécessaire !</strong></p>\n<h2>Nous communiquer une adresse courriel</h2>\n<p>\nEn nous communiquant une adresse courriel, vous nous permettez de vous contacter pour clarifier le problème. Cela est nécessaire pour la vaste majorité des relevés que nous recevons, car la plupart des relevés sans coordonnées sont inutiles. En revanche, cela donne aussi une occasion à ceux qui vous écoutent clandestinement, tels que votre fournisseur d’accès à Internet ou de services de courriel, de confirmer que vous utilisez Tails.\n</p>\n"
+msgstr "<h1>Aidez-nous à résoudre votre problème !</h1>\n<p>Lisez <a href=\"%s\">nos instructions sur le signalement de problèmes</a>.</p>\n<p><strong>N'incluez pas plus d'informations personnelles que nécessaire !</strong></p>\n<h2>Nous donner une adresse de courrier électronique</h2>\n<p>\nEn nous donnant une adresse de courrier électronique, vous nous permettez de vous contacter pour clarifier le problème. Cela\nest nécessaire pour la grande majorité des rapports que nous recevons, car la plupart des rapports\nsont inutiles sans informations de contact. D'un autre côté, cela donne\nune occasion aux oreilles indiscrètes, comme votre fournisseur d'accès à Internet ou de courrier électronique, de\nconfirmer que vous utilisez Tails.\n</p>\n"
#: config/chroot_local-includes/usr/share/tails/additional-software/configuration-window.ui:51
msgid ""
"You can install additional software automatically from your persistent "
"storage when starting Tails."
-msgstr "Vous pouvez installer des logiciels supplémentaires automatiquement à partir de votre espace de stockage persistant lors du démarrage de Tails."
+msgstr "Vous pouvez installer des logiciels additionnels automatiquement depuis votre stockage persistant lors du démarrage de Tails."
#: config/chroot_local-includes/usr/share/tails/additional-software/configuration-window.ui:77
msgid ""
"The following software is installed automatically from your persistent "
"storage when starting Tails."
-msgstr "Les logiciels suivants sont installés automatiquement à partir de votre espace de stockage persistant lors du démarrage de Tails."
+msgstr "Le logiciel suivant est installé automatiquement depuis votre stockage persistant lors du démarrage de Tails."
#: config/chroot_local-includes/usr/share/tails/additional-software/configuration-window.ui:135
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:173
@@ -83,11 +89,11 @@ msgid ""
"To add more, install some software using <a "
"href=\"synaptic.desktop\">Synaptic Package Manager</a> or <a "
"href=\"org.gnome.Terminal.desktop\">APT on the command line</a>."
-msgstr "Pour en ajouter d’autres, installez des logiciels grâce au <a href=\"synaptic.desktop\">Gestionnaire de paquets Synaptic</a> ou à <a href=\"org.gnome.Terminal.desktop\">APT sur la ligne de commande</a>."
+msgstr "Pour en ajouter d'autres, installez des logiciels en utilisant le <a href=\"synaptic.desktop\">gestionnaire de paquets Synaptic</a> ou <a href=\"org.gnome.Terminal.desktop\">APT en ligne de commande</a>."
#: config/chroot_local-includes/usr/share/tails/additional-software/configuration-window.ui:154
msgid "_Create persistent storage"
-msgstr "_Créer un espace de stockage persistant"
+msgstr "_Créer stockage persistant"
#: config/chroot_local-includes/usr/local/bin/electrum:57
msgid "Persistence is disabled for Electrum"
@@ -98,11 +104,11 @@ msgid ""
"When you reboot Tails, all of Electrum's data will be lost, including your "
"Bitcoin wallet. It is strongly recommended to only run Electrum when its "
"persistence feature is activated."
-msgstr "Quand vous redémarrerez Tails, toutes les données d’Electrum seront perdues, incluant votre porte-monnaie Bitcoin. Il est fortement recommandé de n’utiliser Electrum qu’avec la fonction de persistance activée."
+msgstr "Lorsque vous redémarrerez Tails, toutes les données d'Electrum seront perdues, incluant votre portefeuille Bitcoin. Il est fortement recommandé de n'utiliser Electrum qu'avec l'option de persistance activée."
#: config/chroot_local-includes/usr/local/bin/electrum:60
msgid "Do you want to start Electrum anyway?"
-msgstr "Voulez-vous quand même démarrer Electrum ?"
+msgstr "Voulez-vous quand même démarrer Electrum ?"
#: config/chroot_local-includes/usr/local/bin/electrum:63
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:41
@@ -124,7 +130,7 @@ msgid ""
"<i>${filename}</i>\n"
"\n"
"Renaming it to <i>keepassx.kdbx</i> would allow <i>KeePassX</i> to open it automatically in the future."
-msgstr "<b><big>Souhaitez-vous renommer votre base de données <i>KeePassX</i></big></b> ?\n\nVous avez une base de données <i>KeePassX</i> dans votre dossier <i>Persistant</i> :\n\n<i>${filename}</i>\n\nLa renommer <i>keepassx.kdbx</i> permettrait à <i>KeePassX</i> de l’ouvrir automatiquement à l’avenir."
+msgstr "<b><big>Voulez-vous renommer votre base de données <i>KeePassX</i> ?</big></b>\n\nVous avez une base de données <i>KeePassX</i> dans votre dossier <i>Persistent</i> :\n\n<i>${filename}</i>\n\nLa renommer en <i>keepassx.kdbx</i> permettrait à <i>KeePassX</i> de l'ouvrir automatiquement à l'avenir."
#: config/chroot_local-includes/usr/local/bin/keepassx:25
msgid "Rename"
@@ -132,15 +138,15 @@ msgstr "Renommer"
#: config/chroot_local-includes/usr/local/bin/keepassx:26
msgid "Keep current name"
-msgstr "Conserver le nom actuel"
+msgstr "Garder le nom actuel"
#: config/chroot_local-includes/usr/local/bin/replace-su-with-sudo:21
msgid "su is disabled. Please use sudo instead."
-msgstr "su est désactivée. Veuillez plutôt utiliser sudo."
+msgstr "su est désactivé. Merci d'utiliser sudo à la place."
#: config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js:75
msgid "Lock screen"
-msgstr "Verrouiller l’écran"
+msgstr "Verrouillage de l'écran"
#: config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js:79
msgid "Suspend"
@@ -166,14 +172,14 @@ msgstr "À propos de Tails"
#: config/chroot_local-includes/usr/local/bin/tails-about:35
msgid "The Amnesic Incognito Live System"
-msgstr "Le système amnésique incognito autonome"
+msgstr "The Amnesic Incognito Live System"
#: config/chroot_local-includes/usr/local/bin/tails-about:36
#, python-format
msgid ""
"Build information:\n"
"%s"
-msgstr "Informations de version :\n%s"
+msgstr "Informations de compilation :\n%s"
#: config/chroot_local-includes/usr/local/bin/tails-about:54
msgid "not available"
@@ -186,17 +192,17 @@ msgstr "non disponible"
msgid ""
"{details} Please check your list of additional software or read the system "
"log to understand the problem."
-msgstr "{details} Veuillez consulter votre liste de logiciels supplémentaires ou lire le journal du système pour comprendre le problème."
+msgstr "{details} Veuillez vérifier votre liste de logiciels additionnels ou lire le journal système afin de mieux comprendre le problème."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:155
msgid ""
"Please check your list of additional software or read the system log to "
"understand the problem."
-msgstr "Veuillez consulter votre liste de logiciels supplémentaires ou lire le journal du système pour comprendre le problème."
+msgstr "Veuillez vérifier votre liste de logiciels additionnels ou lire le journal système afin de mieux comprendre le problème."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:159
msgid "Show Log"
-msgstr "Afficher le journal"
+msgstr "Afficher journal"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:159
msgid "Configure"
@@ -219,42 +225,42 @@ msgstr ", "
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:322
#, python-brace-format
msgid "Add {packages} to your additional software?"
-msgstr "Ajouter {packages} à vos logiciels supplémentaire ?"
+msgstr "Ajouter {packages} à vos logiciels additionnels ?"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:294
msgid ""
"To install it automatically from your persistent storage when starting "
"Tails."
-msgstr "Pour l’installer automatiquement à partir de votre espace de stockage persistant lors du démarrage de Tails."
+msgstr "Pour l'installer automatiquement depuis votre stockage persistant lors du démarrage de Tails."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:296
msgid "Install Every Time"
-msgstr "Installer toutes les fois"
+msgstr "Installer à chaque fois"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:297
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:328
msgid "Install Only Once"
-msgstr "Installer une seul fois seulement"
+msgstr "Installer une seule fois"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:303
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:333
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:374
msgid "The configuration of your additional software failed."
-msgstr "Échec de configuration de vos logiciels supplémentaires."
+msgstr "La configuration de votre logiciel additionnel a échoué."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:324
msgid ""
"To install it automatically when starting Tails, you can create a persistent"
" storage and activate the <b>Additional Software</b> feature."
-msgstr "Pour l’installer automatiquement lors du démarrage de Tails, vous pouvez créer un espace de stockage persistant et activer la fonction <b> Logiciels supplémentaires</b>."
+msgstr "Pour l'installer automatiquement lors du démarrage de Tails, vous pouvez créer un stockage persistant et activer l'option <b>Logiciels additionnels</b>"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:327
msgid "Create Persistent Storage"
-msgstr "Créer un espace de stockage persistant"
+msgstr "Créer un stockage persistant"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:335
msgid "Creating your persistent storage failed."
-msgstr "Échec de création de votre espace de stockage persistant. "
+msgstr "La création de votre stockage persistant a échoué."
#. Translators: Don't translate {packages}, it's a placeholder and
#. will be replaced.
@@ -267,26 +273,26 @@ msgstr "Vous pourriez installer {packages} automatiquement lors du démarrage de
msgid ""
"To do so, you need to run Tails from a USB stick installed using <i>Tails "
"Installer</i>."
-msgstr "Pour ce faire, vous devez exécuter Tails à partir d’une clé USB installée avec <i>le programme d’installation de Tails</i>."
+msgstr "Pour ce faire, vous avez besoin de démarrer Tails depuis une clé USB installée en utilisant l'<i>Installeur de Tails</i>."
#. Translators: Don't translate {packages}, it's a placeholder and will be
#. replaced.
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:362
#, python-brace-format
msgid "Remove {packages} from your additional software?"
-msgstr "Supprimer {packages} de vos logiciels supplémentaires ?"
+msgstr "Enlever {packages} de vos logiciels additionnels ?"
#. Translators: Don't translate {packages}, it's a placeholder
#. and will be replaced.
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:366
#, python-brace-format
msgid "This will stop installing {packages} automatically."
-msgstr "Cela arrêtera l’installation automatique de {packages}."
+msgstr "Cela devrait stopper l'installation automatique de {packages}."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:368
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:156
msgid "Remove"
-msgstr "Supprimer"
+msgstr "Enlever"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:369
#: config/chroot_local-includes/usr/local/bin/tails-screen-locker:119
@@ -296,7 +302,7 @@ msgstr "Annuler"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:547
msgid "Installing your additional software from persistent storage..."
-msgstr "Installation de vos logiciels supplémentaires à partir de votre espace de stockage persistant…"
+msgstr "Installation de vos logiciels additionnels depuis le stockage persistant..."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:549
msgid "This can take several minutes."
@@ -304,26 +310,26 @@ msgstr "Cela peut prendre plusieurs minutes."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:562
msgid "The installation of your additional software failed"
-msgstr "Échec d’installation de vos logiciels supplémentaires."
+msgstr "L'installation de vos logiciels additionnels a échoué"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:577
msgid "Additional software installed successfully"
-msgstr "Les logiciels supplémentaires ont été installés avec succès"
+msgstr "Logiciels additionnels installés avec succès"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:597
msgid "The check for upgrades of your additional software failed"
-msgstr "Échec de recherche de mises à niveau de vos logiciels supplémentaires."
+msgstr "La vérification de mise à jour de vos logiciels additionnels a échoué"
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:599
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:607
msgid ""
"Please check your network connection, restart Tails, or read the system log "
"to understand the problem."
-msgstr "Veuillez vérifier votre connexion réseau, redémarrer Tails, ou consulter le journal du système pour comprendre le problème."
+msgstr "Veuillez vérifier votre connexion réseau, essayer de redémarrer Tails, ou lire le journal système afin de mieux comprendre le problème."
#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:606
msgid "The upgrade of your additional software failed"
-msgstr "Échec de mise à niveau de vos logiciels supplémentaires."
+msgstr "La mise à jour de vos logiciels additionnels a échoué"
#: config/chroot_local-includes/usr/local/lib/tails-additional-software-notify:39
msgid "Documentation"
@@ -336,32 +342,32 @@ msgstr "Documentation"
msgid ""
"Remove {package} from your additional software? This will stop installing "
"the package automatically."
-msgstr "Voulez-vous supprimer [package] de vos logiciels supplémentaires ? Cela arrêtera l’installation automatique du paquet."
+msgstr "Enlever {package} de vos logiciels additionnels ? Cela devrait stopper son installation automatique."
#. Translators: Don't translate {pkg}, it's a placeholder and will be
#. replaced.
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:107
#, python-brace-format
msgid "Failed to remove {pkg}"
-msgstr "Échec de suppression de {pkg}"
+msgstr "Échec de la suppression de {pkg}"
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:124
msgid "Failed to read additional software configuration"
-msgstr "Échec de lecture de la configuration du logiciel supplémentaire"
+msgstr "Échec de la lecture de la configuration des logiciels additionnels"
#. Translators: Don't translate {package}, it's a placeholder and will be
#. replaced.
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:154
#, python-brace-format
msgid "Stop installing {package} automatically"
-msgstr "Arrêter d’installer {package} automatiquement"
+msgstr "Arrêter d'installer {package} automatiquement"
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:180
msgid ""
"To do so, install some software using <a href=\"synaptic.desktop\">Synaptic "
"Package Manager</a> or <a href=\"org.gnome.Terminal.desktop\">APT on the "
"command line</a>."
-msgstr "Pour ce faire, installez des logiciels grâce au <a href=\"synaptic.desktop\">Gestionnaire de Paquets Synaptic</a> ou à <a href=\"org.gnome.Terminal.desktop\">APT sur la ligne de commande</a>."
+msgstr "Pour ce faire, installez des logiciels en utilisant le <a href=\"synaptic.desktop\">gestionnaire de paquets Synaptic</a> ou <a href=\"org.gnome.Terminal.desktop\">APT en ligne de commande</a>."
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:189
msgid ""
@@ -369,42 +375,42 @@ msgid ""
"some software using <a href=\"synaptic.desktop\">Synaptic Package "
"Manager</a> or <a href=\"org.gnome.Terminal.desktop\">APT on the command "
"line</a>."
-msgstr "Pour ce faire, déverrouilez votre espace de stockage persistant lors du démarrage de Tails et installez des logiciels grâce au <a href=\"synaptic.desktop\">Gestionnaire de Paquets Synaptic</a> ou à <a href=\"org.gnome.Terminal.desktop\">APT sur la ligne de commande</a>."
+msgstr "Pour ce faire, déverrouillez votre stockage persistant lors du démarrage de Tails et installez des logiciels en utilisant le <a href=\"synaptic.desktop\">gestionnaire de paquets Synaptic</a> ou <a href=\"org.gnome.Terminal.desktop\">APT en ligne de commande</a>."
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:199
msgid ""
"To do so, create a persistent storage and install some software using <a "
"href=\"synaptic.desktop\">Synaptic Package Manager</a> or <a "
"href=\"org.gnome.Terminal.desktop\">APT on the command line</a>."
-msgstr "Pour ce faire, créez un espace de stockage persistent et installez des logiciels grâce au <a href=\"synaptic.desktop\">Gestionnaire de Paquets Synaptic</a> ou à <a href=\"org.gnome.Terminal.desktop\">APT sur la ligne de commande</a>."
+msgstr "Pour ce faire, créez un stockage persistant et installez des logiciels en utilisant le <a href=\"synaptic.desktop\">gestionnaire de paquets Synaptic</a> ou <a href=\"org.gnome.Terminal.desktop\">APT en ligne de commande</a>."
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:207
msgid ""
"To do so, install Tails on a USB stick using <a href=\"tails-"
"installer.desktop\">Tails Installer</a> and create a persistent storage."
-msgstr "Pour ce faire, installez Tails sur une clé USB grâce au <a href=\"tails-installer.desktop\">programme d’installation de Tails</a> et créez un espace de stockage persistant."
+msgstr "Pour ce faire, installez Tails sur une clé USB en utilisant l'<a href=\"tails-installer.desktop\">Installeur de Tails</a> et en créant un stockage persistant."
#: config/chroot_local-includes/usr/local/bin/tails-additional-software-config:254
msgid "[package not available]"
-msgstr "[package not available]"
+msgstr "[paquet non disponible]"
#: config/chroot_local-includes/usr/local/lib/tails-htp-notify-user:52
msgid "Synchronizing the system's clock"
-msgstr "Synchronisation de l’horloge système"
+msgstr "Synchronisation de l'horloge système"
#: config/chroot_local-includes/usr/local/lib/tails-htp-notify-user:53
msgid ""
"Tor needs an accurate clock to work properly, especially for Hidden "
"Services. Please wait..."
-msgstr "Tor exige une horloge précise et bien réglée pour fonctionner correctement, en particulier pour les services cachés. Veuillez patienter…"
+msgstr "Tor a besoin d'une horloge bien réglée pour fonctionner correctement, en particulier pour les services cachés. Veuillez patienter..."
#: config/chroot_local-includes/usr/local/lib/tails-htp-notify-user:87
msgid "Failed to synchronize the clock!"
-msgstr "Échec de synchronisation de l’horloge !"
+msgstr "Échec de synchronisation de l'horloge !"
#: config/chroot_local-includes/usr/local/bin/tails-security-check:124
msgid "This version of Tails has known security issues:"
-msgstr "Cette version de Tails est touchée par des problèmes de sécurité connus :"
+msgstr "Cette version de Tails a des problèmes de sécurité connus :"
#: config/chroot_local-includes/usr/local/bin/tails-security-check:134
msgid "Known security issues"
@@ -420,7 +426,7 @@ msgstr "La carte réseau ${nic} est désactivée"
msgid ""
"MAC spoofing failed for network card ${nic_name} (${nic}) so it is temporarily disabled.\n"
"You might prefer to restart Tails and disable MAC spoofing."
-msgstr "Le déguisement MAC a échoué pour la carte réseau ${nic_name} (${nic}) et est donc désactivé temporairement.\nVous pourriez préférer redémarrer Tails et désactiver le déguisement MAC."
+msgstr "L'usurpation d'adresse MAC a échoué pour la carte réseau ${nic_name} (${nic}), elle est donc temporairement désactivée.\nVous pourriez préférer redémarrer Tails et désactiver l'usurpation d'adresse MAC."
#: config/chroot_local-includes/usr/local/lib/tails-spoof-mac:62
msgid "All networking disabled"
@@ -431,19 +437,19 @@ msgstr "Tout le réseau est désactivé"
msgid ""
"MAC spoofing failed for network card ${nic_name} (${nic}). The error recovery also failed so all networking is disabled.\n"
"You might prefer to restart Tails and disable MAC spoofing."
-msgstr "Le déguisement MAC a échoué pour la carte réseau ${nic_name} (${nic}). La récupération en cas d’erreur a aussi échoué et toute la mise en réseau est désactivée.\nVous pourriez préférer redémarrer Tails et désactiver le déguisement MAC."
+msgstr "L'usurpation d'adresse MAC a échoué pour la carte réseau ${nic_name} (${nic}). Le dépannage de cette erreur a également échoué, toutes les fonctions de réseau sont désactivées.\nVous pourriez préférer redémarrer Tails et désactiver l'usurpation d'adresse MAC."
#: config/chroot_local-includes/usr/local/bin/tails-screen-locker:110
msgid "Lock Screen"
-msgstr "Verrouiller l’écran"
+msgstr "Verrouiller l'écran"
#: config/chroot_local-includes/usr/local/bin/tails-screen-locker:125
msgid "Screen Locker"
-msgstr "Verrou d’écran"
+msgstr "Verrouillage de l'écran"
#: config/chroot_local-includes/usr/local/bin/tails-screen-locker:131
msgid "Set up a password to unlock the screen."
-msgstr "Définir un mot de passe pour déverrouiller l’écran"
+msgstr "Configurer un mot de passe pour le déverrouillage de l'écran."
#: config/chroot_local-includes/usr/local/bin/tails-screen-locker:136
msgid "Password"
@@ -464,12 +470,12 @@ msgid ""
"\n"
"Or do a manual upgrade.\n"
"See https://tails.boum.org/doc/first_steps/upgrade#manual\""
-msgstr "« <b>Il n’y a pas assez de mémoire libre pour vérifier les mises à niveau.</b>\n\nAssurez-vous que ce système répond aux exigences d’exécution de Tails.\nConsulter file:///usr/share/doc/tails/website/doc/about/requirements.en.html\n\nEssayez de redémarrer Tails pour vérifier les mises à niveau de nouveau.\n\nOu effectuez une mise à niveau manuelle.\nConsulter https://tails.boum.org/doc/first_steps/upgrade#manual »"
+msgstr "\"<b>Il n'y a pas assez de mémoire disponible pour vérifier les mises à jour.</b>\n\nAssurez-vous que cet ordinateur satisfait les conditions requises pour utiliser Tails.\nVoir file:///usr/share/doc/tails/website/doc/about/requirements.fr.html\n\nEssayez de redémarrer Tails pour vérifier à nouveau les mises à jour.\n\nOu effectuez une mise à jour manuelle.\nVoir https://tails.boum.org/doc/first_steps/upgrade/index.fr.html#manual\""
#: config/chroot_local-includes/usr/local/bin/tails-upgrade-frontend-wrapper:72
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:27
msgid "error:"
-msgstr "erreur :"
+msgstr "erreur :"
#: config/chroot_local-includes/usr/local/bin/tails-upgrade-frontend-wrapper:73
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:28
@@ -478,11 +484,11 @@ msgstr "Erreur"
#: config/chroot_local-includes/usr/local/lib/tails-virt-notify-user:71
msgid "Warning: virtual machine detected!"
-msgstr "Avertissement : Une machine virtuelle a été détectée !"
+msgstr "Avertissement : une machine virtuelle a été détectée !"
#: config/chroot_local-includes/usr/local/lib/tails-virt-notify-user:74
msgid "Warning: non-free virtual machine detected!"
-msgstr "Avertissement : Une machine virtuelle non libre a été détectée !"
+msgstr "Avertissement : une machine virtuelle non libre a été détectée !"
#: config/chroot_local-includes/usr/local/lib/tails-virt-notify-user:77
msgid ""
@@ -490,7 +496,7 @@ msgid ""
"monitor what you are doing in Tails. Only free software can be considered "
"trustworthy, for both the host operating system and the virtualization "
"software."
-msgstr "Le système d’exploitation hôte et le logiciel de virtualisation peuvent tous deux surveiller ce que vous faites dans Tails. Seuls les logiciels libres peuvent être considérés de confiance, à la fois pour le système d’exploitation hôte et le logiciel de virtualisation."
+msgstr "Le système d'exploitation hôte et le logiciel de virtualisation peuvent tous deux surveiller ce que vous faites dans Tails. Seuls les logiciels libres peuvent être considérés de confiance, à la fois pour le système d'exploitation hôte et le logiciel de virtualisation."
#: config/chroot_local-includes/usr/local/lib/tails-virt-notify-user:81
msgid "Learn more"
@@ -498,15 +504,15 @@ msgstr "En apprendre davantage"
#: config/chroot_local-includes/usr/local/bin/tor-browser:43
msgid "Tor is not ready"
-msgstr "Tor n’est pas prêt"
+msgstr "Tor n'est pas prêt"
#: config/chroot_local-includes/usr/local/bin/tor-browser:44
msgid "Tor is not ready. Start Tor Browser anyway?"
-msgstr "Tor n’est pas prêt. Démarrer quand même le Navigateur Tor ?"
+msgstr "Tor n'est pas prêt. Démarrer le navigateur Tor quand même ?"
#: config/chroot_local-includes/usr/local/bin/tor-browser:45
msgid "Start Tor Browser"
-msgstr "Démarrer le Navigateur Tor"
+msgstr "Démarrer le navigateur Tor"
#: config/chroot_local-includes/usr/share/gnome-shell/extensions/torstatus@tails.boum.org/extension.js:40
msgid "Tor"
@@ -514,55 +520,55 @@ msgstr "Tor"
#: config/chroot_local-includes/usr/share/gnome-shell/extensions/torstatus@tails.boum.org/extension.js:55
msgid "Open Onion Circuits"
-msgstr "Ouvrir des circuits onion"
+msgstr "Ouvrir Onion Circuits"
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:38
msgid "Do you really want to launch the Unsafe Browser?"
-msgstr "Voulez-vous vraiment lancer le navigateur non sécurisé ?"
+msgstr "Voulez-vous vraiment lancer le navigateur non-sécurisé ?"
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:40
msgid ""
"Network activity within the Unsafe Browser is <b>not anonymous</b>.\\nOnly "
"use the Unsafe Browser if necessary, for example\\nif you have to login or "
"register to activate your Internet connection."
-msgstr "L’activité réseau dans le navigateur non sécurisé <b>n’est pas anonyme</b>.\\nN’utilisez le navigateur non sécurisé que si nécessaire, par exemple si vous devez vous connecter ou vous inscrire pour activer votre connexion Internet."
+msgstr "L'activité réseau dans le navigateur non-sécurisé n'est <b>pas anonyme</b>.\\nN'utilisez le navigateur non-sécurisé que si nécessaire, par exemple\\nsi vous devez vous identifier ou vous inscrire pour activer votre connexion Internet."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:51
msgid "Starting the Unsafe Browser..."
-msgstr "Démarrage du navigateur non sécurisé…"
+msgstr "Démarrage du navigateur non-sécurisé..."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:52
msgid "This may take a while, so please be patient."
-msgstr "Cela peut prendre du temps. Veuillez être patient."
+msgstr "Cela peut prendre du temps, merci de patienter."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:57
msgid "Shutting down the Unsafe Browser..."
-msgstr "Fermeture du navigateur non sécurisé…"
+msgstr "Fermeture du navigateur non-sécurisé..."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:58
msgid ""
"This may take a while, and you may not restart the Unsafe Browser until it "
"is properly shut down."
-msgstr "Cela peut prendre du temps et vous ne devez pas redémarrer le navigateur non sécurisé avant sa fermeture complète."
+msgstr "Cela peut prendre du temps et vous ne devez pas redémarrer le navigateur non-sécurisé avant sa fermeture complète."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:70
msgid "Failed to restart Tor."
-msgstr "Échec de redémarrage de Tor."
+msgstr "Échec du redémarrage de Tor."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:84
#: ../config/chroot_local-includes/usr/share/applications/unsafe-browser.desktop.in.h:1
msgid "Unsafe Browser"
-msgstr "Navigateur non sécurisé"
+msgstr "Navigateur non-sécurisé"
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:91
msgid ""
"Another Unsafe Browser is currently running, or being cleaned up. Please "
"retry in a while."
-msgstr "Un autre navigateur non sécurisé est en cours d’utilisation ou de nettoyage. Veuillez ressayer dans un moment."
+msgstr "Un autre navigateur non-sécurisé est en cours d'utilisation, ou est en train d'être nettoyé. Veuillez réessayer dans un moment."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:99
msgid "Failed to setup chroot."
-msgstr "Échec d’exécution de chroot"
+msgstr "Échec d'exécution de chroot."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:104
msgid "Failed to configure browser."
@@ -572,7 +578,7 @@ msgstr "Échec de configuration du navigateur."
msgid ""
"No DNS server was obtained through DHCP or manually configured in "
"NetworkManager."
-msgstr "Aucun serveur DNS n’a été obtenu par le DHCP ou n’est configuré manuellement dans gestionnaire de réseau."
+msgstr "Aucun serveur DNS n'a été obtenu par le DHCP ou n'est configuré manuellement dans le gestionnaire de réseau."
#: config/chroot_local-includes/usr/local/sbin/unsafe-browser:121
msgid "Failed to run browser."
@@ -597,7 +603,7 @@ msgstr "{partition_name} ({partition_size})"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py:68
#, python-brace-format
msgid "{volume_size} Volume"
-msgstr "Volume de {volume_size}"
+msgstr "Volume {volume_size}"
#. Translators: Don't translate {volume_name}, it's a placeholder and
#. will be replaced.
@@ -640,7 +646,7 @@ msgstr "{volume_name} – {drive_name}"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py:222
msgid "Wrong passphrase or parameters"
-msgstr "Phrase de passe ou paramètres erronés"
+msgstr "Mauvaise phrase de passe ou mauvais paramètres"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py:224
msgid "Error unlocking volume"
@@ -653,33 +659,33 @@ msgstr "Erreur de déverrouillage du volume"
msgid ""
"Couldn't unlock volume {volume_name}:\n"
"{error_message}"
-msgstr "Impossible de déverrouiller le volume {volume_name} :\n{error_message}"
+msgstr "Impossible de déverrouiller le volume {volume_name} :\n{error_message}"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_list.py:83
msgid "No file containers added"
-msgstr "Aucun conteneur de fichiers n’a été ajouté"
+msgstr "Aucun fichier conteneur ajouté"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_list.py:98
msgid "No VeraCrypt devices detected"
-msgstr "Aucun périphérique VeraCrypt n’a été détecté"
+msgstr "Aucun périphérique VeraCrypt détecté"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:40
#: ../config/chroot_local-includes/usr/share/applications/unlock-veracrypt-volumes.desktop.in.h:1
msgid "Unlock VeraCrypt Volumes"
-msgstr "Déverrouillage des volumes VeraCrypt"
+msgstr "Déverrouiller des volumes VeraCrypt"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:114
msgid "Container already added"
-msgstr "Le conteneur a déjà été ajouté"
+msgstr "Conteneur déjà ajouté"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:115
#, python-format
msgid "The file container %s should already be listed."
-msgstr "Le conteneur de fichiers %s devrait déjà être listé."
+msgstr "Le fichier conteneur %s devrait déjà être listé."
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:131
msgid "Container opened read-only"
-msgstr "Le conteneur est ouvert en lecture seule"
+msgstr "Conteneur ouvert en lecture seule"
#. Translators: Don't translate {path}, it's a placeholder and will be
#. replaced.
@@ -688,15 +694,15 @@ msgstr "Le conteneur est ouvert en lecture seule"
msgid ""
"The file container {path} could not be opened with write access. It was opened read-only instead. You will not be able to modify the content of the container.\n"
"{error_message}"
-msgstr "Le conteneur de fichiers {path} n’a pas pu être ouvert avec un accès en écriture. Il a plutôt été ouvert en lecture seule. Vous ne pourrez pas modifier le contenu du conteneur.\n{error_message}"
+msgstr "Le fichier conteneur {path} ne pouvait pas être ouvert avec des droits en écriture. À la place il a été ouvert en lecture seule. Vous ne pourrez pas modifier le contenu de ce conteneur.\n{error_message}"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:138
msgid "Error opening file"
-msgstr "Erreur d’ouverture du fichier"
+msgstr "Erreur d'ouverture du fichier"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:160
msgid "Not a VeraCrypt container"
-msgstr "N’est pas un conteneur VeraCrypt"
+msgstr "Ce n'est pas un conteneur VeraCrypt"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:161
#, python-format
@@ -705,7 +711,7 @@ msgstr "Le fichier %s ne semble pas être un conteneur VeraCrypt."
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:163
msgid "Failed to add container"
-msgstr "Échec d’ajout du conteneur"
+msgstr "Échec de l'ajout du conteneur"
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:164
#, python-format
@@ -716,7 +722,7 @@ msgstr "Impossible d'ajouter le conteneur de fichiers délai d’attente%s: Dél
#: config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py:209
msgid "Choose File Container"
-msgstr "Choisir un conteneur de fichiers"
+msgstr "Choisir un fichier conteneur"
#: ../config/chroot_local-includes/etc/skel/Desktop/Report_an_error.desktop.in.h:1
msgid "Report an error"
@@ -729,15 +735,15 @@ msgstr "Documentation de Tails"
#: ../config/chroot_local-includes/usr/share/applications/tails-documentation.desktop.in.h:2
msgid "Learn how to use Tails"
-msgstr "Découvrir comment utiliser Tails"
+msgstr "Apprendre à utiliser Tails"
#: ../config/chroot_local-includes/usr/share/applications/tails-about.desktop.in.h:2
msgid "Learn more about Tails"
-msgstr "En apprendre davantage sur Tails."
+msgstr "En apprendre davantage sur Tails"
#: ../config/chroot_local-includes/usr/share/applications/tor-browser.desktop.in.h:1
msgid "Tor Browser"
-msgstr "Le Navigateur Tor"
+msgstr "Navigateur Tor"
#: ../config/chroot_local-includes/usr/share/applications/tor-browser.desktop.in.h:2
msgid "Anonymous Web Browser"
@@ -749,21 +755,21 @@ msgstr "Naviguer sur le Web sans anonymat"
#: ../config/chroot_local-includes/usr/share/applications/unsafe-browser.desktop.in.h:3
msgid "Unsafe Web Browser"
-msgstr "Navigateur Web non sécurisé"
+msgstr "Navigateur Web non-sécurisé"
#: ../config/chroot_local-includes/usr/share/applications/unlock-veracrypt-volumes.desktop.in.h:2
msgid "Mount VeraCrypt encrypted file containers and devices"
-msgstr "Monter des conteneurs de fichiers et des périphériques chiffrés avec VeraCrypt"
+msgstr "Monter des fichiers conteneurs et des périphériques VeraCrypt"
#: ../config/chroot_local-includes/usr/share/applications/org.boum.tails.additional-software-config.desktop.in.h:1
msgid "Additional Software"
-msgstr "Logiciels supplémentaires"
+msgstr "Logiciels additionnels"
#: ../config/chroot_local-includes/usr/share/applications/org.boum.tails.additional-software-config.desktop.in.h:2
msgid ""
"Configure the additional software installed from your persistent storage "
"when starting Tails"
-msgstr "Configurer les logiciels supplémentaires installés à partir de votre espace de stockage persistant lors du démarrage de Tails."
+msgstr "Configurer les logiciels additionnels installés depuis votre stockage persistant lors du démarrage de Tails"
#: ../config/chroot_local-includes/usr/share/desktop-directories/Tails.directory.in.h:2
msgid "Tails specific tools"
@@ -771,21 +777,21 @@ msgstr "Outils spécifiques à Tails"
#: ../config/chroot_local-includes/usr/share/polkit-1/actions/org.boum.tails.root-terminal.policy.in.h:1
msgid "To start a Root Terminal, you need to authenticate."
-msgstr "Pour lancer un terminal en tant que superutilisateur, vous devez vous authentifier."
+msgstr "Vous devez vous authentifier pour lancer un Terminal administrateur."
#: ../config/chroot_local-includes/usr/share/polkit-1/actions/org.boum.tails.additional-software.policy.in.h:1
msgid "Remove an additional software package"
-msgstr "Supprimer un paquet logiciel supplémentaire"
+msgstr "Enlever un paquet de logiciel additionnel"
#: ../config/chroot_local-includes/usr/share/polkit-1/actions/org.boum.tails.additional-software.policy.in.h:2
msgid ""
"Authentication is required to remove a package from your additional software"
" ($(command_line))"
-msgstr "L’authentification est exigée pour supprimer un paquet de vos logiciels supplémentaires ($(command_line))"
+msgstr "Une authentification est nécessaire pour enlever un paquet depuis vos logiciels additionnels ($(command_line))"
#: ../config/chroot_local-includes/usr/share/tails/unlock-veracrypt-volumes/main.ui.in:61
msgid "File Containers"
-msgstr "Conteneurs de fichiers"
+msgstr "Fichiers conteneurs"
#: ../config/chroot_local-includes/usr/share/tails/unlock-veracrypt-volumes/main.ui.in:80
msgid "_Add"
@@ -793,17 +799,17 @@ msgstr "_Ajouter"
#: ../config/chroot_local-includes/usr/share/tails/unlock-veracrypt-volumes/main.ui.in:86
msgid "Add a file container"
-msgstr "Ajouter un conteneur de fichiers"
+msgstr "Ajouter un fichier conteneur"
#: ../config/chroot_local-includes/usr/share/tails/unlock-veracrypt-volumes/main.ui.in:103
msgid "Partitions and Drives"
-msgstr "Partitions et disques"
+msgstr "Partitions et lecteurs"
#: ../config/chroot_local-includes/usr/share/tails/unlock-veracrypt-volumes/main.ui.in:121
msgid ""
"This application is not affiliated with or endorsed by the VeraCrypt project"
" or IDRIX."
-msgstr "Cette application n’est ni affiliée avec le projet VeraCrypt ou IDRIX ni sanctionnée par ces derniers."
+msgstr "Cette application n'est pas liée ou approuvée par le projet VeraCrypt ou IDRIX."
#: ../config/chroot_local-includes/usr/share/tails/unlock-veracrypt-volumes/volume.ui.in:29
msgid "_Open"
1
0

[tor/master] Remove the PORT configuration type: nothing uses it.
by dgoulet@torproject.org 19 Jun '19
by dgoulet@torproject.org 19 Jun '19
19 Jun '19
commit fe9d15cf4b392bd6daef47f3aab97adeeebe7402
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Wed Jun 12 16:33:40 2019 -0400
Remove the PORT configuration type: nothing uses it.
All of our port configurations now use an extended format.
---
src/app/config/config.c | 1 -
src/app/config/confparse.c | 16 +---------------
src/app/config/confparse.h | 8 +++-----
3 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 847355dad..790800705 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -8180,7 +8180,6 @@ getinfo_helper_config(control_connection_t *conn,
case CONFIG_TYPE_POSINT: type = "Integer"; break;
case CONFIG_TYPE_UINT64: type = "Integer"; break;
case CONFIG_TYPE_INT: type = "SignedInteger"; break;
- case CONFIG_TYPE_PORT: type = "Port"; break;
case CONFIG_TYPE_INTERVAL: type = "TimeInterval"; break;
case CONFIG_TYPE_MSEC_INTERVAL: type = "TimeMsecInterval"; break;
case CONFIG_TYPE_MEMUNIT: type = "DataSize"; break;
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index cf83df728..14d9a368d 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -174,17 +174,11 @@ config_assign_value(const config_format_t *fmt, void *options,
switch (var->type) {
- case CONFIG_TYPE_PORT:
- if (!strcasecmp(c->value, "auto")) {
- *(int *)lvalue = CFG_AUTO_PORT;
- break;
- }
- /* fall through */
case CONFIG_TYPE_INT:
case CONFIG_TYPE_POSINT:
i = (int)tor_parse_long(c->value, 10,
var->type==CONFIG_TYPE_INT ? INT_MIN : 0,
- var->type==CONFIG_TYPE_PORT ? 65535 : INT_MAX,
+ INT_MAX,
&ok, NULL);
if (!ok) {
tor_asprintf(msg,
@@ -570,13 +564,6 @@ config_get_assigned_option(const config_format_t *fmt, const void *options,
}
escape_val = 0; /* Can't need escape. */
break;
- case CONFIG_TYPE_PORT:
- if (*(int*)value == CFG_AUTO_PORT) {
- result->value = tor_strdup("auto");
- escape_val = 0;
- break;
- }
- /* fall through */
case CONFIG_TYPE_CSV_INTERVAL:
case CONFIG_TYPE_INTERVAL:
case CONFIG_TYPE_MSEC_INTERVAL:
@@ -788,7 +775,6 @@ config_clear(const config_format_t *fmt, void *options,
case CONFIG_TYPE_MSEC_INTERVAL:
case CONFIG_TYPE_POSINT:
case CONFIG_TYPE_INT:
- case CONFIG_TYPE_PORT:
case CONFIG_TYPE_BOOL:
*(int*)lvalue = 0;
break;
diff --git a/src/app/config/confparse.h b/src/app/config/confparse.h
index 57f1ec176..2c923eb6b 100644
--- a/src/app/config/confparse.h
+++ b/src/app/config/confparse.h
@@ -17,11 +17,9 @@
typedef enum config_type_t {
CONFIG_TYPE_STRING = 0, /**< An arbitrary string. */
CONFIG_TYPE_FILENAME, /**< A filename: some prefixes get expanded. */
- CONFIG_TYPE_UINT, /**< A non-negative integer less than MAX_INT */
+ CONFIG_TYPE_POSINT, /**< A non-negative integer less than MAX_INT */
CONFIG_TYPE_INT, /**< Any integer. */
CONFIG_TYPE_UINT64, /**< A value in range 0..UINT64_MAX */
- CONFIG_TYPE_PORT, /**< A port from 1...65535, 0 for "not set", or
- * "auto". */
CONFIG_TYPE_INTERVAL, /**< A number of seconds, with optional units*/
CONFIG_TYPE_MSEC_INTERVAL,/**< A number of milliseconds, with optional
* units */
@@ -57,8 +55,8 @@ typedef enum config_type_t {
typedef union {
char **STRING;
char **FILENAME;
- int *UINT; /* yes, really: Even though the confparse type is called
- * "UINT", it still uses the C int type -- it just enforces that
+ int *POSINT; /* yes, really: Even though the confparse type is called
+ * "POSINT", it still uses the C int type -- it just enforces that
* the values are in range [0,INT_MAX].
*/
uint64_t *UINT64;
1
0

19 Jun '19
commit ac5e44d9ce9d07c05b4ba0cb21f058a6322692ec
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Wed Jun 12 13:49:47 2019 -0400
Renaming: CONFIG_TYPE_UINT -> CONFIG_TYPE_POSINT
This name has been a historical source of confusion, since "uint"
usually suggests "unsigned int" to people, when the real type is
"nonnegative int".
---
src/app/config/config.c | 30 +++++++++++++++---------------
src/app/config/confparse.c | 6 +++---
src/app/config/statefile.c | 14 +++++++-------
src/feature/dirauth/shared_random_state.c | 2 +-
4 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 6bcf51156..847355dad 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -317,7 +317,7 @@ static config_var_t option_vars_[] = {
OBSOLETE("AuthDirRejectUnlisted"),
OBSOLETE("AuthDirListBadDirs"),
V(AuthDirListBadExits, BOOL, "0"),
- V(AuthDirMaxServersPerAddr, UINT, "2"),
+ V(AuthDirMaxServersPerAddr, POSINT, "2"),
OBSOLETE("AuthDirMaxServersPerAuthAddr"),
V(AuthDirHasIPv6Connectivity, BOOL, "0"),
VAR("AuthoritativeDirectory", BOOL, AuthoritativeDir, "0"),
@@ -352,7 +352,7 @@ static config_var_t option_vars_[] = {
V(ClientUseIPv6, BOOL, "0"),
V(ClientUseIPv4, BOOL, "1"),
V(ConsensusParams, STRING, NULL),
- V(ConnLimit, UINT, "1000"),
+ V(ConnLimit, POSINT, "1000"),
V(ConnDirectionStatistics, BOOL, "0"),
V(ConstrainedSockets, BOOL, "0"),
V(ConstrainedSockSize, MEMUNIT, "8192"),
@@ -402,14 +402,14 @@ static config_var_t option_vars_[] = {
V(DormantCanceledByStartup, BOOL, "0"),
/* DoS circuit creation options. */
V(DoSCircuitCreationEnabled, AUTOBOOL, "auto"),
- V(DoSCircuitCreationMinConnections, UINT, "0"),
- V(DoSCircuitCreationRate, UINT, "0"),
- V(DoSCircuitCreationBurst, UINT, "0"),
+ V(DoSCircuitCreationMinConnections, POSINT, "0"),
+ V(DoSCircuitCreationRate, POSINT, "0"),
+ V(DoSCircuitCreationBurst, POSINT, "0"),
V(DoSCircuitCreationDefenseType, INT, "0"),
V(DoSCircuitCreationDefenseTimePeriod, INTERVAL, "0"),
/* DoS connection options. */
V(DoSConnectionEnabled, AUTOBOOL, "auto"),
- V(DoSConnectionMaxConcurrentCount, UINT, "0"),
+ V(DoSConnectionMaxConcurrentCount, POSINT, "0"),
V(DoSConnectionDefenseType, INT, "0"),
/* DoS single hop client options. */
V(DoSRefuseSingleHopClientRendezvous, AUTOBOOL, "auto"),
@@ -522,7 +522,7 @@ static config_var_t option_vars_[] = {
VAR("MapAddress", LINELIST, AddressMap, NULL),
V(MaxAdvertisedBandwidth, MEMUNIT, "1 GB"),
V(MaxCircuitDirtiness, INTERVAL, "10 minutes"),
- V(MaxClientCircuitsPending, UINT, "32"),
+ V(MaxClientCircuitsPending, POSINT, "32"),
V(MaxConsensusAgeForDiffs, INTERVAL, "0 seconds"),
VAR("MaxMemInQueues", MEMUNIT, MaxMemInQueues_raw, "0"),
OBSOLETE("MaxOnionsPending"),
@@ -539,10 +539,10 @@ static config_var_t option_vars_[] = {
OBSOLETE("WarnUnsafeSocks"),
VAR("NodeFamily", LINELIST, NodeFamilies, NULL),
V(NoExec, BOOL, "0"),
- V(NumCPUs, UINT, "0"),
- V(NumDirectoryGuards, UINT, "0"),
- V(NumEntryGuards, UINT, "0"),
- V(NumPrimaryGuards, UINT, "0"),
+ V(NumCPUs, POSINT, "0"),
+ V(NumDirectoryGuards, POSINT, "0"),
+ V(NumEntryGuards, POSINT, "0"),
+ V(NumPrimaryGuards, POSINT, "0"),
V(OfflineMasterKey, BOOL, "0"),
OBSOLETE("ORListenAddress"),
VPORT(ORPort),
@@ -666,7 +666,7 @@ static config_var_t option_vars_[] = {
V(V3AuthVotingInterval, INTERVAL, "1 hour"),
V(V3AuthVoteDelay, INTERVAL, "5 minutes"),
V(V3AuthDistDelay, INTERVAL, "5 minutes"),
- V(V3AuthNIntervalsValid, UINT, "3"),
+ V(V3AuthNIntervalsValid, POSINT, "3"),
V(V3AuthUseLegacyKey, BOOL, "0"),
V(V3BandwidthsFile, FILENAME, NULL),
V(GuardfractionFile, FILENAME, NULL),
@@ -715,7 +715,7 @@ static config_var_t option_vars_[] = {
* blocked), but we also don't want to fail if only some mirrors are
* blackholed. Clients will try 3 directories simultaneously.
* (Relays never use simultaneous connections.) */
- V(ClientBootstrapConsensusMaxInProgressTries, UINT, "3"),
+ V(ClientBootstrapConsensusMaxInProgressTries, POSINT, "3"),
/* When a client has any running bridges, check each bridge occasionally,
* whether or not that bridge is actually up. */
V(TestingBridgeDownloadInitialDelay, CSV_INTERVAL,"10800"),
@@ -749,7 +749,7 @@ static const config_var_t testing_tor_network_defaults[] = {
V(DirAllowPrivateAddresses, BOOL, "1"),
V(EnforceDistinctSubnets, BOOL, "0"),
V(AssumeReachable, BOOL, "1"),
- V(AuthDirMaxServersPerAddr, UINT, "0"),
+ V(AuthDirMaxServersPerAddr, POSINT, "0"),
V(ClientBootstrapConsensusAuthorityDownloadInitialDelay, CSV_INTERVAL, "0"),
V(ClientBootstrapConsensusFallbackDownloadInitialDelay, CSV_INTERVAL, "0"),
V(ClientBootstrapConsensusAuthorityOnlyDownloadInitialDelay, CSV_INTERVAL,
@@ -8177,7 +8177,7 @@ getinfo_helper_config(control_connection_t *conn,
switch (var->type) {
case CONFIG_TYPE_STRING: type = "String"; break;
case CONFIG_TYPE_FILENAME: type = "Filename"; break;
- case CONFIG_TYPE_UINT: type = "Integer"; break;
+ case CONFIG_TYPE_POSINT: type = "Integer"; break;
case CONFIG_TYPE_UINT64: type = "Integer"; break;
case CONFIG_TYPE_INT: type = "SignedInteger"; break;
case CONFIG_TYPE_PORT: type = "Port"; break;
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 8681f648d..cf83df728 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -181,7 +181,7 @@ config_assign_value(const config_format_t *fmt, void *options,
}
/* fall through */
case CONFIG_TYPE_INT:
- case CONFIG_TYPE_UINT:
+ case CONFIG_TYPE_POSINT:
i = (int)tor_parse_long(c->value, 10,
var->type==CONFIG_TYPE_INT ? INT_MIN : 0,
var->type==CONFIG_TYPE_PORT ? 65535 : INT_MAX,
@@ -580,7 +580,7 @@ config_get_assigned_option(const config_format_t *fmt, const void *options,
case CONFIG_TYPE_CSV_INTERVAL:
case CONFIG_TYPE_INTERVAL:
case CONFIG_TYPE_MSEC_INTERVAL:
- case CONFIG_TYPE_UINT:
+ case CONFIG_TYPE_POSINT:
case CONFIG_TYPE_INT:
/* This means every or_options_t uint or bool element
* needs to be an int. Not, say, a uint16_t or char. */
@@ -786,7 +786,7 @@ config_clear(const config_format_t *fmt, void *options,
case CONFIG_TYPE_CSV_INTERVAL:
case CONFIG_TYPE_INTERVAL:
case CONFIG_TYPE_MSEC_INTERVAL:
- case CONFIG_TYPE_UINT:
+ case CONFIG_TYPE_POSINT:
case CONFIG_TYPE_INT:
case CONFIG_TYPE_PORT:
case CONFIG_TYPE_BOOL:
diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c
index fdfd68b24..c6c5ec14f 100644
--- a/src/app/config/statefile.c
+++ b/src/app/config/statefile.c
@@ -105,19 +105,19 @@ static config_var_t state_vars_[] = {
V(HidServRevCounter, LINELIST, NULL),
V(BWHistoryReadEnds, ISOTIME, NULL),
- V(BWHistoryReadInterval, UINT, "900"),
+ V(BWHistoryReadInterval, POSINT, "900"),
V(BWHistoryReadValues, CSV, ""),
V(BWHistoryReadMaxima, CSV, ""),
V(BWHistoryWriteEnds, ISOTIME, NULL),
- V(BWHistoryWriteInterval, UINT, "900"),
+ V(BWHistoryWriteInterval, POSINT, "900"),
V(BWHistoryWriteValues, CSV, ""),
V(BWHistoryWriteMaxima, CSV, ""),
V(BWHistoryDirReadEnds, ISOTIME, NULL),
- V(BWHistoryDirReadInterval, UINT, "900"),
+ V(BWHistoryDirReadInterval, POSINT, "900"),
V(BWHistoryDirReadValues, CSV, ""),
V(BWHistoryDirReadMaxima, CSV, ""),
V(BWHistoryDirWriteEnds, ISOTIME, NULL),
- V(BWHistoryDirWriteInterval, UINT, "900"),
+ V(BWHistoryDirWriteInterval, POSINT, "900"),
V(BWHistoryDirWriteValues, CSV, ""),
V(BWHistoryDirWriteMaxima, CSV, ""),
@@ -128,12 +128,12 @@ static config_var_t state_vars_[] = {
V(LastRotatedOnionKey, ISOTIME, NULL),
V(LastWritten, ISOTIME, NULL),
- V(TotalBuildTimes, UINT, NULL),
- V(CircuitBuildAbandonedCount, UINT, "0"),
+ V(TotalBuildTimes, POSINT, NULL),
+ V(CircuitBuildAbandonedCount, POSINT, "0"),
VAR("CircuitBuildTimeBin", LINELIST_S, BuildtimeHistogram, NULL),
VAR("BuildtimeHistogram", LINELIST_V, BuildtimeHistogram, NULL),
- V(MinutesSinceUserActivity, UINT, NULL),
+ V(MinutesSinceUserActivity, POSINT, NULL),
V(Dormant, AUTOBOOL, "auto"),
END_OF_CONFIG_VARS
diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c
index b669e3836..b2c7acba1 100644
--- a/src/feature/dirauth/shared_random_state.c
+++ b/src/feature/dirauth/shared_random_state.c
@@ -68,7 +68,7 @@ static void disk_state_free_cb(void *);
/* Array of variables that are saved to disk as a persistent state. */
static config_var_t state_vars[] = {
- V(Version, UINT, "0"),
+ V(Version, POSINT, "0"),
V(TorVersion, STRING, NULL),
V(ValidAfter, ISOTIME, NULL),
V(ValidUntil, ISOTIME, NULL),
1
0

19 Jun '19
commit 4ab1d1c0c44a887417b04fc75b1b11bf246f2bb5
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sat Jun 15 16:47:16 2019 -0400
Fix memleak when failing to parse a CSV_INTERVAL.
Fixes bug 30894; bugfix on 0.3.4.1-alpha
---
changes/bug30894 | 4 ++++
src/app/config/confparse.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/changes/bug30894 b/changes/bug30894
new file mode 100644
index 000000000..64c14c4e6
--- /dev/null
+++ b/changes/bug30894
@@ -0,0 +1,4 @@
+ o Minor bugfixes (memory leaks):
+ - Fix a trivial memory leak when parsing an invalid value
+ from a download schedule in the configuration. Fixes bug
+ 30894; bugfix on 0.3.4.1-alpha.
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 8681f648d..729e7a447 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -225,6 +225,7 @@ config_assign_value(const config_format_t *fmt, void *options,
tor_asprintf(msg,
"Interval '%s %s' is malformed or out of bounds.",
c->key, c->value);
+ tor_free(tmp);
return -1;
}
*(int *)lvalue = i;
1
0

[tor/master] Add more unit tests for confparse.c, so we can refactor.
by dgoulet@torproject.org 19 Jun '19
by dgoulet@torproject.org 19 Jun '19
19 Jun '19
commit 26436fb1b64bd35c1342b71df0284b992d770856
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sat Jun 15 11:24:43 2019 -0400
Add more unit tests for confparse.c, so we can refactor.
This set of tests gets the line coverage to 100%.
---
src/app/config/confparse.c | 21 +-
src/app/config/confparse.h | 5 +
src/test/include.am | 1 +
src/test/test.c | 1 +
src/test/test.h | 1 +
src/test/test_confparse.c | 842 +++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 867 insertions(+), 4 deletions(-)
diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c
index 14d9a368d..e4bb6e89b 100644
--- a/src/app/config/confparse.c
+++ b/src/app/config/confparse.c
@@ -21,6 +21,7 @@
* specified, and a linked list of key-value pairs.
*/
+#define CONFPARSE_PRIVATE
#include "core/or/or.h"
#include "app/config/confparse.h"
#include "feature/nodelist/routerset.h"
@@ -87,7 +88,7 @@ const char *
config_find_deprecation(const config_format_t *fmt, const char *key)
{
if (BUG(fmt == NULL) || BUG(key == NULL))
- return NULL;
+ return NULL; // LCOV_EXCL_LINE
if (fmt->deprecations == NULL)
return NULL;
@@ -352,9 +353,11 @@ config_assign_value(const config_format_t *fmt, void *options,
tor_asprintf(msg,
"You may not provide a value for virtual option '%s'", c->key);
return -1;
+ // LCOV_EXCL_START
default:
- tor_assert(0);
+ tor_assert_unreached();
break;
+ // LCOV_EXCL_STOP
}
return 0;
}
@@ -455,7 +458,9 @@ config_assign_line(const config_format_t *fmt, void *options,
}
return 0;
} else if (c->command == CONFIG_LINE_CLEAR && !clear_first) {
- config_reset(fmt, options, var, use_defaults);
+ // XXXX This is unreachable, since a CLEAR line always has an
+ // XXXX empty value.
+ config_reset(fmt, options, var, use_defaults); // LCOV_EXCL_LINE
}
if (options_seen && (var->type != CONFIG_TYPE_LINELIST &&
@@ -477,7 +482,7 @@ config_assign_line(const config_format_t *fmt, void *options,
/** Restore the option named <b>key</b> in options to its default value.
* Called from config_assign(). */
-static void
+STATIC void
config_reset_line(const config_format_t *fmt, void *options,
const char *key, int use_defaults)
{
@@ -625,12 +630,14 @@ config_get_assigned_option(const config_format_t *fmt, const void *options,
tor_free(result);
result = config_lines_dup(*(const config_line_t**)value);
break;
+ // LCOV_EXCL_START
default:
tor_free(result->key);
tor_free(result);
log_warn(LD_BUG,"Unknown type %d for known key '%s'",
var->type, key);
return NULL;
+ // LCOV_EXCL_STOP
}
if (escape_val) {
@@ -829,8 +836,10 @@ config_reset(const config_format_t *fmt, void *options,
c->key = tor_strdup(var->name);
c->value = tor_strdup(var->initvalue);
if (config_assign_value(fmt, options, c, &msg) < 0) {
+ // LCOV_EXCL_START
log_warn(LD_BUG, "Failed to assign default: %s", msg);
tor_free(msg); /* if this happens it's a bug */
+ // LCOV_EXCL_STOP
}
config_free_lines(c);
}
@@ -896,10 +905,12 @@ config_dup(const config_format_t *fmt, const void *old)
if (line) {
char *msg = NULL;
if (config_assign(fmt, newopts, line, 0, &msg) < 0) {
+ // LCOV_EXCL_START
log_err(LD_BUG, "config_get_assigned_option() generated "
"something we couldn't config_assign(): %s", msg);
tor_free(msg);
tor_assert(0);
+ // LCOV_EXCL_STOP
}
}
config_free_lines(line);
@@ -948,9 +959,11 @@ config_dump(const config_format_t *fmt, const void *default_options,
/* XXX use a 1 here so we don't add a new log line while dumping */
if (default_options == NULL) {
if (fmt->validate_fn(NULL, defaults_tmp, defaults_tmp, 1, &msg) < 0) {
+ // LCOV_EXCL_START
log_err(LD_BUG, "Failed to validate default config: %s", msg);
tor_free(msg);
tor_assert(0);
+ // LCOV_EXCL_STOP
}
}
diff --git a/src/app/config/confparse.h b/src/app/config/confparse.h
index 2c923eb6b..2112abf71 100644
--- a/src/app/config/confparse.h
+++ b/src/app/config/confparse.h
@@ -228,4 +228,9 @@ void warn_deprecated_option(const char *what, const char *why);
#define CFG_EQ_LINELIST(a,b,opt) config_lines_eq((a)->opt, (b)->opt)
#define CFG_EQ_ROUTERSET(a,b,opt) routerset_equal((a)->opt, (b)->opt)
+#ifdef CONFPARSE_PRIVATE
+STATIC void config_reset_line(const config_format_t *fmt, void *options,
+ const char *key, int use_defaults);
+#endif
+
#endif /* !defined(TOR_CONFPARSE_H) */
diff --git a/src/test/include.am b/src/test/include.am
index 624bca66d..0ec4d96ad 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -120,6 +120,7 @@ src_test_test_SOURCES += \
src/test/test_circuitstats.c \
src/test/test_compat_libevent.c \
src/test/test_config.c \
+ src/test/test_confparse.c \
src/test/test_connection.c \
src/test/test_conscache.c \
src/test/test_consdiff.c \
diff --git a/src/test/test.c b/src/test/test.c
index cc0853170..266b7454a 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -840,6 +840,7 @@ struct testgroup_t testgroups[] = {
{ "circuituse/", circuituse_tests },
{ "compat/libevent/", compat_libevent_tests },
{ "config/", config_tests },
+ { "config/parse/", confparse_tests },
{ "connection/", connection_tests },
{ "conscache/", conscache_tests },
{ "consdiff/", consdiff_tests },
diff --git a/src/test/test.h b/src/test/test.h
index 85e8b07ff..322716a9a 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -197,6 +197,7 @@ extern struct testcase_t circuitstats_tests[];
extern struct testcase_t circuituse_tests[];
extern struct testcase_t compat_libevent_tests[];
extern struct testcase_t config_tests[];
+extern struct testcase_t confparse_tests[];
extern struct testcase_t connection_tests[];
extern struct testcase_t conscache_tests[];
extern struct testcase_t consdiff_tests[];
diff --git a/src/test/test_confparse.c b/src/test/test_confparse.c
new file mode 100644
index 000000000..89a6eb526
--- /dev/null
+++ b/src/test/test_confparse.c
@@ -0,0 +1,842 @@
+/* Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2019, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/*
+ * Tests for confparse.c module that we use to parse various
+ * configuration/state file types.
+ */
+
+#define CONFPARSE_PRIVATE
+#include "orconfig.h"
+
+#include "core/or/or.h"
+#include "lib/encoding/confline.h"
+#include "feature/nodelist/routerset.h"
+#include "app/config/confparse.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+
+typedef struct test_struct_t {
+ uint32_t magic;
+ char *s;
+ char *fn;
+ int pos;
+ int i;
+ int deprecated_int;
+ uint64_t u64;
+ int interval;
+ int msec_interval;
+ uint64_t mem;
+ double dbl;
+ int boolean;
+ int autobool;
+ time_t time;
+ smartlist_t *csv;
+ int csv_interval;
+ config_line_t *lines;
+ config_line_t *mixed_lines;
+ routerset_t *routerset;
+ int hidden_int;
+ config_line_t *mixed_hidden_lines;
+
+ config_line_t *extra_lines;
+} test_struct_t;
+
+static test_struct_t test_struct_t_dummy;
+
+#define VAR(name,conftype,member,initvalue) \
+ { name, CONFIG_TYPE_##conftype, offsetof(test_struct_t, member), \
+ initvalue CONF_TEST_MEMBERS(test_struct_t, conftype, member) }
+
+#define V(name,conftype,initvalue) \
+ VAR( #name, conftype, name, initvalue )
+
+#define OBSOLETE(name) \
+ { name, CONFIG_TYPE_OBSOLETE, 0, NULL, {.INT=NULL} }
+
+static config_var_t test_vars[] = {
+ V(s, STRING, "hello"),
+ V(fn, FILENAME, NULL),
+ V(pos, POSINT, NULL),
+ V(i, INT, "-10"),
+ V(deprecated_int, INT, "3"),
+ V(u64, UINT64, NULL),
+ V(interval, INTERVAL, "10 seconds"),
+ V(msec_interval, MSEC_INTERVAL, "150 msec"),
+ V(mem, MEMUNIT, "10 MB"),
+ V(dbl, DOUBLE, NULL),
+ V(boolean, BOOL, "0"),
+ V(autobool, AUTOBOOL, "auto"),
+ V(time, ISOTIME, NULL),
+ V(csv, CSV, NULL),
+ V(csv_interval, CSV_INTERVAL, "5 seconds"),
+ V(lines, LINELIST, NULL),
+ VAR("MixedLines", LINELIST_V, mixed_lines, NULL),
+ VAR("LineTypeA", LINELIST_S, mixed_lines, NULL),
+ VAR("LineTypeB", LINELIST_S, mixed_lines, NULL),
+ OBSOLETE("obsolete"),
+ V(routerset, ROUTERSET, NULL),
+ VAR("__HiddenInt", POSINT, hidden_int, "0"),
+ VAR("MixedHiddenLines", LINELIST_V, mixed_hidden_lines, NULL),
+ VAR("__HiddenLineA", LINELIST_S, mixed_hidden_lines, NULL),
+ VAR("VisibleLineB", LINELIST_S, mixed_hidden_lines, NULL),
+
+ END_OF_CONFIG_VARS,
+};
+
+static config_abbrev_t test_abbrevs[] = {
+ { "uint", "pos", 0, 0 },
+ { "float", "dbl", 0, 1 },
+ { NULL, NULL, 0, 0 }
+};
+
+static config_deprecation_t test_deprecation_notes[] = {
+ { "deprecated_int", "This integer is deprecated." },
+ { NULL, NULL }
+};
+
+static int
+test_validate_cb(void *old_options, void *options, void *default_options,
+ int from_setconf, char **msg)
+{
+ (void)old_options;
+ (void)default_options;
+ (void)from_setconf;
+ (void)msg;
+ test_struct_t *ts = options;
+
+ if (ts->i == 0xbad) {
+ *msg = tor_strdup("bad value for i");
+ return -1;
+ }
+ return 0;
+}
+
+static void test_free_cb(void *options);
+
+#define TEST_MAGIC 0x1337
+
+static config_format_t test_fmt = {
+ sizeof(test_struct_t),
+ TEST_MAGIC,
+ offsetof(test_struct_t, magic),
+ test_abbrevs,
+ test_deprecation_notes,
+ test_vars,
+ test_validate_cb,
+ test_free_cb,
+ NULL,
+};
+
+static void
+test_free_cb(void *options)
+{
+ if (!options)
+ return;
+
+ config_free(&test_fmt, options);
+}
+
+/* Make sure that config_init sets everything to the right defaults. */
+static void
+test_confparse_init(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_init(&test_fmt, tst);
+
+ // Make sure that options are initialized right. */
+ tt_uint_op(tst->magic, OP_EQ, TEST_MAGIC);
+ tt_str_op(tst->s, OP_EQ, "hello");
+ tt_ptr_op(tst->fn, OP_EQ, NULL);
+ tt_int_op(tst->pos, OP_EQ, 0);
+ tt_int_op(tst->i, OP_EQ, -10);
+ tt_int_op(tst->deprecated_int, OP_EQ, 3);
+ tt_u64_op(tst->u64, OP_EQ, 0);
+ tt_int_op(tst->interval, OP_EQ, 10);
+ tt_int_op(tst->msec_interval, OP_EQ, 150);
+ tt_u64_op(tst->mem, OP_EQ, 10 * 1024 * 1024);
+ tt_double_op(tst->dbl, OP_LT, .0000000001);
+ tt_double_op(tst->dbl, OP_GT, -0.0000000001);
+ tt_int_op(tst->boolean, OP_EQ, 0);
+ tt_int_op(tst->autobool, OP_EQ, -1);
+ tt_i64_op(tst->time, OP_EQ, 0);
+ tt_ptr_op(tst->csv, OP_EQ, NULL);
+ tt_int_op(tst->csv_interval, OP_EQ, 5);
+ tt_ptr_op(tst->lines, OP_EQ, NULL);
+ tt_ptr_op(tst->mixed_lines, OP_EQ, NULL);
+ tt_int_op(tst->hidden_int, OP_EQ, 0);
+
+ done:
+ config_free(&test_fmt, tst);
+}
+
+static const char simple_settings[] =
+ "s this is a \n"
+ "fn /simple/test of the\n"
+ "uint 77\n" // this is an abbrev
+ "i 3\n"
+ "u64 1000000000000 \n"
+ "interval 5 minutes \n"
+ "msec_interval 5 minutes \n"
+ "mem 10\n"
+ "dbl 6.060842\n"
+ "BOOLEAN 1\n"
+ "aUtObOOl 0\n"
+ "time 2019-06-14 13:58:51\n"
+ "csv configuration, parsing , system \n"
+ "csv_interval 10 seconds, 5 seconds, 10 hours\n"
+ "lines hello\n"
+ "LINES world\n"
+ "linetypea i d\n"
+ "linetypeb i c\n"
+ "routerset $FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n"
+ "__hiddenint 11\n"
+ "__hiddenlineA XYZ\n"
+ "visiblelineB ABC\n";
+
+/* Return a configuration object set up from simple_settings above. */
+static test_struct_t *
+get_simple_config(void)
+{
+ test_struct_t *result = NULL;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines(simple_settings, &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+
+ result = tst;
+ tst = NULL; // prevent free
+ done:
+ tor_free(msg);
+ config_free_lines(lines);
+ config_free(&test_fmt, tst);
+ return result;
+}
+
+/* Make sure that config_assign can parse things. */
+static void
+test_confparse_assign_simple(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = get_simple_config();
+
+ tt_str_op(tst->s, OP_EQ, "this is a");
+ tt_str_op(tst->fn, OP_EQ, "/simple/test of the");
+ tt_int_op(tst->pos, OP_EQ, 77);
+ tt_int_op(tst->i, OP_EQ, 3);
+ tt_int_op(tst->deprecated_int, OP_EQ, 3);
+ tt_u64_op(tst->u64, OP_EQ, UINT64_C(1000000000000));
+ tt_int_op(tst->interval, OP_EQ, 5 * 60);
+ tt_int_op(tst->msec_interval, OP_EQ, 5 * 60 * 1000);
+ tt_u64_op(tst->mem, OP_EQ, 10);
+ tt_double_op(tst->dbl, OP_LT, 6.060843);
+ tt_double_op(tst->dbl, OP_GT, 6.060841);
+ tt_int_op(tst->boolean, OP_EQ, 1);
+ tt_int_op(tst->autobool, OP_EQ, 0);
+ tt_i64_op(tst->time, OP_EQ, 1560520731);
+ tt_ptr_op(tst->csv, OP_NE, NULL);
+ tt_int_op(smartlist_len(tst->csv), OP_EQ, 3);
+ tt_str_op(smartlist_get(tst->csv, 0), OP_EQ, "configuration");
+ tt_str_op(smartlist_get(tst->csv, 1), OP_EQ, "parsing");
+ tt_str_op(smartlist_get(tst->csv, 2), OP_EQ, "system");
+ tt_int_op(tst->csv_interval, OP_EQ, 10);
+ tt_int_op(tst->hidden_int, OP_EQ, 11);
+
+ tt_assert(tst->lines);
+ tt_str_op(tst->lines->key, OP_EQ, "lines");
+ tt_str_op(tst->lines->value, OP_EQ, "hello");
+ tt_assert(tst->lines->next);
+ tt_str_op(tst->lines->next->key, OP_EQ, "lines");
+ tt_str_op(tst->lines->next->value, OP_EQ, "world");
+ tt_assert(!tst->lines->next->next);
+
+ tt_assert(tst->mixed_lines);
+ tt_str_op(tst->mixed_lines->key, OP_EQ, "LineTypeA");
+ tt_str_op(tst->mixed_lines->value, OP_EQ, "i d");
+ tt_assert(tst->mixed_lines->next);
+ tt_str_op(tst->mixed_lines->next->key, OP_EQ, "LineTypeB");
+ tt_str_op(tst->mixed_lines->next->value, OP_EQ, "i c");
+ tt_assert(!tst->mixed_lines->next->next);
+
+ tt_assert(tst->mixed_hidden_lines);
+ tt_str_op(tst->mixed_hidden_lines->key, OP_EQ, "__HiddenLineA");
+ tt_str_op(tst->mixed_hidden_lines->value, OP_EQ, "XYZ");
+ tt_assert(tst->mixed_hidden_lines->next);
+ tt_str_op(tst->mixed_hidden_lines->next->key, OP_EQ, "VisibleLineB");
+ tt_str_op(tst->mixed_hidden_lines->next->value, OP_EQ, "ABC");
+ tt_assert(!tst->mixed_hidden_lines->next->next);
+
+ done:
+ config_free(&test_fmt, tst);
+}
+
+/* Try to assign to an obsolete option, and make sure we get a warning. */
+static void
+test_confparse_assign_obsolete(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines("obsolete option here",
+ &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ setup_capture_of_logs(LOG_WARN);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ expect_single_log_msg_containing("Skipping obsolete configuration option");
+
+ done:
+ teardown_capture_of_logs();
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+/* Try to assign to an deprecated option, and make sure we get a warning
+ * but the assignment works anyway. */
+static void
+test_confparse_assign_deprecated(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines("deprecated_int 7",
+ &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ setup_capture_of_logs(LOG_WARN);
+ r = config_assign(&test_fmt, tst, lines, CAL_WARN_DEPRECATIONS, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ expect_single_log_msg_containing("This integer is deprecated.");
+
+ tt_int_op(tst->deprecated_int, OP_EQ, 7);
+
+ done:
+ teardown_capture_of_logs();
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+/* Try to re-assign an option name that has been depreacted in favor of
+ * another. */
+static void
+test_confparse_assign_replaced(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines("float 1000\n", &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ setup_capture_of_logs(LOG_WARN);
+ r = config_assign(&test_fmt, tst, lines, CAL_WARN_DEPRECATIONS, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ expect_single_log_msg_containing("use 'dbl' instead.");
+
+ tt_double_op(tst->dbl, OP_GT, 999.999);
+ tt_double_op(tst->dbl, OP_LT, 1000.001);
+
+ done:
+ teardown_capture_of_logs();
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+/* Try to set a linelist value with no option. */
+static void
+test_confparse_assign_emptystring(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines("lines\n", &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ setup_capture_of_logs(LOG_WARN);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ expect_single_log_msg_containing("has no value");
+
+ done:
+ teardown_capture_of_logs();
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+/* Try to set a the same option twice; make sure we get a warning. */
+static void
+test_confparse_assign_twice(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines("pos 10\n"
+ "pos 99\n", &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ setup_capture_of_logs(LOG_WARN);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ expect_single_log_msg_containing("used more than once");
+
+ done:
+ teardown_capture_of_logs();
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+typedef struct badval_test_t {
+ const char *cfg;
+ const char *expect_msg;
+} badval_test_t;
+
+/* Try to set an option and make sure that we get a failure and an expected
+ * warning. */
+static void
+test_confparse_assign_badval(void *arg)
+{
+ const badval_test_t *bt = arg;
+ test_struct_t *tst = config_new(&test_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ config_init(&test_fmt, tst);
+
+ int r = config_get_lines(bt->cfg, &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ setup_capture_of_logs(LOG_WARN);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_LT, 0);
+ tt_ptr_op(msg, OP_NE, NULL);
+ if (! strstr(msg, bt->expect_msg)) {
+ TT_DIE(("'%s' did not contain '%s'" , msg, bt->expect_msg));
+ }
+
+ done:
+ teardown_capture_of_logs();
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+/* Various arguments for badval test.
+ *
+ * Note that the expected warnings here are _very_ truncated, since we
+ * are writing these tests before a refactoring that we expect will
+ * change them.
+ */
+static const badval_test_t bv_notint = { "pos X\n", "malformed" };
+static const badval_test_t bv_negint = { "pos -10\n", "out of bounds" };
+static const badval_test_t bv_badu64 = { "u64 u64\n", "malformed" };
+static const badval_test_t bv_badcsvi1 =
+ { "csv_interval 10 wl\n", "malformed" };
+static const badval_test_t bv_badcsvi2 =
+ { "csv_interval cl,10\n", "malformed" };
+static const badval_test_t bv_nonoption = { "fnord 10\n", "Unknown option" };
+static const badval_test_t bv_badmem = { "mem 3 trits\n", "malformed" };
+static const badval_test_t bv_badbool = { "boolean 7\n", "expects 0 or 1" };
+static const badval_test_t bv_badabool =
+ { "autobool 7\n", "expects 0, 1, or 'auto'" };
+static const badval_test_t bv_badtime = { "time lunchtime\n", "Invalid time" };
+static const badval_test_t bv_virt = { "MixedLines 7\n", "virtual option" };
+static const badval_test_t bv_rs = { "Routerset 2.2.2.2.2\n", "Invalid" };
+
+/* Try config_dump(), and make sure it behaves correctly */
+static void
+test_confparse_dump(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = get_simple_config();
+ char *dumped = NULL;
+
+ /* Minimal version. */
+ dumped = config_dump(&test_fmt, NULL, tst, 1, 0);
+ tt_str_op(dumped, OP_EQ,
+ "s this is a\n"
+ "fn /simple/test of the\n"
+ "pos 77\n"
+ "i 3\n"
+ "u64 1000000000000\n"
+ "interval 300\n"
+ "msec_interval 300000\n"
+ "mem 10\n"
+ "dbl 6.060842\n"
+ "boolean 1\n"
+ "autobool 0\n"
+ "time 2019-06-14 13:58:51\n"
+ "csv configuration,parsing,system\n"
+ "csv_interval 10\n"
+ "lines hello\n"
+ "lines world\n"
+ "LineTypeA i d\n"
+ "LineTypeB i c\n"
+ "routerset $FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n"
+ "VisibleLineB ABC\n");
+
+ /* Maximal */
+ tor_free(dumped);
+ dumped = config_dump(&test_fmt, NULL, tst, 0, 0);
+ tt_str_op(dumped, OP_EQ,
+ "s this is a\n"
+ "fn /simple/test of the\n"
+ "pos 77\n"
+ "i 3\n"
+ "deprecated_int 3\n"
+ "u64 1000000000000\n"
+ "interval 300\n"
+ "msec_interval 300000\n"
+ "mem 10\n"
+ "dbl 6.060842\n"
+ "boolean 1\n"
+ "autobool 0\n"
+ "time 2019-06-14 13:58:51\n"
+ "csv configuration,parsing,system\n"
+ "csv_interval 10\n"
+ "lines hello\n"
+ "lines world\n"
+ "LineTypeA i d\n"
+ "LineTypeB i c\n"
+ "routerset $FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n"
+ "VisibleLineB ABC\n");
+
+ /* commented */
+ tor_free(dumped);
+ dumped = config_dump(&test_fmt, NULL, tst, 0, 1);
+ tt_str_op(dumped, OP_EQ,
+ "s this is a\n"
+ "fn /simple/test of the\n"
+ "pos 77\n"
+ "i 3\n"
+ "# deprecated_int 3\n"
+ "u64 1000000000000\n"
+ "interval 300\n"
+ "msec_interval 300000\n"
+ "mem 10\n"
+ "dbl 6.060842\n"
+ "boolean 1\n"
+ "autobool 0\n"
+ "time 2019-06-14 13:58:51\n"
+ "csv configuration,parsing,system\n"
+ "csv_interval 10\n"
+ "lines hello\n"
+ "lines world\n"
+ "LineTypeA i d\n"
+ "LineTypeB i c\n"
+ "routerset $FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n"
+ "VisibleLineB ABC\n");
+
+ done:
+ config_free(&test_fmt, tst);
+ tor_free(dumped);
+}
+
+/* Try confparse_reset_line(), and make sure it behaves correctly */
+static void
+test_confparse_reset(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = get_simple_config();
+
+ config_reset_line(&test_fmt, tst, "interval", 0);
+ tt_int_op(tst->interval, OP_EQ, 0);
+
+ config_reset_line(&test_fmt, tst, "interval", 1);
+ tt_int_op(tst->interval, OP_EQ, 10);
+
+ done:
+ config_free(&test_fmt, tst);
+}
+
+/* Try setting options a second time on a config object, and make sure
+ * it behaves correctly. */
+static void
+test_confparse_reassign(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = get_simple_config();
+ config_line_t *lines = NULL;
+ char *msg = NULL, *rs = NULL;
+
+ int r = config_get_lines(
+ "s eleven\n"
+ "i 12\n"
+ "lines 13\n"
+ "csv 14,15\n"
+ "routerset 127.0.0.1\n",
+ &lines, 0);
+ r = config_assign(&test_fmt, tst,lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+
+ tt_str_op(tst->s, OP_EQ, "eleven");
+ tt_str_op(tst->fn, OP_EQ, "/simple/test of the"); // unchanged
+ tt_int_op(tst->pos, OP_EQ, 77); // unchanged
+ tt_int_op(tst->i, OP_EQ, 12);
+ tt_ptr_op(tst->lines, OP_NE, NULL);
+ tt_str_op(tst->lines->key, OP_EQ, "lines");
+ tt_str_op(tst->lines->value, OP_EQ, "13");
+ tt_ptr_op(tst->lines->next, OP_EQ, NULL);
+ tt_int_op(smartlist_len(tst->csv), OP_EQ, 2);
+ tt_str_op(smartlist_get(tst->csv, 0), OP_EQ, "14");
+ tt_str_op(smartlist_get(tst->csv, 1), OP_EQ, "15");
+
+ rs = routerset_to_string(tst->routerset);
+ tt_str_op(rs, OP_EQ, "127.0.0.1");
+
+ // Try again with the CLEAR_FIRST and USE_DEFAULTS flags
+ r = config_assign(&test_fmt, tst, lines,
+ CAL_CLEAR_FIRST|CAL_USE_DEFAULTS, &msg);
+ tt_int_op(r, OP_EQ, 0);
+
+ tt_ptr_op(msg, OP_EQ, NULL);
+ tt_str_op(tst->s, OP_EQ, "eleven");
+ // tt_ptr_op(tst->fn, OP_EQ, NULL); //XXXX why is this not cleared?
+ // tt_int_op(tst->pos, OP_EQ, 0); //XXXX why is this not cleared?
+ tt_int_op(tst->i, OP_EQ, 12);
+
+ done:
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+ tor_free(rs);
+}
+
+/* Try setting options a second time on a config object, using the +foo
+ * linelist-extending syntax. */
+static void
+test_confparse_reassign_extend(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = get_simple_config();
+ config_line_t *lines = NULL;
+ char *msg = NULL;
+
+ int r = config_get_lines(
+ "+lines 13\n",
+ &lines, 1); // allow extended format.
+ tt_int_op(r, OP_EQ, 0);
+ r = config_assign(&test_fmt, tst,lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+
+ tt_assert(tst->lines);
+ tt_str_op(tst->lines->key, OP_EQ, "lines");
+ tt_str_op(tst->lines->value, OP_EQ, "hello");
+ tt_assert(tst->lines->next);
+ tt_str_op(tst->lines->next->key, OP_EQ, "lines");
+ tt_str_op(tst->lines->next->value, OP_EQ, "world");
+ tt_assert(tst->lines->next->next);
+ tt_str_op(tst->lines->next->next->key, OP_EQ, "lines");
+ tt_str_op(tst->lines->next->next->value, OP_EQ, "13");
+ tt_assert(tst->lines->next->next->next == NULL);
+ config_free_lines(lines);
+
+ r = config_get_lines(
+ "/lines\n",
+ &lines, 1); // allow extended format.
+ tt_int_op(r, OP_EQ, 0);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ tt_assert(tst->lines == NULL);
+ config_free_lines(lines);
+
+ config_free(&test_fmt, tst);
+ tst = get_simple_config();
+ r = config_get_lines(
+ "/lines away!\n",
+ &lines, 1); // allow extended format.
+ tt_int_op(r, OP_EQ, 0);
+ r = config_assign(&test_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+ tt_assert(tst->lines == NULL);
+
+ done:
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+ tor_free(msg);
+}
+
+/* Test out confparse_get_assigned(). */
+static void
+test_confparse_get_assigned(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = get_simple_config();
+ config_line_t *lines = NULL;
+
+ lines = config_get_assigned_option(&test_fmt, tst, "I", 1);
+ tt_assert(lines);
+ tt_str_op(lines->key, OP_EQ, "i");
+ tt_str_op(lines->value, OP_EQ, "3");
+ tt_assert(lines->next == NULL);
+ config_free_lines(lines);
+
+ lines = config_get_assigned_option(&test_fmt, tst, "s", 1);
+ tt_assert(lines);
+ tt_str_op(lines->key, OP_EQ, "s");
+ tt_str_op(lines->value, OP_EQ, "this is a");
+ tt_assert(lines->next == NULL);
+ config_free_lines(lines);
+
+ lines = config_get_assigned_option(&test_fmt, tst, "obsolete", 1);
+ tt_assert(!lines);
+
+ lines = config_get_assigned_option(&test_fmt, tst, "nonesuch", 1);
+ tt_assert(!lines);
+
+ lines = config_get_assigned_option(&test_fmt, tst, "mixedlines", 1);
+ tt_assert(lines);
+ tt_str_op(lines->key, OP_EQ, "LineTypeA");
+ tt_str_op(lines->value, OP_EQ, "i d");
+ tt_assert(lines->next);
+ tt_str_op(lines->next->key, OP_EQ, "LineTypeB");
+ tt_str_op(lines->next->value, OP_EQ, "i c");
+ tt_assert(lines->next->next == NULL);
+ config_free_lines(lines);
+
+ lines = config_get_assigned_option(&test_fmt, tst, "linetypeb", 1);
+ tt_assert(lines);
+ tt_str_op(lines->key, OP_EQ, "LineTypeB");
+ tt_str_op(lines->value, OP_EQ, "i c");
+ tt_assert(lines->next == NULL);
+ config_free_lines(lines);
+
+ tor_free(tst->s);
+ tst->s = tor_strdup("Hello\nWorld");
+ lines = config_get_assigned_option(&test_fmt, tst, "s", 1);
+ tt_assert(lines);
+ tt_str_op(lines->key, OP_EQ, "s");
+ tt_str_op(lines->value, OP_EQ, "\"Hello\\nWorld\"");
+ tt_assert(lines->next == NULL);
+ config_free_lines(lines);
+
+ done:
+ config_free(&test_fmt, tst);
+ config_free_lines(lines);
+}
+
+/* Another variant, which accepts and stores unrecognized lines.*/
+#define ETEST_MAGIC 13371337
+
+static config_var_t extra = VAR("__extra", LINELIST, extra_lines, NULL);
+
+static config_format_t etest_fmt = {
+ sizeof(test_struct_t),
+ ETEST_MAGIC,
+ offsetof(test_struct_t, magic),
+ test_abbrevs,
+ test_deprecation_notes,
+ test_vars,
+ test_validate_cb,
+ test_free_cb,
+ &extra,
+};
+
+/* Try out the feature where we can store unrecognized lines and dump them
+ * again. (State files use this.) */
+static void
+test_confparse_extra_lines(void *arg)
+{
+ (void)arg;
+ test_struct_t *tst = config_new(&etest_fmt);
+ config_line_t *lines = NULL;
+ char *msg = NULL, *dump = NULL;
+
+ config_init(&etest_fmt, tst);
+
+ int r = config_get_lines(
+ "unknotty addita\n"
+ "pos 99\n"
+ "wombat knish\n", &lines, 0);
+ tt_int_op(r, OP_EQ, 0);
+ r = config_assign(&etest_fmt, tst, lines, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_ptr_op(msg, OP_EQ, NULL);
+
+ tt_assert(tst->extra_lines);
+
+ dump = config_dump(&etest_fmt, NULL, tst, 1, 0);
+ tt_str_op(dump, OP_EQ,
+ "pos 99\n"
+ "unknotty addita\n"
+ "wombat knish\n");
+
+ done:
+ tor_free(msg);
+ tor_free(dump);
+ config_free_lines(lines);
+ config_free(&etest_fmt, tst);
+}
+
+#define CONFPARSE_TEST(name, flags) \
+ { #name, test_confparse_ ## name, flags, NULL, NULL }
+
+#define BADVAL_TEST(name) \
+ { "badval_" #name, test_confparse_assign_badval, 0, \
+ &passthrough_setup, (void*)&bv_ ## name }
+
+struct testcase_t confparse_tests[] = {
+ CONFPARSE_TEST(init, 0),
+ CONFPARSE_TEST(assign_simple, 0),
+ CONFPARSE_TEST(assign_obsolete, 0),
+ CONFPARSE_TEST(assign_deprecated, 0),
+ CONFPARSE_TEST(assign_replaced, 0),
+ CONFPARSE_TEST(assign_emptystring, 0),
+ CONFPARSE_TEST(assign_twice, 0),
+ BADVAL_TEST(notint),
+ BADVAL_TEST(negint),
+ BADVAL_TEST(badu64),
+ BADVAL_TEST(badcsvi1),
+ BADVAL_TEST(badcsvi2),
+ BADVAL_TEST(nonoption),
+ BADVAL_TEST(badmem),
+ BADVAL_TEST(badbool),
+ BADVAL_TEST(badabool),
+ BADVAL_TEST(badtime),
+ BADVAL_TEST(virt),
+ BADVAL_TEST(rs),
+ CONFPARSE_TEST(dump, 0),
+ CONFPARSE_TEST(reset, 0),
+ CONFPARSE_TEST(reassign, 0),
+ CONFPARSE_TEST(reassign_extend, 0),
+ CONFPARSE_TEST(get_assigned, 0),
+ CONFPARSE_TEST(extra_lines, 0),
+ END_OF_TESTCASES
+};
1
0

19 Jun '19
commit 4613159c61549a4901690da5ecd5101eb6a20736
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sat Jun 15 16:19:25 2019 -0400
Changes file for ticket 30893 (confparse testing)
---
changes/ticket30893 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/changes/ticket30893 b/changes/ticket30893
new file mode 100644
index 000000000..e1b56d218
--- /dev/null
+++ b/changes/ticket30893
@@ -0,0 +1,3 @@
+ o Minor features (testing)P:
+ - Improve test coverage for our existing configuration parsing and
+ management API. Closes ticket 30893.
1
0

19 Jun '19
commit 7c6cc470f181cc2e9d8e3f6e2a36611de6fb0fdd
Merge: 4613159c6 4ab1d1c0c
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sat Jun 15 16:50:02 2019 -0400
Merge branch 'bug30894_035' into ticket30893
changes/bug30894 | 4 ++++
src/app/config/confparse.c | 1 +
2 files changed, 5 insertions(+)
1
0
commit e6579d801f2a7536123dccde2edcff4cc33683a3
Merge: 125a6300d 7c6cc470f
Author: David Goulet <dgoulet(a)torproject.org>
Date: Wed Jun 19 07:47:03 2019 -0400
Merge branch 'tor-github/pr/1113'
changes/bug30894 | 4 +
changes/ticket30893 | 3 +
src/app/config/config.c | 31 +-
src/app/config/confparse.c | 44 +-
src/app/config/confparse.h | 13 +-
src/app/config/statefile.c | 14 +-
src/feature/dirauth/shared_random_state.c | 2 +-
src/test/include.am | 1 +
src/test/test.c | 1 +
src/test/test.h | 1 +
src/test/test_confparse.c | 842 ++++++++++++++++++++++++++++++
11 files changed, 905 insertions(+), 51 deletions(-)
1
0

19 Jun '19
commit 91c7d395cf7c62f8ccf3261132cb5d71972f79ae
Author: David Goulet <dgoulet(a)torproject.org>
Date: Wed Jun 19 07:50:02 2019 -0400
changes: Fix typo in changes/ticket30893
Signed-off-by: David Goulet <dgoulet(a)torproject.org>
---
changes/ticket30893 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/changes/ticket30893 b/changes/ticket30893
index e1b56d218..638b99a9f 100644
--- a/changes/ticket30893
+++ b/changes/ticket30893
@@ -1,3 +1,3 @@
- o Minor features (testing)P:
+ o Minor features (testing):
- Improve test coverage for our existing configuration parsing and
management API. Closes ticket 30893.
1
0

[translation/donatepages-messagespot] Update translations for donatepages-messagespot
by translation@torproject.org 19 Jun '19
by translation@torproject.org 19 Jun '19
19 Jun '19
commit 37989d10af80342a3f754ccd11fa3867b8ba3076
Author: Translation commit bot <translation(a)torproject.org>
Date: Wed Jun 19 11:45:38 2019 +0000
Update translations for donatepages-messagespot
---
locale/pl/LC_MESSAGES/messages.po | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/locale/pl/LC_MESSAGES/messages.po b/locale/pl/LC_MESSAGES/messages.po
index e8ec641fe..8c0945317 100644
--- a/locale/pl/LC_MESSAGES/messages.po
+++ b/locale/pl/LC_MESSAGES/messages.po
@@ -9,12 +9,12 @@
# AreYouLoco? <areyouloco(a)paranoici.org>, 2019
# erinm, 2019
# Waldemar Stoczkowski, 2019
-# Dawid Potocki <dpot(a)disroot.org>, 2019
# Filip <filipiczesio(a)vp.pl>, 2019
+# Dawid Potocki <dpot(a)disroot.org>, 2019
#
msgid ""
msgstr ""
-"Last-Translator: Filip <filipiczesio(a)vp.pl>, 2019\n"
+"Last-Translator: Dawid Potocki <dpot(a)disroot.org>, 2019\n"
"Language-Team: Polish (https://www.transifex.com/otf/teams/1519/pl/)\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
@@ -818,7 +818,7 @@ msgstr "@torproject"
#: tmp/cache_locale/66/666e9197f427d70c0743bcdae2c3e34f41f9d7acf2b2dddb2c21c21723e73d10.php:101
msgid "Become a Defender of Privacy!"
-msgstr ""
+msgstr "Zostań Obrońcą Prywatności!"
#: tmp/cache_locale/66/666e9197f427d70c0743bcdae2c3e34f41f9d7acf2b2dddb2c21c21723e73d10.php:105
msgid ""
1
0