URL: https://github.com/SSSD/sssd/pull/5853
Author: fernape
 Title: #5853: Fix untranslated string
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5853/head:pr5853
git checkout pr5853
From 19bde8c23d80e6ee139419857fb11c38eeaa75ed Mon Sep 17 00:00:00 2001
From: Fernando Apesteguia <fernando.apesteg...@gmail.com>
Date: Fri, 29 Oct 2021 12:49:26 +0200
Subject: [PATCH 1/2] Fix untranslated string

Promote format string to gettext's PRIu64 instead of using SSSD's
SPRIuid which is not recognized. This caused the original string to be
truncated in the translation files.

How to test:

Apply patch and run:

make -C po/ update-pot

Translations should contain the full string now:

msgid "Running under %<PRIu64>, must be root\n"

Resolves: https://github.com/SSSD/sssd/issues/5738
---
 src/monitor/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index c7610cb69b..43c28a2045 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2398,7 +2398,7 @@ int main(int argc, const char *argv[])
 
     uid = getuid();
     if (uid != 0) {
-        ERROR("Running under %"SPRIuid", must be root\n", uid);
+        ERROR("Running under %"PRIu64", must be root\n", uid);
         sss_log(SSS_LOG_ALERT, "sssd must be run as root");
         return 8;
     }

From ffb83c4b7d33fdfc802652c535c16b4656bf286e Mon Sep 17 00:00:00 2001
From: Fernando Apesteguia <fernando.apesteg...@gmail.com>
Date: Mon, 1 Nov 2021 19:49:58 +0100
Subject: [PATCH 2/2] Add casting to avoid formatting errors.

Reported by sumit-bose
---
 src/monitor/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 43c28a2045..55cb0838aa 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2398,7 +2398,7 @@ int main(int argc, const char *argv[])
 
     uid = getuid();
     if (uid != 0) {
-        ERROR("Running under %"PRIu64", must be root\n", uid);
+        ERROR("Running under %"PRIu64", must be root\n", (uint64_t) uid);
         sss_log(SSS_LOG_ALERT, "sssd must be run as root");
         return 8;
     }
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to