mirror of
https://github.com/systemd/systemd
synced 2025-10-04 11:14:45 +02:00
Compare commits
14 Commits
467ff7929f
...
0d2679ab16
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0d2679ab16 | ||
![]() |
d1aa2f20a9 | ||
![]() |
e02e36b192 | ||
![]() |
c5df8c2323 | ||
![]() |
57fbe401f5 | ||
![]() |
0140f26046 | ||
![]() |
8757987ec2 | ||
![]() |
aa9ff03f1e | ||
![]() |
cb372a3ce4 | ||
![]() |
9c11175db9 | ||
![]() |
858cb6e49e | ||
![]() |
f55219c1aa | ||
![]() |
514885b240 | ||
![]() |
225450d043 |
@ -50,6 +50,22 @@ See [reporting of security vulnerabilities](https://systemd.io/SECURITY).
|
|||||||
* Github will automatically add the `please-review` label when a pull request is opened or updated.
|
* Github will automatically add the `please-review` label when a pull request is opened or updated.
|
||||||
If you need more information after a review, you can comment `/please-review` on the pull request to have Github add the `please-review` label to the pull request.
|
If you need more information after a review, you can comment `/please-review` on the pull request to have Github add the `please-review` label to the pull request.
|
||||||
|
|
||||||
|
## Using AI Code Generators
|
||||||
|
|
||||||
|
If you use an AI code generator such as ChatGPT, Claude, Copilot, Llama or a similar tool, this must be
|
||||||
|
disclosed in the commit messages and pull request description.
|
||||||
|
|
||||||
|
The quality bar for contributions to this project is high, and unlikely to be met by an unattended AI tool,
|
||||||
|
without significant manual corrections. Always thoroughly review and correct any such outputs, for example
|
||||||
|
ensuring it accurately follows [Coding Style](https://systemd.io/CODING_STYLE) at the very minimum. Please do
|
||||||
|
not fire-and-forget pull requests without any human intervention and review, as that will likely result in
|
||||||
|
low-quality results that will not be accepted, and if done repeatedly, may result in the account being
|
||||||
|
blocked. As with any other submissions, authors are responsible for doing due diligence and ensuring their
|
||||||
|
submissions are compatible with the project's license as documented in LICENSES/README.md.
|
||||||
|
|
||||||
|
As a guideline, if someone notices that a contribution (code, issues, comments) was made with the help of AI,
|
||||||
|
there was likely a lack of human review of the AI generated output.
|
||||||
|
|
||||||
## Reviewing Pull Requests
|
## Reviewing Pull Requests
|
||||||
|
|
||||||
* See [filtered list of pull requests](https://github.com/systemd/systemd/pulls?q=is%3Aopen+is%3Apr+-label%3A%22reviewed%2Fneeds-rework+%F0%9F%94%A8%22+-label%3Aneeds-rebase+-label%3Agood-to-merge%2Fwith-minor-suggestions+-label%3A%22good-to-merge%2Fwaiting-for-ci+%F0%9F%91%8D%22+-label%3Apostponed+-label%3A%22needs-reporter-feedback+%E2%9D%93%22+-label%3A%22dont-merge+%F0%9F%92%A3%22+-label%3A%22ci-fails%2Fneeds-rework+%F0%9F%94%A5%22+sort%3Aupdated-desc) for requests that are ready for review.
|
* See [filtered list of pull requests](https://github.com/systemd/systemd/pulls?q=is%3Aopen+is%3Apr+-label%3A%22reviewed%2Fneeds-rework+%F0%9F%94%A8%22+-label%3Aneeds-rebase+-label%3Agood-to-merge%2Fwith-minor-suggestions+-label%3A%22good-to-merge%2Fwaiting-for-ci+%F0%9F%91%8D%22+-label%3Apostponed+-label%3A%22needs-reporter-feedback+%E2%9D%93%22+-label%3A%22dont-merge+%F0%9F%92%A3%22+-label%3A%22ci-fails%2Fneeds-rework+%F0%9F%94%A5%22+sort%3Aupdated-desc) for requests that are ready for review.
|
||||||
|
35
po/sv.po
35
po/sv.po
@ -5,14 +5,14 @@
|
|||||||
# Andreas Henriksson <andreas@fatal.se>, 2016.
|
# Andreas Henriksson <andreas@fatal.se>, 2016.
|
||||||
# Josef Andersson <l10nl18nsweja@gmail.com>, 2015, 2017.
|
# Josef Andersson <l10nl18nsweja@gmail.com>, 2015, 2017.
|
||||||
# Göran Uddeborg <goeran@uddeborg.se>, 2020, 2021, 2024.
|
# Göran Uddeborg <goeran@uddeborg.se>, 2020, 2021, 2024.
|
||||||
# Luna Jernberg <bittin@reimu.nl>, 2020, 2023, 2024.
|
# Luna Jernberg <bittin@reimu.nl>, 2020, 2023, 2024, 2025.
|
||||||
# Anders Jonsson <anders.jonsson@norsjovallen.se>, 2022, 2024.
|
# Anders Jonsson <anders.jonsson@norsjovallen.se>, 2022, 2024.
|
||||||
# Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>, 2024.
|
# Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>, 2024.
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2025-07-23 15:38+0100\n"
|
"POT-Creation-Date: 2025-07-23 15:38+0100\n"
|
||||||
"PO-Revision-Date: 2024-11-29 12:38+0000\n"
|
"PO-Revision-Date: 2025-07-29 19:53+0000\n"
|
||||||
"Last-Translator: Luna Jernberg <bittin@reimu.nl>\n"
|
"Last-Translator: Luna Jernberg <bittin@reimu.nl>\n"
|
||||||
"Language-Team: Swedish <https://translate.fedoraproject.org/projects/systemd/"
|
"Language-Team: Swedish <https://translate.fedoraproject.org/projects/systemd/"
|
||||||
"main/sv/>\n"
|
"main/sv/>\n"
|
||||||
@ -21,7 +21,7 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
"X-Generator: Weblate 5.8.2\n"
|
"X-Generator: Weblate 5.12.2\n"
|
||||||
|
|
||||||
#: src/core/org.freedesktop.systemd1.policy.in:22
|
#: src/core/org.freedesktop.systemd1.policy.in:22
|
||||||
msgid "Send passphrase back to system"
|
msgid "Send passphrase back to system"
|
||||||
@ -152,14 +152,11 @@ msgstr "Autentisering krävs för att aktivera en användares hemarea."
|
|||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:93
|
#: src/home/org.freedesktop.home1.policy:93
|
||||||
msgid "Manage Home Directory Signing Keys"
|
msgid "Manage Home Directory Signing Keys"
|
||||||
msgstr ""
|
msgstr "Hantera nycklar för signering av hemkatalog"
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:94
|
#: src/home/org.freedesktop.home1.policy:94
|
||||||
#, fuzzy
|
|
||||||
#| msgid "Authentication is required to manage system services or other units."
|
|
||||||
msgid "Authentication is required to manage signing keys for home directories."
|
msgid "Authentication is required to manage signing keys for home directories."
|
||||||
msgstr ""
|
msgstr "Autentisering krävs för att hantera signeringsnycklar för hemkataloger."
|
||||||
"Autentisering krävs för att hantera systemtjänster eller andra enheter."
|
|
||||||
|
|
||||||
#: src/home/pam_systemd_home.c:336
|
#: src/home/pam_systemd_home.c:336
|
||||||
#, c-format
|
#, c-format
|
||||||
@ -891,19 +888,15 @@ msgstr ""
|
|||||||
"Autentisering krävs för att skapa en lokal virtuell maskin eller behållare."
|
"Autentisering krävs för att skapa en lokal virtuell maskin eller behållare."
|
||||||
|
|
||||||
#: src/machine/org.freedesktop.machine1.policy:106
|
#: src/machine/org.freedesktop.machine1.policy:106
|
||||||
#, fuzzy
|
|
||||||
#| msgid "Create a local virtual machine or container"
|
|
||||||
msgid "Register a local virtual machine or container"
|
msgid "Register a local virtual machine or container"
|
||||||
msgstr "Skapa en lokal virtuell maskin eller behållare"
|
msgstr "Registrera en lokal virtuell maskin eller behållare"
|
||||||
|
|
||||||
#: src/machine/org.freedesktop.machine1.policy:107
|
#: src/machine/org.freedesktop.machine1.policy:107
|
||||||
#, fuzzy
|
|
||||||
#| msgid ""
|
|
||||||
#| "Authentication is required to create a local virtual machine or container."
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to register a local virtual machine or container."
|
"Authentication is required to register a local virtual machine or container."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Autentisering krävs för att skapa en lokal virtuell maskin eller behållare."
|
"Autentisering krävs för att registrera en lokal virtuell maskin eller "
|
||||||
|
"behållare."
|
||||||
|
|
||||||
#: src/machine/org.freedesktop.machine1.policy:116
|
#: src/machine/org.freedesktop.machine1.policy:116
|
||||||
msgid "Manage local virtual machine and container images"
|
msgid "Manage local virtual machine and container images"
|
||||||
@ -1128,13 +1121,11 @@ msgstr "Autentisering krävs för att prenumerera på frågesvar."
|
|||||||
|
|
||||||
#: src/resolve/org.freedesktop.resolve1.policy:154
|
#: src/resolve/org.freedesktop.resolve1.policy:154
|
||||||
msgid "Subscribe to DNS configuration"
|
msgid "Subscribe to DNS configuration"
|
||||||
msgstr ""
|
msgstr "Prenumerera på DNS-konfiguration"
|
||||||
|
|
||||||
#: src/resolve/org.freedesktop.resolve1.policy:155
|
#: src/resolve/org.freedesktop.resolve1.policy:155
|
||||||
#, fuzzy
|
|
||||||
#| msgid "Authentication is required to subscribe query results."
|
|
||||||
msgid "Authentication is required to subscribe to DNS configuration."
|
msgid "Authentication is required to subscribe to DNS configuration."
|
||||||
msgstr "Autentisering krävs för att prenumerera på frågesvar."
|
msgstr "Autentisering krävs för att prenumerera på DNS-konfiguration."
|
||||||
|
|
||||||
#: src/resolve/org.freedesktop.resolve1.policy:165
|
#: src/resolve/org.freedesktop.resolve1.policy:165
|
||||||
msgid "Dump cache"
|
msgid "Dump cache"
|
||||||
@ -1279,16 +1270,12 @@ msgstr ""
|
|||||||
"”$(unit)”."
|
"”$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:620
|
#: src/core/dbus-unit.c:620
|
||||||
#, fuzzy
|
|
||||||
#| msgid ""
|
|
||||||
#| "Authentication is required to send a UNIX signal to the processes of "
|
|
||||||
#| "'$(unit)'."
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to send a UNIX signal to the processes of "
|
"Authentication is required to send a UNIX signal to the processes of "
|
||||||
"subgroup of '$(unit)'."
|
"subgroup of '$(unit)'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Autentisering krävs för att skicka en UNIX-signal till processerna i "
|
"Autentisering krävs för att skicka en UNIX-signal till processerna i "
|
||||||
"”$(unit)”."
|
"undergruppen '$(unit)'."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:648
|
#: src/core/dbus-unit.c:648
|
||||||
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
|
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
|
||||||
|
51
po/tr.po
51
po/tr.po
@ -6,12 +6,13 @@
|
|||||||
# Oğuz Ersen <oguzersen@protonmail.com>, 2020.
|
# Oğuz Ersen <oguzersen@protonmail.com>, 2020.
|
||||||
# Muhammet Kara <muhammetk@gmail.com>, 2015-2020.
|
# Muhammet Kara <muhammetk@gmail.com>, 2015-2020.
|
||||||
# Oğuz Ersen <oguz@ersen.moe>, 2022, 2023, 2024.
|
# Oğuz Ersen <oguz@ersen.moe>, 2022, 2023, 2024.
|
||||||
|
# Emir SARI <emir_sari@icloud.com>, 2025.
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2025-07-23 15:38+0100\n"
|
"POT-Creation-Date: 2025-07-23 15:38+0100\n"
|
||||||
"PO-Revision-Date: 2024-11-29 12:38+0000\n"
|
"PO-Revision-Date: 2025-07-29 19:53+0000\n"
|
||||||
"Last-Translator: Oğuz Ersen <oguz@ersen.moe>\n"
|
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
|
||||||
"Language-Team: Turkish <https://translate.fedoraproject.org/projects/systemd/"
|
"Language-Team: Turkish <https://translate.fedoraproject.org/projects/systemd/"
|
||||||
"main/tr/>\n"
|
"main/tr/>\n"
|
||||||
"Language: tr\n"
|
"Language: tr\n"
|
||||||
@ -19,7 +20,7 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
"X-Generator: Weblate 5.8.2\n"
|
"X-Generator: Weblate 5.12.2\n"
|
||||||
|
|
||||||
#: src/core/org.freedesktop.systemd1.policy.in:22
|
#: src/core/org.freedesktop.systemd1.policy.in:22
|
||||||
msgid "Send passphrase back to system"
|
msgid "Send passphrase back to system"
|
||||||
@ -52,14 +53,14 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/core/org.freedesktop.systemd1.policy.in:54
|
#: src/core/org.freedesktop.systemd1.policy.in:54
|
||||||
msgid "Set or unset system and service manager environment variables"
|
msgid "Set or unset system and service manager environment variables"
|
||||||
msgstr "Sistem ve hizmet yöneticisi ortam değişkenlerini ayarla ya da kaldır"
|
msgstr "Sistem ve hizmet yöneticisi ortam değişkenlerini ayarla veya kaldır"
|
||||||
|
|
||||||
#: src/core/org.freedesktop.systemd1.policy.in:55
|
#: src/core/org.freedesktop.systemd1.policy.in:55
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to set or unset system and service manager "
|
"Authentication is required to set or unset system and service manager "
|
||||||
"environment variables."
|
"environment variables."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Sistem ve hizmet yöneticisi ortam değişkenlerini ayarlamak ya da kaldırmak "
|
"Sistem ve hizmet yöneticisi ortam değişkenlerini ayarlamak veya kaldırmak "
|
||||||
"için kimlik doğrulaması gereklidir."
|
"için kimlik doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/core/org.freedesktop.systemd1.policy.in:64
|
#: src/core/org.freedesktop.systemd1.policy.in:64
|
||||||
@ -78,8 +79,8 @@ msgstr "systemd durumunu hız sınırlamaları olmadan dök"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to dump the systemd state without rate limits."
|
"Authentication is required to dump the systemd state without rate limits."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"systemd durumunu hız sınırlamaları olmadan dökmek kimlik doğrulaması "
|
"systemd durumunu hız sınırlamaları olmadan dökmek için kimlik doğrulaması "
|
||||||
"gerektirir."
|
"gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:13
|
#: src/home/org.freedesktop.home1.policy:13
|
||||||
msgid "Create a home area"
|
msgid "Create a home area"
|
||||||
@ -87,7 +88,8 @@ msgstr "Ev alanı oluştur"
|
|||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:14
|
#: src/home/org.freedesktop.home1.policy:14
|
||||||
msgid "Authentication is required to create a user's home area."
|
msgid "Authentication is required to create a user's home area."
|
||||||
msgstr "Bir kullanıcının ev alanını oluşturmak kimlik doğrulaması gerektirir."
|
msgstr ""
|
||||||
|
"Bir kullanıcının ev alanını oluşturmak için kimlik doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:23
|
#: src/home/org.freedesktop.home1.policy:23
|
||||||
msgid "Remove a home area"
|
msgid "Remove a home area"
|
||||||
@ -95,7 +97,8 @@ msgstr "Ev alanını kaldır"
|
|||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:24
|
#: src/home/org.freedesktop.home1.policy:24
|
||||||
msgid "Authentication is required to remove a user's home area."
|
msgid "Authentication is required to remove a user's home area."
|
||||||
msgstr "Bir kullanıcının ev alanını kaldırmak kimlik doğrulaması gerektirir."
|
msgstr ""
|
||||||
|
"Bir kullanıcının ev alanını kaldırmak için kimlik doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:33
|
#: src/home/org.freedesktop.home1.policy:33
|
||||||
msgid "Check credentials of a home area"
|
msgid "Check credentials of a home area"
|
||||||
@ -106,7 +109,7 @@ msgid ""
|
|||||||
"Authentication is required to check credentials against a user's home area."
|
"Authentication is required to check credentials against a user's home area."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Bir kullanıcının ev alanının kimlik bilgilerini denetlemek için kimlik "
|
"Bir kullanıcının ev alanının kimlik bilgilerini denetlemek için kimlik "
|
||||||
"doğrulaması gerekir."
|
"doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:43
|
#: src/home/org.freedesktop.home1.policy:43
|
||||||
msgid "Update a home area"
|
msgid "Update a home area"
|
||||||
@ -114,7 +117,8 @@ msgstr "Ev alanını güncelle"
|
|||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:44
|
#: src/home/org.freedesktop.home1.policy:44
|
||||||
msgid "Authentication is required to update a user's home area."
|
msgid "Authentication is required to update a user's home area."
|
||||||
msgstr "Bir kullanıcının ev alanını güncellemek kimlik doğrulaması gerektirir."
|
msgstr ""
|
||||||
|
"Bir kullanıcının ev alanını güncellemek için kimlik doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:53
|
#: src/home/org.freedesktop.home1.policy:53
|
||||||
msgid "Update your home area"
|
msgid "Update your home area"
|
||||||
@ -122,7 +126,7 @@ msgstr "Ev alanınızı güncelleyin"
|
|||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:54
|
#: src/home/org.freedesktop.home1.policy:54
|
||||||
msgid "Authentication is required to update your home area."
|
msgid "Authentication is required to update your home area."
|
||||||
msgstr "Ev alanınızı güncellemek kimlik doğrulaması gerektirir."
|
msgstr "Ev alanınızı güncellemek için kimlik doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:63
|
#: src/home/org.freedesktop.home1.policy:63
|
||||||
msgid "Resize a home area"
|
msgid "Resize a home area"
|
||||||
@ -131,8 +135,8 @@ msgstr "Ev alanını yeniden boyutlandır"
|
|||||||
#: src/home/org.freedesktop.home1.policy:64
|
#: src/home/org.freedesktop.home1.policy:64
|
||||||
msgid "Authentication is required to resize a user's home area."
|
msgid "Authentication is required to resize a user's home area."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Bir kullanıcının ev alanını yeniden boyutlandırmak kimlik doğrulaması "
|
"Bir kullanıcının ev alanını yeniden boyutlandırmak için kimlik doğrulaması "
|
||||||
"gerektirir."
|
"gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:73
|
#: src/home/org.freedesktop.home1.policy:73
|
||||||
msgid "Change password of a home area"
|
msgid "Change password of a home area"
|
||||||
@ -142,29 +146,28 @@ msgstr "Ev alanının parolasını değiştir"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to change the password of a user's home area."
|
"Authentication is required to change the password of a user's home area."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Bir kullanıcının ev alanının parolasını değiştirmek kimlik doğrulaması "
|
"Bir kullanıcının ev alanının parolasını değiştirmek için kimlik doğrulaması "
|
||||||
"gerektirir."
|
"gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:83
|
#: src/home/org.freedesktop.home1.policy:83
|
||||||
msgid "Activate a home area"
|
msgid "Activate a home area"
|
||||||
msgstr "Bir ev alanını etkinleştir"
|
msgstr "Ev alanını etkinleştir"
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:84
|
#: src/home/org.freedesktop.home1.policy:84
|
||||||
msgid "Authentication is required to activate a user's home area."
|
msgid "Authentication is required to activate a user's home area."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Bir kullanıcının ev alanını etkinleştirmek kimlik doğrulaması gerektirir."
|
"Bir kullanıcının ev alanını etkinleştirmek için kimlik doğrulaması "
|
||||||
|
"gereklidir."
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:93
|
#: src/home/org.freedesktop.home1.policy:93
|
||||||
msgid "Manage Home Directory Signing Keys"
|
msgid "Manage Home Directory Signing Keys"
|
||||||
msgstr ""
|
msgstr "Ana Dizin İmzalama Anahtarlarını Yönet"
|
||||||
|
|
||||||
#: src/home/org.freedesktop.home1.policy:94
|
#: src/home/org.freedesktop.home1.policy:94
|
||||||
#, fuzzy
|
|
||||||
#| msgid "Authentication is required to manage system services or other units."
|
|
||||||
msgid "Authentication is required to manage signing keys for home directories."
|
msgid "Authentication is required to manage signing keys for home directories."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Sistem hizmetlerini veya diğer birimlerini yönetmek için kimlik doğrulaması "
|
"Ana dizinler için olan imzalama anahtarlarını yönetmek için kimlik "
|
||||||
"gereklidir."
|
"doğrulaması gereklidir."
|
||||||
|
|
||||||
#: src/home/pam_systemd_home.c:336
|
#: src/home/pam_systemd_home.c:336
|
||||||
#, c-format
|
#, c-format
|
||||||
@ -172,7 +175,7 @@ msgid ""
|
|||||||
"Home of user %s is currently absent, please plug in the necessary storage "
|
"Home of user %s is currently absent, please plug in the necessary storage "
|
||||||
"device or backing file system."
|
"device or backing file system."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"%s kullanıcısının ev dizini şu anda mevcut değil, lütfen gerekli depolama "
|
"%s kullanıcısının ana dizini şu anda mevcut değil, lütfen gerekli depolama "
|
||||||
"aygıtını veya içeren dosya sistemini bağlayın."
|
"aygıtını veya içeren dosya sistemini bağlayın."
|
||||||
|
|
||||||
#: src/home/pam_systemd_home.c:341
|
#: src/home/pam_systemd_home.c:341
|
||||||
|
40
po/zh_CN.po
40
po/zh_CN.po
@ -15,7 +15,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2025-07-23 15:38+0100\n"
|
"POT-Creation-Date: 2025-07-23 15:38+0100\n"
|
||||||
"PO-Revision-Date: 2025-07-28 17:25+0000\n"
|
"PO-Revision-Date: 2025-07-29 19:53+0000\n"
|
||||||
"Last-Translator: Jesse Guo <jesseguotech@outlook.com>\n"
|
"Last-Translator: Jesse Guo <jesseguotech@outlook.com>\n"
|
||||||
"Language-Team: Chinese (Simplified) <https://translate.fedoraproject.org/"
|
"Language-Team: Chinese (Simplified) <https://translate.fedoraproject.org/"
|
||||||
"projects/systemd/main/zh_CN/>\n"
|
"projects/systemd/main/zh_CN/>\n"
|
||||||
@ -552,7 +552,7 @@ msgstr "关闭系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:180
|
#: src/login/org.freedesktop.login1.policy:180
|
||||||
msgid "Power off the system while other users are logged in"
|
msgid "Power off the system while other users are logged in"
|
||||||
msgstr "存在其他已登录用户时仍然关机"
|
msgstr "存在其他已登录用户时关闭系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:181
|
#: src/login/org.freedesktop.login1.policy:181
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -562,13 +562,13 @@ msgstr "存在其他已登录用户时关闭系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:191
|
#: src/login/org.freedesktop.login1.policy:191
|
||||||
msgid "Power off the system while an application is inhibiting this"
|
msgid "Power off the system while an application is inhibiting this"
|
||||||
msgstr "有其它应用程序阻止时仍然关机"
|
msgstr "在应用程序阻止时关闭系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:192
|
#: src/login/org.freedesktop.login1.policy:192
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to power off the system while an application is "
|
"Authentication is required to power off the system while an application is "
|
||||||
"inhibiting this."
|
"inhibiting this."
|
||||||
msgstr "在其它应用程序阻止关机时关闭系统需要认证。"
|
msgstr "在应用程序阻止时关闭系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:202
|
#: src/login/org.freedesktop.login1.policy:202
|
||||||
msgid "Reboot the system"
|
msgid "Reboot the system"
|
||||||
@ -580,7 +580,7 @@ msgstr "重启系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:213
|
#: src/login/org.freedesktop.login1.policy:213
|
||||||
msgid "Reboot the system while other users are logged in"
|
msgid "Reboot the system while other users are logged in"
|
||||||
msgstr "存在其他已登录用户时仍然重启"
|
msgstr "存在其他已登录用户时重启系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:214
|
#: src/login/org.freedesktop.login1.policy:214
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -590,13 +590,13 @@ msgstr "存在其他已登录用户时重启系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:224
|
#: src/login/org.freedesktop.login1.policy:224
|
||||||
msgid "Reboot the system while an application is inhibiting this"
|
msgid "Reboot the system while an application is inhibiting this"
|
||||||
msgstr "有其它应用程序阻止时仍然重启"
|
msgstr "在应用程序阻止时重启系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:225
|
#: src/login/org.freedesktop.login1.policy:225
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to reboot the system while an application is "
|
"Authentication is required to reboot the system while an application is "
|
||||||
"inhibiting this."
|
"inhibiting this."
|
||||||
msgstr "在其它应用程序阻止重启时重启系统需要认证。"
|
msgstr "在应用程序阻止时重启系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:235
|
#: src/login/org.freedesktop.login1.policy:235
|
||||||
msgid "Halt the system"
|
msgid "Halt the system"
|
||||||
@ -608,23 +608,23 @@ msgstr "停止系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:246
|
#: src/login/org.freedesktop.login1.policy:246
|
||||||
msgid "Halt the system while other users are logged in"
|
msgid "Halt the system while other users are logged in"
|
||||||
msgstr "当存在其他已登录用户时仍然停止系统"
|
msgstr "存在其他已登录用户时停止系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:247
|
#: src/login/org.freedesktop.login1.policy:247
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to halt the system while other users are logged "
|
"Authentication is required to halt the system while other users are logged "
|
||||||
"in."
|
"in."
|
||||||
msgstr "当存在其他已登录用户时停止系统需要认证。"
|
msgstr "存在其他已登录用户时停止系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:257
|
#: src/login/org.freedesktop.login1.policy:257
|
||||||
msgid "Halt the system while an application is inhibiting this"
|
msgid "Halt the system while an application is inhibiting this"
|
||||||
msgstr "当存在应用程序阻止时仍然停止系统"
|
msgstr "在应用程序阻止时停止系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:258
|
#: src/login/org.freedesktop.login1.policy:258
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to halt the system while an application is "
|
"Authentication is required to halt the system while an application is "
|
||||||
"inhibiting this."
|
"inhibiting this."
|
||||||
msgstr "当应用程序阻止停止系统时需要认证。"
|
msgstr "在应用程序阻止时停止系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:268
|
#: src/login/org.freedesktop.login1.policy:268
|
||||||
msgid "Suspend the system"
|
msgid "Suspend the system"
|
||||||
@ -636,7 +636,7 @@ msgstr "挂起系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:278
|
#: src/login/org.freedesktop.login1.policy:278
|
||||||
msgid "Suspend the system while other users are logged in"
|
msgid "Suspend the system while other users are logged in"
|
||||||
msgstr "存在其他已登录用户时仍然挂起系统"
|
msgstr "存在其他已登录用户时挂起系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:279
|
#: src/login/org.freedesktop.login1.policy:279
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -646,13 +646,13 @@ msgstr "存在其他已登录用户时挂起系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:289
|
#: src/login/org.freedesktop.login1.policy:289
|
||||||
msgid "Suspend the system while an application is inhibiting this"
|
msgid "Suspend the system while an application is inhibiting this"
|
||||||
msgstr "有其它应用程序阻止时仍然挂起系统"
|
msgstr "在应用程序阻止时挂起系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:290
|
#: src/login/org.freedesktop.login1.policy:290
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to suspend the system while an application is "
|
"Authentication is required to suspend the system while an application is "
|
||||||
"inhibiting this."
|
"inhibiting this."
|
||||||
msgstr "在其它应用程序阻止挂起时挂起系统需要认证。"
|
msgstr "在应用程序阻止时挂起系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:300
|
#: src/login/org.freedesktop.login1.policy:300
|
||||||
msgid "Hibernate the system"
|
msgid "Hibernate the system"
|
||||||
@ -664,31 +664,31 @@ msgstr "休眠系统需要认证。"
|
|||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:310
|
#: src/login/org.freedesktop.login1.policy:310
|
||||||
msgid "Hibernate the system while other users are logged in"
|
msgid "Hibernate the system while other users are logged in"
|
||||||
msgstr "存在其他已登录用户时仍然休眠"
|
msgstr "存在其他已登录用户时休眠系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:311
|
#: src/login/org.freedesktop.login1.policy:311
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to hibernate the system while other users are "
|
"Authentication is required to hibernate the system while other users are "
|
||||||
"logged in."
|
"logged in."
|
||||||
msgstr "存在其他已登录用户时进行休眠系统需要认证。"
|
msgstr "存在其他已登录用户时休眠系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:321
|
#: src/login/org.freedesktop.login1.policy:321
|
||||||
msgid "Hibernate the system while an application is inhibiting this"
|
msgid "Hibernate the system while an application is inhibiting this"
|
||||||
msgstr "有其它应用程序阻止时仍然休眠"
|
msgstr "在应用程序阻止时休眠系统"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:322
|
#: src/login/org.freedesktop.login1.policy:322
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to hibernate the system while an application is "
|
"Authentication is required to hibernate the system while an application is "
|
||||||
"inhibiting this."
|
"inhibiting this."
|
||||||
msgstr "在其它应用程序阻止休眠时进行休眠需要认证。"
|
msgstr "在应用程序阻止时休眠系统需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:332
|
#: src/login/org.freedesktop.login1.policy:332
|
||||||
msgid "Manage active sessions, users and seats"
|
msgid "Manage active sessions, users and seats"
|
||||||
msgstr "管理活动会话、用户与会话座位"
|
msgstr "管理活动会话、用户与席位"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:333
|
#: src/login/org.freedesktop.login1.policy:333
|
||||||
msgid "Authentication is required to manage active sessions, users and seats."
|
msgid "Authentication is required to manage active sessions, users and seats."
|
||||||
msgstr "管理活动会话、用户与会话座位需要认证。"
|
msgstr "管理活动会话、用户与席位需要认证。"
|
||||||
|
|
||||||
#: src/login/org.freedesktop.login1.policy:342
|
#: src/login/org.freedesktop.login1.policy:342
|
||||||
msgid "Lock or unlock active sessions"
|
msgid "Lock or unlock active sessions"
|
||||||
|
@ -10,7 +10,6 @@ static const struct errno_name* lookup_errno(register const char *str,
|
|||||||
register GPERF_LEN_TYPE len);
|
register GPERF_LEN_TYPE len);
|
||||||
|
|
||||||
#include "errno-from-name.inc"
|
#include "errno-from-name.inc"
|
||||||
#include "errno-to-name.inc"
|
|
||||||
|
|
||||||
int errno_from_name(const char *name) {
|
int errno_from_name(const char *name) {
|
||||||
const struct errno_name *sc;
|
const struct errno_name *sc;
|
||||||
@ -25,27 +24,29 @@ int errno_from_name(const char *name) {
|
|||||||
return sc->id;
|
return sc->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* errno_to_name(int id) {
|
#if HAVE_STRERRORNAME_NP
|
||||||
if (id == 0) /* To stay in line with our own impl */
|
const char* errno_name_no_fallback(int id) {
|
||||||
|
if (id == 0) /* To stay in line with our implementation below. */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
return strerrorname_np(ABS(id));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
# include "errno-to-name.inc"
|
||||||
|
|
||||||
|
const char* errno_name_no_fallback(int id) {
|
||||||
if (id < 0)
|
if (id < 0)
|
||||||
id = -id;
|
id = -id;
|
||||||
|
|
||||||
#if HAVE_STRERRORNAME_NP
|
|
||||||
const char *n = strerrorname_np(id);
|
|
||||||
if (n)
|
|
||||||
return n;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((size_t) id >= ELEMENTSOF(errno_names))
|
if ((size_t) id >= ELEMENTSOF(errno_names))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return errno_names[id];
|
return errno_names[id];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char* errno_name_full(int id, char buf[static ERRNO_NAME_BUF_LEN]) {
|
const char* errno_name(int id, char buf[static ERRNO_NAME_BUF_LEN]) {
|
||||||
const char *a = errno_to_name(id);
|
const char *a = errno_name_no_fallback(id);
|
||||||
if (a)
|
if (a)
|
||||||
return a;
|
return a;
|
||||||
snprintf(buf, ERRNO_NAME_BUF_LEN, "%d", abs(id));
|
snprintf(buf, ERRNO_NAME_BUF_LEN, "%d", abs(id));
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "forward.h"
|
#include "forward.h"
|
||||||
|
|
||||||
const char* errno_to_name(int id) _const_;
|
const char* errno_name_no_fallback(int id) _const_;
|
||||||
int errno_from_name(const char *name) _pure_;
|
int errno_from_name(const char *name) _pure_;
|
||||||
|
|
||||||
static inline bool errno_is_valid(int n) {
|
static inline bool errno_is_valid(int n) {
|
||||||
@ -12,7 +12,7 @@ static inline bool errno_is_valid(int n) {
|
|||||||
|
|
||||||
#define ERRNO_NAME_BUF_LEN DECIMAL_STR_MAX(int)
|
#define ERRNO_NAME_BUF_LEN DECIMAL_STR_MAX(int)
|
||||||
/* Like errno_name, but always returns a string. */
|
/* Like errno_name, but always returns a string. */
|
||||||
const char* errno_name_full(int id, char buf[static ERRNO_NAME_BUF_LEN]);
|
const char* errno_name(int id, char buf[static ERRNO_NAME_BUF_LEN]);
|
||||||
|
|
||||||
/* A helper to print the errno "name" or number if name is not defined. */
|
/* A helper to print the errno "name" or number if name is not defined. */
|
||||||
#define ERRNO_NAME_FULL(errnum) errno_name_full(errnum, (char[ERRNO_NAME_BUF_LEN]){})
|
#define ERRNO_NAME(errnum) errno_name(errnum, (char[ERRNO_NAME_BUF_LEN]){})
|
||||||
|
@ -154,9 +154,8 @@ static int access_init(sd_bus_error *error) {
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (avc_open(NULL, 0) != 0) {
|
if (avc_open(NULL, 0) != 0) {
|
||||||
r = -errno; /* Save original errno for later */
|
/* Passing errno to save original value for later */
|
||||||
|
r = log_selinux_enforcing_errno(errno, "Failed to open the SELinux AVC: %m");
|
||||||
r = log_selinux_enforcing_errno(r, "Failed to open the SELinux AVC: %m");
|
|
||||||
if (r == 0)
|
if (r == 0)
|
||||||
/* log_selinux_enforcing_errno() can return 0 if the enforcement isn't on.
|
/* log_selinux_enforcing_errno() can return 0 if the enforcement isn't on.
|
||||||
* In this case don't do any AVC checks.
|
* In this case don't do any AVC checks.
|
||||||
|
@ -1460,8 +1460,8 @@ int socket_load_service_unit(Socket *s, int cfd, Unit **ret) {
|
|||||||
/* ENOTCONN is legitimate if TCP RST was received. Other socket families might return
|
/* ENOTCONN is legitimate if TCP RST was received. Other socket families might return
|
||||||
* different errors. This connection is over, but the socket unit lives on. */
|
* different errors. This connection is over, but the socket unit lives on. */
|
||||||
return log_unit_debug_errno(UNIT(s), r,
|
return log_unit_debug_errno(UNIT(s), r,
|
||||||
"Got %s on incoming socket, assuming aborted connection attempt, ignoring.",
|
"Got error %s on incoming socket, assuming aborted connection attempt, ignoring.",
|
||||||
errno_to_name(r));
|
ERRNO_NAME(r));
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -1159,7 +1159,7 @@ static int home_on_worker_process(sd_event_source *s, const siginfo_t *si, void
|
|||||||
} else if (si->si_status != EXIT_SUCCESS) {
|
} else if (si->si_status != EXIT_SUCCESS) {
|
||||||
/* If we received an error code via sd_notify(), use it */
|
/* If we received an error code via sd_notify(), use it */
|
||||||
if (h->worker_error_code != 0)
|
if (h->worker_error_code != 0)
|
||||||
ret = log_debug_errno(h->worker_error_code, "Worker reported error code %s.", errno_to_name(h->worker_error_code));
|
ret = log_debug_errno(h->worker_error_code, "Worker reported error code %s.", ERRNO_NAME(h->worker_error_code));
|
||||||
else
|
else
|
||||||
ret = log_debug_errno(SYNTHETIC_ERRNO(EPROTO), "Worker exited with exit code %i.", si->si_status);
|
ret = log_debug_errno(SYNTHETIC_ERRNO(EPROTO), "Worker exited with exit code %i.", si->si_status);
|
||||||
} else
|
} else
|
||||||
|
@ -165,10 +165,11 @@ static int errno_to_bus_error_name_new(int error, char **ret) {
|
|||||||
const char *name;
|
const char *name;
|
||||||
char *n;
|
char *n;
|
||||||
|
|
||||||
if (error < 0)
|
/* D-Bus names must not start with a digit. Thus, an name like System.Error.500 would not be legal.
|
||||||
error = -error;
|
* Let's just return 0 if an unknown errno is encountered, which will cause the caller to fall back
|
||||||
|
* to BUS_ERROR_FAILED.
|
||||||
name = errno_to_name(error);
|
*/
|
||||||
|
name = errno_name_no_fallback(error);
|
||||||
if (!name)
|
if (!name)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ static int dump_mapping_table(void) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s -> %i/%s\n", strna(m->name), m->code, strna(errno_to_name(m->code)));
|
printf("%s -> %i/%s\n", strna(m->name), m->code, ERRNO_NAME(m->code));
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
printf("---------------------------\n");
|
printf("---------------------------\n");
|
||||||
|
@ -36,9 +36,7 @@ static char* format_uids(char **buf, uid_t* uids, int count) {
|
|||||||
return *buf;
|
return *buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *e(int r) {
|
#define e(r) (r == 0 ? "OK" : ERRNO_NAME(r))
|
||||||
return r == 0 ? "OK" : errno_to_name(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(login) {
|
TEST(login) {
|
||||||
_cleanup_close_pair_ int pair[2] = EBADF_PAIR;
|
_cleanup_close_pair_ int pair[2] = EBADF_PAIR;
|
||||||
|
@ -2699,7 +2699,7 @@ _public_ int sd_varlink_error_errno(sd_varlink *v, int error) {
|
|||||||
* open, even to foreign systems. */
|
* open, even to foreign systems. */
|
||||||
|
|
||||||
error = abs(error);
|
error = abs(error);
|
||||||
const char *name = errno_to_name(error);
|
const char *name = errno_name_no_fallback(error);
|
||||||
|
|
||||||
return sd_varlink_errorbo(
|
return sd_varlink_errorbo(
|
||||||
v,
|
v,
|
||||||
|
@ -370,48 +370,6 @@ static int get_seat_from_display(const char *display, const char **seat, uint32_
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int export_legacy_dbus_address(
|
|
||||||
pam_handle_t *handle,
|
|
||||||
const char *runtime) {
|
|
||||||
|
|
||||||
int r;
|
|
||||||
|
|
||||||
assert(handle);
|
|
||||||
|
|
||||||
/* We need to export $DBUS_SESSION_BUS_ADDRESS because various applications will not connect
|
|
||||||
* correctly to the bus without it. This setting matches what dbus.socket does for the user session
|
|
||||||
* using 'systemctl --user set-environment'. We want to have the same configuration in processes
|
|
||||||
* started from the PAM session.
|
|
||||||
*
|
|
||||||
* The setting of the address is guarded by the access() check because it is also possible to compile
|
|
||||||
* dbus without --enable-user-session, in which case this socket is not used, and
|
|
||||||
* $DBUS_SESSION_BUS_ADDRESS should not be set. An alternative approach would to not do the access()
|
|
||||||
* check here, and let applications try on their own, by using "unix:path=%s/bus;autolaunch:". But we
|
|
||||||
* expect the socket to be present by the time we do this check, so we can just as well check once
|
|
||||||
* here. */
|
|
||||||
|
|
||||||
if (!runtime)
|
|
||||||
return PAM_SUCCESS;
|
|
||||||
|
|
||||||
const char *s = strjoina(runtime, "/bus");
|
|
||||||
if (access(s, F_OK) < 0) {
|
|
||||||
if (errno != ENOENT)
|
|
||||||
pam_syslog_errno(handle, LOG_WARNING, errno, "Failed to check if %s/bus exists, ignoring: %m", runtime);
|
|
||||||
|
|
||||||
return PAM_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
_cleanup_free_ char *t = NULL;
|
|
||||||
if (asprintf(&t, DEFAULT_USER_BUS_ADDRESS_FMT, runtime) < 0)
|
|
||||||
return pam_log_oom(handle);
|
|
||||||
|
|
||||||
r = pam_misc_setenv(handle, "DBUS_SESSION_BUS_ADDRESS", t, /* readonly= */ false);
|
|
||||||
if (r != PAM_SUCCESS)
|
|
||||||
return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to set bus variable: @PAMERR@");
|
|
||||||
|
|
||||||
return PAM_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int append_session_memory_max(pam_handle_t *handle, sd_bus_message *m, const char *limit) {
|
static int append_session_memory_max(pam_handle_t *handle, sd_bus_message *m, const char *limit) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -1497,6 +1455,80 @@ static int make_area_runtime_directory(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int export_legacy_dbus_address(
|
||||||
|
pam_handle_t *handle,
|
||||||
|
const char *runtime) {
|
||||||
|
|
||||||
|
assert(handle);
|
||||||
|
assert(runtime);
|
||||||
|
|
||||||
|
/* We need to export $DBUS_SESSION_BUS_ADDRESS because various applications will not connect
|
||||||
|
* correctly to the bus without it. This setting matches what dbus.socket does for the user session
|
||||||
|
* using 'systemctl --user set-environment'. We want to have the same configuration in processes
|
||||||
|
* started from the PAM session.
|
||||||
|
*
|
||||||
|
* The setting of the address is guarded by the access() check because it is also possible to compile
|
||||||
|
* dbus without --enable-user-session, in which case this socket is not used, and
|
||||||
|
* $DBUS_SESSION_BUS_ADDRESS should not be set. An alternative approach would to not do the access()
|
||||||
|
* check here, and let applications try on their own, by using "unix:path=%s/bus;autolaunch:". But we
|
||||||
|
* expect the socket to be present by the time we do this check, so we can just as well check once
|
||||||
|
* here. */
|
||||||
|
|
||||||
|
const char *s = strjoina(runtime, "/bus");
|
||||||
|
if (access(s, F_OK) < 0) {
|
||||||
|
if (errno != ENOENT)
|
||||||
|
pam_syslog_errno(handle, LOG_WARNING, errno, "Failed to check if %s/bus exists, ignoring: %m", runtime);
|
||||||
|
|
||||||
|
return PAM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
_cleanup_free_ char *t = NULL;
|
||||||
|
if (asprintf(&t, DEFAULT_USER_BUS_ADDRESS_FMT, runtime) < 0)
|
||||||
|
return pam_log_oom(handle);
|
||||||
|
|
||||||
|
return update_environment(handle, "DBUS_SESSION_BUS_ADDRESS", t);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int setup_runtime_directory(
|
||||||
|
pam_handle_t *handle,
|
||||||
|
UserRecord *ur,
|
||||||
|
const char *runtime_directory,
|
||||||
|
const char *area) {
|
||||||
|
|
||||||
|
int r;
|
||||||
|
|
||||||
|
assert(handle);
|
||||||
|
assert(ur);
|
||||||
|
|
||||||
|
if (!runtime_directory) {
|
||||||
|
/* If this is an area switch request, always reset $XDG_RUNTIME_DIR if we got nothing
|
||||||
|
* to ensure the main runtime dir won't be clobbered. */
|
||||||
|
if (area)
|
||||||
|
return update_environment(handle, "XDG_RUNTIME_DIR", NULL);
|
||||||
|
|
||||||
|
return PAM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Also create a per-area subdirectory for $XDG_RUNTIME_DIR, so that each area has their own
|
||||||
|
* set of runtime services. We follow the same directory structure as for $HOME. Note that we
|
||||||
|
* do not define any form of automatic clean-up for the per-area subdirs beyond the regular
|
||||||
|
* clean-up of the whole $XDG_RUNTIME_DIR hierarchy when the user finally logs out. */
|
||||||
|
_cleanup_free_ char *per_area_runtime_directory = NULL;
|
||||||
|
if (area) {
|
||||||
|
r = make_area_runtime_directory(handle, ur, runtime_directory, area, &per_area_runtime_directory);
|
||||||
|
if (r != PAM_SUCCESS)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
runtime_directory = per_area_runtime_directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = update_environment(handle, "XDG_RUNTIME_DIR", runtime_directory);
|
||||||
|
if (r != PAM_SUCCESS)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
return export_legacy_dbus_address(handle, runtime_directory);
|
||||||
|
}
|
||||||
|
|
||||||
static int setup_environment(
|
static int setup_environment(
|
||||||
pam_handle_t *handle,
|
pam_handle_t *handle,
|
||||||
UserRecord *ur,
|
UserRecord *ur,
|
||||||
@ -1564,25 +1596,7 @@ static int setup_environment(
|
|||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
_cleanup_free_ char *per_area_runtime_directory = NULL;
|
return setup_runtime_directory(handle, ur, runtime_directory, area);
|
||||||
if (runtime_directory && area) {
|
|
||||||
/* Also create a per-area subdirectory for $XDG_RUNTIME_DIR, so that each area has their own
|
|
||||||
* set of runtime services. We follow the same directory structure as for $HOME. Note that we
|
|
||||||
* do not define any form of automatic clean-up for the per-aera subdirs beyond the regular
|
|
||||||
* clean-up of the whole $XDG_RUNTIME_DIR hierarchy when the user finally logs out. */
|
|
||||||
|
|
||||||
r = make_area_runtime_directory(handle, ur, runtime_directory, area, &per_area_runtime_directory);
|
|
||||||
if (r != PAM_SUCCESS)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
runtime_directory = per_area_runtime_directory;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = update_environment(handle, "XDG_RUNTIME_DIR", runtime_directory);
|
|
||||||
if (r != PAM_SUCCESS)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
return export_legacy_dbus_address(handle, runtime_directory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_osc_context(pam_handle_t *handle, const char *session_type, UserRecord *ur) {
|
static int open_osc_context(pam_handle_t *handle, const char *session_type, UserRecord *ur) {
|
||||||
|
@ -3146,9 +3146,9 @@ static void monitor_query_dump(sd_json_variant *v) {
|
|||||||
streq_ptr(p.state, "success") ? ansi_highlight_green() : ansi_highlight_red(),
|
streq_ptr(p.state, "success") ? ansi_highlight_green() : ansi_highlight_red(),
|
||||||
glyph(GLYPH_ARROW_LEFT),
|
glyph(GLYPH_ARROW_LEFT),
|
||||||
ansi_normal(),
|
ansi_normal(),
|
||||||
strna(streq_ptr(p.state, "errno") ? errno_to_name(p.error) :
|
streq_ptr(p.state, "errno") ? ERRNO_NAME(p.error) :
|
||||||
streq_ptr(p.state, "rcode-failure") ? dns_rcode_to_string(p.rcode) :
|
streq_ptr(p.state, "rcode-failure") ? strna(dns_rcode_to_string(p.rcode)) :
|
||||||
p.state));
|
strna(p.state));
|
||||||
|
|
||||||
if (!isempty(p.result))
|
if (!isempty(p.result))
|
||||||
printf(": %s", p.result);
|
printf(": %s", p.result);
|
||||||
|
@ -406,7 +406,6 @@ void dns_transaction_complete(DnsTransaction *t, DnsTransactionState state) {
|
|||||||
DnsQueryCandidate *c;
|
DnsQueryCandidate *c;
|
||||||
DnsZoneItem *z;
|
DnsZoneItem *z;
|
||||||
DnsTransaction *d;
|
DnsTransaction *d;
|
||||||
const char *st;
|
|
||||||
char key_str[DNS_RESOURCE_KEY_STRING_MAX];
|
char key_str[DNS_RESOURCE_KEY_STRING_MAX];
|
||||||
|
|
||||||
assert(t);
|
assert(t);
|
||||||
@ -430,11 +429,6 @@ void dns_transaction_complete(DnsTransaction *t, DnsTransactionState state) {
|
|||||||
* should hence not attempt to access the query or transaction
|
* should hence not attempt to access the query or transaction
|
||||||
* after calling this function. */
|
* after calling this function. */
|
||||||
|
|
||||||
if (state == DNS_TRANSACTION_ERRNO)
|
|
||||||
st = errno_to_name(t->answer_errno);
|
|
||||||
else
|
|
||||||
st = dns_transaction_state_to_string(state);
|
|
||||||
|
|
||||||
log_debug("%s transaction %" PRIu16 " for <%s> on scope %s on %s/%s now complete with <%s> from %s (%s; %s).",
|
log_debug("%s transaction %" PRIu16 " for <%s> on scope %s on %s/%s now complete with <%s> from %s (%s; %s).",
|
||||||
t->bypass ? "Bypass" : "Regular",
|
t->bypass ? "Bypass" : "Regular",
|
||||||
t->id,
|
t->id,
|
||||||
@ -442,7 +436,7 @@ void dns_transaction_complete(DnsTransaction *t, DnsTransactionState state) {
|
|||||||
dns_protocol_to_string(t->scope->protocol),
|
dns_protocol_to_string(t->scope->protocol),
|
||||||
t->scope->link ? t->scope->link->ifname : "*",
|
t->scope->link ? t->scope->link->ifname : "*",
|
||||||
af_to_name_short(t->scope->family),
|
af_to_name_short(t->scope->family),
|
||||||
st,
|
state == DNS_TRANSACTION_ERRNO ? ERRNO_NAME(t->answer_errno) : dns_transaction_state_to_string(state),
|
||||||
t->answer_source < 0 ? "none" : dns_transaction_source_to_string(t->answer_source),
|
t->answer_source < 0 ? "none" : dns_transaction_source_to_string(t->answer_source),
|
||||||
FLAGS_SET(t->query_flags, SD_RESOLVED_NO_VALIDATE) ? "not validated" :
|
FLAGS_SET(t->query_flags, SD_RESOLVED_NO_VALIDATE) ? "not validated" :
|
||||||
(FLAGS_SET(t->answer_query_flags, SD_RESOLVED_AUTHENTICATED) ? "authenticated" : "unsigned"),
|
(FLAGS_SET(t->answer_query_flags, SD_RESOLVED_AUTHENTICATED) ? "authenticated" : "unsigned"),
|
||||||
|
@ -2541,5 +2541,5 @@ int seccomp_parse_errno_or_action(const char *p) {
|
|||||||
const char* seccomp_errno_or_action_to_string(int num) {
|
const char* seccomp_errno_or_action_to_string(int num) {
|
||||||
if (num == SECCOMP_ERROR_NUMBER_KILL)
|
if (num == SECCOMP_ERROR_NUMBER_KILL)
|
||||||
return "kill";
|
return "kill";
|
||||||
return errno_to_name(num);
|
return errno_name_no_fallback(num);
|
||||||
}
|
}
|
||||||
|
@ -174,28 +174,28 @@ _noreturn_ void log_test_failed_internal(const char *file, int line, const char
|
|||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK(expr) __coverity_check__((expr) >= 0)
|
# define ASSERT_OK(expr) __coverity_check__((expr) >= 0)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK(expr) \
|
# define ASSERT_OK(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result < 0) \
|
if (_result < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
||||||
#expr, (intmax_t) _result, ERRNO_NAME_FULL(_result)); \
|
#expr, (intmax_t) _result, ERRNO_NAME(_result)); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_OR(expr, ...) \
|
# define ASSERT_OK_OR(expr, ...) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
__coverity_check__(_result >= 0 || IN_SET(_result, 0, __VA_ARGS__) \
|
__coverity_check__(_result >= 0 || IN_SET(_result, 0, __VA_ARGS__) \
|
||||||
})
|
})
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_OR(expr, ...) \
|
# define ASSERT_OK_OR(expr, ...) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result < 0 && !IN_SET(_result, 0, __VA_ARGS__)) \
|
if (_result < 0 && !IN_SET(_result, 0, __VA_ARGS__)) \
|
||||||
log_test_failed("\"%s\" failed with unexpected error: %"PRIiMAX"/%s", \
|
log_test_failed("\"%s\" failed with unexpected error: %"PRIiMAX"/%s", \
|
||||||
#expr, (intmax_t) _result, ERRNO_NAME_FULL(_result)); \
|
#expr, (intmax_t) _result, ERRNO_NAME(_result)); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -203,45 +203,45 @@ _noreturn_ void log_test_failed_internal(const char *file, int line, const char
|
|||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_POSITIVE(expr) __coverity_check__((expr) > 0)
|
# define ASSERT_OK_POSITIVE(expr) __coverity_check__((expr) > 0)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_POSITIVE(expr) \
|
# define ASSERT_OK_POSITIVE(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result < 0) \
|
if (_result < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
||||||
#expr, (intmax_t) _result, ERRNO_NAME_FULL(_result)); \
|
#expr, (intmax_t) _result, ERRNO_NAME(_result)); \
|
||||||
if (_result == 0) \
|
if (_result == 0) \
|
||||||
log_test_failed("Expected \"%s\" to be positive, but it is zero.", #expr); \
|
log_test_failed("Expected \"%s\" to be positive, but it is zero.", #expr); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_ZERO(expr) __coverity_check__((expr) == 0)
|
# define ASSERT_OK_ZERO(expr) __coverity_check__((expr) == 0)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_ZERO(expr) \
|
# define ASSERT_OK_ZERO(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result < 0) \
|
if (_result < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
||||||
#expr, (intmax_t) _result, ERRNO_NAME_FULL(_result)); \
|
#expr, (intmax_t) _result, ERRNO_NAME(_result)); \
|
||||||
if (_result != 0) \
|
if (_result != 0) \
|
||||||
log_test_failed("Expected \"%s\" to be zero, but it is %"PRIiMAX".", \
|
log_test_failed("Expected \"%s\" to be zero, but it is %"PRIiMAX".", \
|
||||||
#expr, (intmax_t) _result); \
|
#expr, (intmax_t) _result); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_EQ(expr1, expr2) __coverity_check__((expr1) == (expr2))
|
# define ASSERT_OK_EQ(expr1, expr2) __coverity_check__((expr1) == (expr2))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_EQ(expr1, expr2) \
|
# define ASSERT_OK_EQ(expr1, expr2) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr1) _expr1 = (expr1); \
|
typeof(expr1) _expr1 = (expr1); \
|
||||||
typeof(expr2) _expr2 = (expr2); \
|
typeof(expr2) _expr2 = (expr2); \
|
||||||
if (_expr1 < 0) \
|
if (_expr1 < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got error: %"PRIiMAX"/%s", \
|
||||||
#expr1, (intmax_t) _expr1, ERRNO_NAME_FULL(_expr1)); \
|
#expr1, (intmax_t) _expr1, ERRNO_NAME(_expr1)); \
|
||||||
if (_expr1 != _expr2) \
|
if (_expr1 != _expr2) \
|
||||||
log_test_failed("Expected \"%s == %s\", got %"PRIiMAX" != %"PRIiMAX, \
|
log_test_failed("Expected \"%s == %s\", got %"PRIiMAX" != %"PRIiMAX, \
|
||||||
#expr1, #expr2, (intmax_t) _expr1, (intmax_t) _expr2); \
|
#expr1, #expr2, (intmax_t) _expr1, (intmax_t) _expr2); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -249,153 +249,153 @@ _noreturn_ void log_test_failed_internal(const char *file, int line, const char
|
|||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_ERRNO(expr) __coverity_check__((expr) >= 0)
|
# define ASSERT_OK_ERRNO(expr) __coverity_check__((expr) >= 0)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_ERRNO(expr) \
|
# define ASSERT_OK_ERRNO(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result < 0) \
|
if (_result < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got errno: %d/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got errno: %d/%s", \
|
||||||
#expr, errno, ERRNO_NAME_FULL(errno)); \
|
#expr, errno, ERRNO_NAME(errno)); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_ZERO_ERRNO(expr) __coverity_check__((expr) == 0)
|
# define ASSERT_OK_ZERO_ERRNO(expr) __coverity_check__((expr) == 0)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_ZERO_ERRNO(expr) \
|
# define ASSERT_OK_ZERO_ERRNO(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result < 0) \
|
if (_result < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got errno: %d/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got errno: %d/%s", \
|
||||||
#expr, errno, ERRNO_NAME_FULL(errno)); \
|
#expr, errno, ERRNO_NAME(errno)); \
|
||||||
if (_result != 0) \
|
if (_result != 0) \
|
||||||
log_test_failed("Expected \"%s\" to be zero, but it is %"PRIiMAX".", \
|
log_test_failed("Expected \"%s\" to be zero, but it is %"PRIiMAX".", \
|
||||||
#expr, (intmax_t) _result); \
|
#expr, (intmax_t) _result); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_OK_EQ_ERRNO(expr1, expr2) __coverity_check__((expr1) == (expr2))
|
# define ASSERT_OK_EQ_ERRNO(expr1, expr2) __coverity_check__((expr1) == (expr2))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_OK_EQ_ERRNO(expr1, expr2) \
|
# define ASSERT_OK_EQ_ERRNO(expr1, expr2) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr1) _expr1 = (expr1); \
|
typeof(expr1) _expr1 = (expr1); \
|
||||||
typeof(expr2) _expr2 = (expr2); \
|
typeof(expr2) _expr2 = (expr2); \
|
||||||
if (_expr1 < 0) \
|
if (_expr1 < 0) \
|
||||||
log_test_failed("Expected \"%s\" to succeed, but got errno: %d/%s", \
|
log_test_failed("Expected \"%s\" to succeed, but got errno: %d/%s", \
|
||||||
#expr1, errno, ERRNO_NAME_FULL(errno)); \
|
#expr1, errno, ERRNO_NAME(errno)); \
|
||||||
if (_expr1 != _expr2) \
|
if (_expr1 != _expr2) \
|
||||||
log_test_failed("Expected \"%s == %s\", but %"PRIiMAX" != %"PRIiMAX, \
|
log_test_failed("Expected \"%s == %s\", but %"PRIiMAX" != %"PRIiMAX, \
|
||||||
#expr1, #expr2, (intmax_t) _expr1, (intmax_t) _expr2); \
|
#expr1, #expr2, (intmax_t) _expr1, (intmax_t) _expr2); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_FAIL(expr) __coverity_check__((expr) < 0)
|
# define ASSERT_FAIL(expr) __coverity_check__((expr) < 0)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_FAIL(expr) \
|
# define ASSERT_FAIL(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result >= 0) \
|
if (_result >= 0) \
|
||||||
log_test_failed("Expected \"%s\" to fail, but it succeeded.", #expr); \
|
log_test_failed("Expected \"%s\" to fail, but it succeeded.", #expr); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_ERROR(expr1, expr2) __coverity_check__((expr1) == -(expr2))
|
# define ASSERT_ERROR(expr1, expr2) __coverity_check__((expr1) == -(expr2))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_ERROR(expr1, expr2) \
|
# define ASSERT_ERROR(expr1, expr2) \
|
||||||
({ \
|
({ \
|
||||||
int _expr1 = (expr1); \
|
int _expr1 = (expr1); \
|
||||||
int _expr2 = (expr2); \
|
int _expr2 = (expr2); \
|
||||||
if (_expr1 >= 0) \
|
if (_expr1 >= 0) \
|
||||||
log_test_failed("Expected \"%s\" to fail with error %d/%s, but it succeeded", \
|
log_test_failed("Expected \"%s\" to fail with error %d/%s, but it succeeded", \
|
||||||
#expr1, -_expr2, ERRNO_NAME_FULL(_expr2)); \
|
#expr1, -_expr2, ERRNO_NAME(_expr2)); \
|
||||||
else if (-_expr1 != _expr2) \
|
else if (-_expr1 != _expr2) \
|
||||||
log_test_failed("Expected \"%s\" to fail with error %d/%s, but got %d/%s", \
|
log_test_failed("Expected \"%s\" to fail with error %d/%s, but got %d/%s", \
|
||||||
#expr1, -_expr2, ERRNO_NAME_FULL(_expr2), _expr1, ERRNO_NAME_FULL(_expr1)); \
|
#expr1, -_expr2, ERRNO_NAME(_expr2), _expr1, ERRNO_NAME(_expr1)); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_ERROR_ERRNO(expr1, expr2) __coverity_check__((expr1) < 0 && errno == (expr2))
|
# define ASSERT_ERROR_ERRNO(expr1, expr2) __coverity_check__((expr1) < 0 && errno == (expr2))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_ERROR_ERRNO(expr1, expr2) \
|
# define ASSERT_ERROR_ERRNO(expr1, expr2) \
|
||||||
({ \
|
({ \
|
||||||
int _expr1 = (expr1); \
|
int _expr1 = (expr1); \
|
||||||
int _expr2 = (expr2); \
|
int _expr2 = (expr2); \
|
||||||
if (_expr1 >= 0) \
|
if (_expr1 >= 0) \
|
||||||
log_test_failed("Expected \"%s\" to fail with errno %d/%s, but it succeeded", \
|
log_test_failed("Expected \"%s\" to fail with errno %d/%s, but it succeeded", \
|
||||||
#expr1, _expr2, ERRNO_NAME_FULL(_expr2)); \
|
#expr1, _expr2, ERRNO_NAME(_expr2)); \
|
||||||
else if (errno != _expr2) \
|
else if (errno != _expr2) \
|
||||||
log_test_failed("Expected \"%s\" to fail with errno %d/%s, but got %d/%s", \
|
log_test_failed("Expected \"%s\" to fail with errno %d/%s, but got %d/%s", \
|
||||||
#expr1, _expr2, ERRNO_NAME_FULL(_expr2), errno, ERRNO_NAME_FULL(errno)); \
|
#expr1, _expr2, ERRNO_NAME(_expr2), errno, ERRNO_NAME(errno)); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_TRUE(expr) __coverity_check__(!!(expr))
|
# define ASSERT_TRUE(expr) __coverity_check__(!!(expr))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_TRUE(expr) \
|
# define ASSERT_TRUE(expr) \
|
||||||
({ \
|
({ \
|
||||||
if (!(expr)) \
|
if (!(expr)) \
|
||||||
log_test_failed("Expected \"%s\" to be true", #expr); \
|
log_test_failed("Expected \"%s\" to be true", #expr); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_FALSE(expr) __coverity_check__(!(expr))
|
# define ASSERT_FALSE(expr) __coverity_check__(!(expr))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_FALSE(expr) \
|
# define ASSERT_FALSE(expr) \
|
||||||
({ \
|
({ \
|
||||||
if ((expr)) \
|
if ((expr)) \
|
||||||
log_test_failed("Expected \"%s\" to be false", #expr); \
|
log_test_failed("Expected \"%s\" to be false", #expr); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_NULL(expr) __coverity_check__((expr) == NULL)
|
# define ASSERT_NULL(expr) __coverity_check__((expr) == NULL)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_NULL(expr) \
|
# define ASSERT_NULL(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result != NULL) \
|
if (_result != NULL) \
|
||||||
log_test_failed("Expected \"%s\" to be NULL, got \"%p\" != NULL", #expr, _result); \
|
log_test_failed("Expected \"%s\" to be NULL, got \"%p\" != NULL", #expr, _result); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_NOT_NULL(expr) __coverity_check__((expr) != NULL)
|
# define ASSERT_NOT_NULL(expr) __coverity_check__((expr) != NULL)
|
||||||
#else
|
#else
|
||||||
# define ASSERT_NOT_NULL(expr) \
|
# define ASSERT_NOT_NULL(expr) \
|
||||||
({ \
|
({ \
|
||||||
typeof(expr) _result = (expr); \
|
typeof(expr) _result = (expr); \
|
||||||
if (_result == NULL) \
|
if (_result == NULL) \
|
||||||
log_test_failed("Expected \"%s\" to be not NULL", #expr); \
|
log_test_failed("Expected \"%s\" to be not NULL", #expr); \
|
||||||
_result; \
|
_result; \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_STREQ(expr1, expr2) __coverity_check__(streq_ptr((expr1), (expr2)))
|
# define ASSERT_STREQ(expr1, expr2) __coverity_check__(streq_ptr((expr1), (expr2)))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_STREQ(expr1, expr2) \
|
# define ASSERT_STREQ(expr1, expr2) \
|
||||||
({ \
|
({ \
|
||||||
const char *_expr1 = (expr1), *_expr2 = (expr2); \
|
const char *_expr1 = (expr1), *_expr2 = (expr2); \
|
||||||
if (!streq_ptr(_expr1, _expr2)) \
|
if (!streq_ptr(_expr1, _expr2)) \
|
||||||
log_test_failed("Expected \"%s == %s\", got \"%s != %s\"", \
|
log_test_failed("Expected \"%s == %s\", got \"%s != %s\"", \
|
||||||
#expr1, #expr2, strnull(_expr1), strnull(_expr2)); \
|
#expr1, #expr2, strnull(_expr1), strnull(_expr2)); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
# define ASSERT_PTR_EQ(expr1, expr2) __coverity_check__((expr1) == (expr2))
|
# define ASSERT_PTR_EQ(expr1, expr2) __coverity_check__((expr1) == (expr2))
|
||||||
#else
|
#else
|
||||||
# define ASSERT_PTR_EQ(expr1, expr2) \
|
# define ASSERT_PTR_EQ(expr1, expr2) \
|
||||||
({ \
|
({ \
|
||||||
const void *_expr1 = (expr1), *_expr2 = (expr2); \
|
const void *_expr1 = (expr1), *_expr2 = (expr2); \
|
||||||
if (_expr1 != _expr2) \
|
if (_expr1 != _expr2) \
|
||||||
log_test_failed("Expected \"%s == %s\", got \"0x%p != 0x%p\"", \
|
log_test_failed("Expected \"%s == %s\", got \"0x%p != 0x%p\"", \
|
||||||
#expr1, #expr2, _expr1, _expr2); \
|
#expr1, #expr2, _expr1, _expr2); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ static void test_policy_closed(const char *cgroup_path, BPFProgram **installed_p
|
|||||||
_cleanup_close_ int fd = -EBADF, fd2 = -EBADF;
|
_cleanup_close_ int fd = -EBADF, fd2 = -EBADF;
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd < 0 && errno == EPERM;
|
wrong += fd < 0 && errno == EPERM;
|
||||||
/* We ignore errors other than EPERM, e.g. ENOENT or ENXIO */
|
/* We ignore errors other than EPERM, e.g. ENOENT or ENXIO */
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 < 0 && errno == EPERM;
|
wrong += fd2 < 0 && errno == EPERM;
|
||||||
}
|
}
|
||||||
assert_se(wrong == 0);
|
assert_se(wrong == 0);
|
||||||
@ -78,11 +78,11 @@ static void test_policy_strict(const char *cgroup_path, BPFProgram **installed_p
|
|||||||
const char *s = "/dev/null";
|
const char *s = "/dev/null";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd < 0;
|
wrong += fd < 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 < 0;
|
wrong += fd2 < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,11 +91,11 @@ static void test_policy_strict(const char *cgroup_path, BPFProgram **installed_p
|
|||||||
const char *s = "/dev/random";
|
const char *s = "/dev/random";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd < 0;
|
wrong += fd < 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 >= 0;
|
wrong += fd2 >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,11 +104,11 @@ static void test_policy_strict(const char *cgroup_path, BPFProgram **installed_p
|
|||||||
const char *s = "/dev/zero";
|
const char *s = "/dev/zero";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd >= 0;
|
wrong += fd >= 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 < 0;
|
wrong += fd2 < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,11 +117,11 @@ static void test_policy_strict(const char *cgroup_path, BPFProgram **installed_p
|
|||||||
const char *s = "/dev/full";
|
const char *s = "/dev/full";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd >= 0;
|
wrong += fd >= 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 >= 0;
|
wrong += fd2 >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,11 +150,11 @@ static void test_policy_allow_list_major(const char *pattern, const char *cgroup
|
|||||||
const char *s = "/dev/null";
|
const char *s = "/dev/null";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd < 0;
|
wrong += fd < 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 < 0;
|
wrong += fd2 < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,11 +163,11 @@ static void test_policy_allow_list_major(const char *pattern, const char *cgroup
|
|||||||
const char *s = "/dev/full";
|
const char *s = "/dev/full";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd < 0;
|
wrong += fd < 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 < 0;
|
wrong += fd2 < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,11 +176,11 @@ static void test_policy_allow_list_major(const char *pattern, const char *cgroup
|
|||||||
const char *s = "/dev/tty";
|
const char *s = "/dev/tty";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd >= 0;
|
wrong += fd >= 0;
|
||||||
|
|
||||||
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
fd2 = open(s, O_CLOEXEC|O_WRONLY|O_NOCTTY);
|
||||||
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"w\") = %d/%s", s, fd2, fd2 < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd2 >= 0;
|
wrong += fd2 >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ static void test_policy_allow_list_major_star(char type, const char *cgroup_path
|
|||||||
const char *s = "/dev/null";
|
const char *s = "/dev/null";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDWR|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDWR|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
if (type == 'c')
|
if (type == 'c')
|
||||||
wrong += fd < 0;
|
wrong += fd < 0;
|
||||||
else
|
else
|
||||||
@ -241,7 +241,7 @@ static void test_policy_empty(bool add_mismatched, const char *cgroup_path, BPFP
|
|||||||
const char *s = "/dev/null";
|
const char *s = "/dev/null";
|
||||||
|
|
||||||
fd = open(s, O_CLOEXEC|O_RDWR|O_NOCTTY);
|
fd = open(s, O_CLOEXEC|O_RDWR|O_NOCTTY);
|
||||||
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? errno_to_name(errno) : "-");
|
log_debug("open(%s, \"r\") = %d/%s", s, fd, fd < 0 ? ERRNO_NAME(errno) : "-");
|
||||||
wrong += fd >= 0;
|
wrong += fd >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ static void test_transient_settings_one(UnitType type, const char* const* lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = bus_append_unit_property_assignment(m, type, t);
|
r = bus_append_unit_property_assignment(m, type, t);
|
||||||
log_debug("%s → %d/%s", t, r, r < 0 ? ERRNO_NAME_FULL(r) : yes_no(r));
|
log_debug("%s → %d/%s", t, r, r < 0 ? ERRNO_NAME(r) : yes_no(r));
|
||||||
ASSERT_EQ(r, expect);
|
ASSERT_EQ(r, expect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,49 +5,54 @@
|
|||||||
|
|
||||||
#include "errno-to-name.inc"
|
#include "errno-to-name.inc"
|
||||||
|
|
||||||
TEST(errno_list) {
|
TEST(errno_name_no_fallback) {
|
||||||
ASSERT_NULL(errno_names[0]);
|
ASSERT_NULL(errno_names[0]);
|
||||||
ASSERT_NULL(errno_to_name(0));
|
ASSERT_NULL(errno_name_no_fallback(0));
|
||||||
|
|
||||||
for (size_t i = 0; i < ELEMENTSOF(errno_names); i++) {
|
for (size_t i = 0; i < ELEMENTSOF(errno_names); i++)
|
||||||
if (errno_names[i]) {
|
if (errno_names[i]) {
|
||||||
ASSERT_STREQ(errno_to_name(i), errno_names[i]);
|
const char *mapped = errno_name_no_fallback(i);
|
||||||
|
|
||||||
|
if (mapped)
|
||||||
|
/* glibc might not know some errno names.
|
||||||
|
* This is not an error. */
|
||||||
|
ASSERT_STREQ(mapped, errno_names[i]);
|
||||||
|
|
||||||
assert_se(errno_from_name(errno_names[i]) == (int) i);
|
assert_se(errno_from_name(errno_names[i]) == (int) i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ECANCELLED
|
#ifdef ECANCELLED
|
||||||
/* ECANCELLED is an alias of ECANCELED. */
|
/* ECANCELLED is an alias of ECANCELED. */
|
||||||
ASSERT_STREQ(errno_to_name(ECANCELLED), "ECANCELED");
|
ASSERT_STREQ(errno_name_no_fallback(ECANCELLED), "ECANCELED");
|
||||||
#endif
|
#endif
|
||||||
ASSERT_STREQ(errno_to_name(ECANCELED), "ECANCELED");
|
ASSERT_STREQ(errno_name_no_fallback(ECANCELED), "ECANCELED");
|
||||||
|
|
||||||
#ifdef EREFUSED
|
#ifdef EREFUSED
|
||||||
/* EREFUSED is an alias of ECONNREFUSED. */
|
/* EREFUSED is an alias of ECONNREFUSED. */
|
||||||
ASSERT_STREQ(errno_to_name(EREFUSED), "ECONNREFUSED");
|
ASSERT_STREQ(errno_name_no_fallback(EREFUSED), "ECONNREFUSED");
|
||||||
#endif
|
#endif
|
||||||
ASSERT_STREQ(errno_to_name(ECONNREFUSED), "ECONNREFUSED");
|
ASSERT_STREQ(errno_name_no_fallback(ECONNREFUSED), "ECONNREFUSED");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(errno_name_full) {
|
TEST(errno_name_full) {
|
||||||
char buf[ERRNO_NAME_BUF_LEN];
|
char buf[ERRNO_NAME_BUF_LEN];
|
||||||
|
|
||||||
ASSERT_STREQ(errno_name_full(0, buf), "0");
|
ASSERT_STREQ(errno_name(0, buf), "0");
|
||||||
ASSERT_STREQ(errno_name_full(EPERM, buf), "EPERM");
|
ASSERT_STREQ(errno_name(EPERM, buf), "EPERM");
|
||||||
ASSERT_STREQ(errno_name_full(ENOENT, buf), "ENOENT");
|
ASSERT_STREQ(errno_name(ENOENT, buf), "ENOENT");
|
||||||
ASSERT_STREQ(errno_name_full(200, buf), "200");
|
ASSERT_STREQ(errno_name(200, buf), "200");
|
||||||
ASSERT_STREQ(errno_name_full(-200, buf), "200");
|
ASSERT_STREQ(errno_name(-200, buf), "200");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ERRNO_NAME_FULL) {
|
TEST(ERRNO_NAME_FULL) {
|
||||||
ASSERT_STREQ(ERRNO_NAME_FULL(0), "0");
|
ASSERT_STREQ(ERRNO_NAME(0), "0");
|
||||||
ASSERT_STREQ(ERRNO_NAME_FULL(EPERM), "EPERM");
|
ASSERT_STREQ(ERRNO_NAME(EPERM), "EPERM");
|
||||||
ASSERT_STREQ(ERRNO_NAME_FULL(ENOENT), "ENOENT");
|
ASSERT_STREQ(ERRNO_NAME(ENOENT), "ENOENT");
|
||||||
ASSERT_STREQ(ERRNO_NAME_FULL(200), "200");
|
ASSERT_STREQ(ERRNO_NAME(200), "200");
|
||||||
ASSERT_STREQ(ERRNO_NAME_FULL(-200), "200");
|
ASSERT_STREQ(ERRNO_NAME(-200), "200");
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
ASSERT_STREQ(ERRNO_NAME_FULL(++x), "EPERM"); /* Confirm that eval happens just once. */
|
ASSERT_STREQ(ERRNO_NAME(++x), "EPERM"); /* Confirm that eval happens just once. */
|
||||||
ASSERT_EQ(x, 1);
|
ASSERT_EQ(x, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ static void test_gethostbyname4_r(void *handle, const char *module, const char *
|
|||||||
fname, name,
|
fname, name,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
pat ? (uintptr_t) pat - (uintptr_t) buffer : 0,
|
pat ? (uintptr_t) pat - (uintptr_t) buffer : 0,
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2),
|
errno2, hstrerror(errno2),
|
||||||
ttl);
|
ttl);
|
||||||
n = print_gaih_addrtuples(pat);
|
n = print_gaih_addrtuples(pat);
|
||||||
@ -124,7 +124,7 @@ static void test_gethostbyname4_r(void *handle, const char *module, const char *
|
|||||||
fname, name,
|
fname, name,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
pat,
|
pat,
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2));
|
errno2, hstrerror(errno2));
|
||||||
n = 0;
|
n = 0;
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ static void test_gethostbyname3_r(void *handle, const char *module, const char *
|
|||||||
log_info("%s(\"%s\", %s) → status=%s%-20serrno=%d/%s h_errno=%d/%s ttl=%"PRIi32,
|
log_info("%s(\"%s\", %s) → status=%s%-20serrno=%d/%s h_errno=%d/%s ttl=%"PRIi32,
|
||||||
fname, name, af_to_string(af, family_name, sizeof family_name),
|
fname, name, af_to_string(af, family_name, sizeof family_name),
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2),
|
errno2, hstrerror(errno2),
|
||||||
ttl);
|
ttl);
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
@ -204,7 +204,7 @@ static void test_gethostbyname2_r(void *handle, const char *module, const char *
|
|||||||
log_info("%s(\"%s\", %s) → status=%s%-20serrno=%d/%s h_errno=%d/%s",
|
log_info("%s(\"%s\", %s) → status=%s%-20serrno=%d/%s h_errno=%d/%s",
|
||||||
fname, name, af_to_string(af, family_name, sizeof family_name),
|
fname, name, af_to_string(af, family_name, sizeof family_name),
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2));
|
errno2, hstrerror(errno2));
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_hostent(&host, NULL);
|
print_struct_hostent(&host, NULL);
|
||||||
@ -231,7 +231,7 @@ static void test_gethostbyname_r(void *handle, const char *module, const char *n
|
|||||||
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s h_errno=%d/%s",
|
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s h_errno=%d/%s",
|
||||||
fname, name,
|
fname, name,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2));
|
errno2, hstrerror(errno2));
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_hostent(&host, NULL);
|
print_struct_hostent(&host, NULL);
|
||||||
@ -268,7 +268,7 @@ static void test_gethostbyaddr2_r(void *handle,
|
|||||||
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s h_errno=%d/%s ttl=%"PRIi32,
|
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s h_errno=%d/%s ttl=%"PRIi32,
|
||||||
fname, addr_pretty,
|
fname, addr_pretty,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2),
|
errno2, hstrerror(errno2),
|
||||||
ttl);
|
ttl);
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
@ -305,7 +305,7 @@ static void test_gethostbyaddr_r(void *handle,
|
|||||||
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s h_errno=%d/%s",
|
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s h_errno=%d/%s",
|
||||||
fname, addr_pretty,
|
fname, addr_pretty,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---",
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---",
|
||||||
errno2, hstrerror(errno2));
|
errno2, hstrerror(errno2));
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_hostent(&host, NULL);
|
print_struct_hostent(&host, NULL);
|
||||||
|
@ -61,7 +61,7 @@ static void test_getpwnam_r(void *handle, const char *module, const char *name)
|
|||||||
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s",
|
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s",
|
||||||
fname, name,
|
fname, name,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---");
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---");
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_passwd(&pwd);
|
print_struct_passwd(&pwd);
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ static void test_getgrnam_r(void *handle, const char *module, const char *name)
|
|||||||
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s",
|
log_info("%s(\"%s\") → status=%s%-20serrno=%d/%s",
|
||||||
fname, name,
|
fname, name,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---");
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---");
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_group(&gr);
|
print_struct_group(&gr);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ static void test_getpwuid_r(void *handle, const char *module, uid_t uid) {
|
|||||||
log_info("%s("UID_FMT") → status=%s%-20serrno=%d/%s",
|
log_info("%s("UID_FMT") → status=%s%-20serrno=%d/%s",
|
||||||
fname, uid,
|
fname, uid,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---");
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---");
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_passwd(&pwd);
|
print_struct_passwd(&pwd);
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ static void test_getgrgid_r(void *handle, const char *module, gid_t gid) {
|
|||||||
log_info("%s("GID_FMT") → status=%s%-20serrno=%d/%s",
|
log_info("%s("GID_FMT") → status=%s%-20serrno=%d/%s",
|
||||||
fname, gid,
|
fname, gid,
|
||||||
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
|
||||||
errno1, errno_to_name(errno1) ?: "---");
|
errno1, errno1 > 0 ? ERRNO_NAME(errno1) : "---");
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
print_struct_group(&gr);
|
print_struct_group(&gr);
|
||||||
}
|
}
|
||||||
|
@ -123,34 +123,34 @@ static void test_pid_get_cmdline_one(pid_t pid) {
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = pid_get_cmdline(pid, SIZE_MAX, 0, &c);
|
r = pid_get_cmdline(pid, SIZE_MAX, 0, &c);
|
||||||
log_info("PID "PID_FMT": %s", pid, r >= 0 ? c : errno_to_name(r));
|
log_info("PID "PID_FMT": %s", pid, r >= 0 ? c : ERRNO_NAME(r));
|
||||||
|
|
||||||
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_COMM_FALLBACK, &d);
|
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_COMM_FALLBACK, &d);
|
||||||
log_info(" %s", r >= 0 ? d : errno_to_name(r));
|
log_info(" %s", r >= 0 ? d : ERRNO_NAME(r));
|
||||||
|
|
||||||
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE, &e);
|
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE, &e);
|
||||||
log_info(" %s", r >= 0 ? e : errno_to_name(r));
|
log_info(" %s", r >= 0 ? e : ERRNO_NAME(r));
|
||||||
|
|
||||||
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE | PROCESS_CMDLINE_COMM_FALLBACK, &f);
|
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE | PROCESS_CMDLINE_COMM_FALLBACK, &f);
|
||||||
log_info(" %s", r >= 0 ? f : errno_to_name(r));
|
log_info(" %s", r >= 0 ? f : ERRNO_NAME(r));
|
||||||
|
|
||||||
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE_POSIX, &g);
|
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE_POSIX, &g);
|
||||||
log_info(" %s", r >= 0 ? g : errno_to_name(r));
|
log_info(" %s", r >= 0 ? g : ERRNO_NAME(r));
|
||||||
|
|
||||||
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE_POSIX | PROCESS_CMDLINE_COMM_FALLBACK, &h);
|
r = pid_get_cmdline(pid, SIZE_MAX, PROCESS_CMDLINE_QUOTE_POSIX | PROCESS_CMDLINE_COMM_FALLBACK, &h);
|
||||||
log_info(" %s", r >= 0 ? h : errno_to_name(r));
|
log_info(" %s", r >= 0 ? h : ERRNO_NAME(r));
|
||||||
|
|
||||||
r = pid_get_cmdline_strv(pid, 0, &strv_a);
|
r = pid_get_cmdline_strv(pid, 0, &strv_a);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
ASSERT_NOT_NULL((joined = strv_join(strv_a, "\", \"")));
|
ASSERT_NOT_NULL((joined = strv_join(strv_a, "\", \"")));
|
||||||
log_info(" \"%s\"", r >= 0 ? joined : errno_to_name(r));
|
log_info(" \"%s\"", r >= 0 ? joined : ERRNO_NAME(r));
|
||||||
|
|
||||||
joined = mfree(joined);
|
joined = mfree(joined);
|
||||||
|
|
||||||
r = pid_get_cmdline_strv(pid, PROCESS_CMDLINE_COMM_FALLBACK, &strv_b);
|
r = pid_get_cmdline_strv(pid, PROCESS_CMDLINE_COMM_FALLBACK, &strv_b);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
ASSERT_NOT_NULL((joined = strv_join(strv_b, "\", \"")));
|
ASSERT_NOT_NULL((joined = strv_join(strv_b, "\", \"")));
|
||||||
log_info(" \"%s\"", r >= 0 ? joined : errno_to_name(r));
|
log_info(" \"%s\"", r >= 0 ? joined : ERRNO_NAME(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(pid_get_cmdline) {
|
TEST(pid_get_cmdline) {
|
||||||
|
@ -169,7 +169,7 @@ TEST(path_is_temporary_fs) {
|
|||||||
r = path_is_temporary_fs(s);
|
r = path_is_temporary_fs(s);
|
||||||
|
|
||||||
log_info_errno(r, "path_is_temporary_fs(\"%s\"): %d, %s",
|
log_info_errno(r, "path_is_temporary_fs(\"%s\"): %d, %s",
|
||||||
s, r, r < 0 ? errno_to_name(r) : yes_no(r));
|
s, r, r < 0 ? ERRNO_NAME(r) : yes_no(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* run might not be a mount point in build chroots */
|
/* run might not be a mount point in build chroots */
|
||||||
@ -186,7 +186,7 @@ TEST(path_is_read_only_fs) {
|
|||||||
r = path_is_read_only_fs(s);
|
r = path_is_read_only_fs(s);
|
||||||
|
|
||||||
log_info_errno(r, "path_is_read_only_fs(\"%s\"): %d, %s",
|
log_info_errno(r, "path_is_read_only_fs(\"%s\"): %d, %s",
|
||||||
s, r, r < 0 ? errno_to_name(r) : yes_no(r));
|
s, r, r < 0 ? ERRNO_NAME(r) : yes_no(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path_is_mount_point_full("/sys", NULL, AT_SYMLINK_FOLLOW) > 0)
|
if (path_is_mount_point_full("/sys", NULL, AT_SYMLINK_FOLLOW) > 0)
|
||||||
|
@ -21,7 +21,7 @@ int device_add_errno(sd_device *dev, int error) {
|
|||||||
r = device_add_property(dev, "UDEV_WORKER_FAILED", "1");
|
r = device_add_property(dev, "UDEV_WORKER_FAILED", "1");
|
||||||
RET_GATHER(r, device_add_propertyf(dev, "UDEV_WORKER_ERRNO", "%i", error));
|
RET_GATHER(r, device_add_propertyf(dev, "UDEV_WORKER_ERRNO", "%i", error));
|
||||||
|
|
||||||
const char *str = errno_to_name(error);
|
const char *str = errno_name_no_fallback(error);
|
||||||
if (str)
|
if (str)
|
||||||
RET_GATHER(r, device_add_property(dev, "UDEV_WORKER_ERRNO_NAME", str));
|
RET_GATHER(r, device_add_property(dev, "UDEV_WORKER_ERRNO_NAME", str));
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ static int worker_device_monitor_handler(sd_device_monitor *monitor, sd_device *
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *e = errno_to_name(r);
|
const char *e = errno_name_no_fallback(r);
|
||||||
r = sd_notifyf(/* unset_environment = */ false, "ERRNO=%i%s%s", -r, e ? "\nERRNO_NAME=" : "", strempty(e));
|
r = sd_notifyf(/* unset_environment = */ false, "ERRNO=%i%s%s", -r, e ? "\nERRNO_NAME=" : "", strempty(e));
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
log_device_warning_errno(dev, r, "Failed to send notification message to manager process, ignoring: %m");
|
log_device_warning_errno(dev, r, "Failed to send notification message to manager process, ignoring: %m");
|
||||||
|
@ -1069,7 +1069,7 @@ static int display_services(int argc, char *argv[], void *userdata) {
|
|||||||
|
|
||||||
r = connect_unix_path(fd, dirfd(d), de->d_name);
|
r = connect_unix_path(fd, dirfd(d), de->d_name);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
no = strjoin("No (", errno_to_name(r), ")");
|
no = strjoin("No (", ERRNO_NAME(r), ")");
|
||||||
if (!no)
|
if (!no)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ get_chassis() (
|
|||||||
)
|
)
|
||||||
|
|
||||||
stop_hostnamed() {
|
stop_hostnamed() {
|
||||||
systemctl stop systemd-hostnamed.service
|
systemctl stop --job-mode=replace-irreversibly systemd-hostnamed.service
|
||||||
# Reset trigger limit. This might fail if the unit was unloaded already, so ignore any errors.
|
# Reset trigger limit. This might fail if the unit was unloaded already, so ignore any errors.
|
||||||
systemctl reset-failed systemd-hostnamed || :
|
systemctl reset-failed systemd-hostnamed || :
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user