Re: [Freeipa-devel] [PATCH 0544] ipa-rmkeytab, ipa-join: dont fail if gettext cannot be initialized

2016-06-27 Thread Martin Basti



On 27.06.2016 12:22, Petr Spacek wrote:

On 27.6.2016 08:36, Martin Basti wrote:

https://fedorahosted.org/freeipa/ticket/5973

Patch attached.

ACK for this patch set.

Interestingly it does not fix
https://fedorahosted.org/freeipa/ticket/5978


On my broken IPA client it prints following message:
# /usr/sbin/ipa-rmkeytab -k /etc/krb5.keytab -r
DOM-046.ABC.IDM.LAB.ENG.BRQ.REDHAT.COM
Failed to load translations
realm not found

# echo $?
5

Maybe your client is broken too much, I tried reproducer from ticket and 
it is working, I don't have to do rm /etc/krb5.keytab anymore (tried twice)


Pushed to master: a07030f3867168969d32f0f46e792ae0697529bc


--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


Re: [Freeipa-devel] [PATCH 0544] ipa-rmkeytab, ipa-join: dont fail if gettext cannot be initialized

2016-06-27 Thread Petr Spacek
On 27.6.2016 08:36, Martin Basti wrote:
> https://fedorahosted.org/freeipa/ticket/5973
> 
> Patch attached.

ACK for this patch set.

Interestingly it does not fix
https://fedorahosted.org/freeipa/ticket/5978


On my broken IPA client it prints following message:
# /usr/sbin/ipa-rmkeytab -k /etc/krb5.keytab -r
DOM-046.ABC.IDM.LAB.ENG.BRQ.REDHAT.COM
Failed to load translations
realm not found

# echo $?
5

-- 
Petr^2 Spacek

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


[Freeipa-devel] [PATCH 0544] ipa-rmkeytab, ipa-join: dont fail if gettext cannot be initialized

2016-06-27 Thread Martin Basti

https://fedorahosted.org/freeipa/ticket/5973

Patch attached.

From 37e296f12ed10edb12a3c34f62c0397e37fa3bda Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Fri, 24 Jun 2016 17:34:02 +0200
Subject: [PATCH] ipa-rmkeytab, ipa-join: don't fail if init of gettext failed

If locale setting was incorect, gettext failed to initialize and scripts
failed. this commit replaces error exit with warning message. (Better to
have untranslated output than fail)

https://fedorahosted.org/freeipa/ticket/5973
---
 client/ipa-join.c | 2 +-
 client/ipa-rmkeytab.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/ipa-join.c b/client/ipa-join.c
index ac8251fef3b0a03de0920e8732b44bac208f55a6..837e7ce398adef1cd3b9d9748ee091e4b8ee8f06 100644
--- a/client/ipa-join.c
+++ b/client/ipa-join.c
@@ -1130,7 +1130,7 @@ main(int argc, const char **argv) {
 
 ret = init_gettext();
 if (ret) {
-exit(2);
+fprintf(stderr, "Failed to load translations\n");
 }
 
 pc = poptGetContext("ipa-join", argc, (const char **)argv, options, 0);
diff --git a/client/ipa-rmkeytab.c b/client/ipa-rmkeytab.c
index 3687b1dc7ea0ab4484af3385bb87c5b9155e53da..e3d9eedc4f8b0d27f645be0624ef29bba5cf0605 100644
--- a/client/ipa-rmkeytab.c
+++ b/client/ipa-rmkeytab.c
@@ -180,7 +180,7 @@ main(int argc, const char **argv)
 
 ret = init_gettext();
 if (ret) {
-exit(1);
+fprintf(stderr, "Failed to load translations\n");
 }
 
 memset(, 0, sizeof(ktid));
-- 
2.5.5

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code