From 291071cb3c04eda7606d62bbff123a0a125c7d60 Mon Sep 17 00:00:00 2001
From: Tomas Halman <thalman@redhat.com>
Date: Tue, 13 Nov 2018 12:21:16 +0100
Subject: [PATCH] SSSCTL: user-show says that user is expired
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
sssctl user-show says that user is expired if the user comes from files
provider. This is ok because files user's expiration time is always set
to 0 but we should print a better, less confusing message.
The same change apply to groups.
Resolves:
https://pagure.io/SSSD/sssd/issue/3858
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
---
src/tools/sssctl/sssctl_cache.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/tools/sssctl/sssctl_cache.c b/src/tools/sssctl/sssctl_cache.c
index 42a2a60fd..e0d067cfb 100644
--- a/src/tools/sssctl/sssctl_cache.c
+++ b/src/tools/sssctl/sssctl_cache.c
@@ -154,6 +154,11 @@ static errno_t get_attr_expire(TALLOC_CTX *mem_ctx,
return ret;
}
+ if (is_files_provider(dom)) {
+ *_value = "Never";
+ return EOK;
+ }
+
if (value < time(NULL)) {
*_value = "Expired";
return EOK;
@@ -179,6 +184,11 @@ static errno_t attr_initgr(TALLOC_CTX *mem_ctx,
return ret;
}
+ if (is_files_provider(dom)) {
+ *_value = "Never";
+ return EOK;
+ }
+
if (value < time(NULL)) {
*_value = "Expired";
return EOK;
--
2.19.1