summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-06-19 17:26:58 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-07-10 16:37:15 +0200
commit9651a27ec14f3a378e861ca39852480f37f1ef08 (patch)
tree668789715a6fa79cf41ac3911bbba573b836d15a /src
parenteca766c0801ed859a8b50e23cb94fa79acd866f4 (diff)
downloadsssd-9651a27ec14f3a378e861ca39852480f37f1ef08.tar.gz
sssd-9651a27ec14f3a378e861ca39852480f37f1ef08.tar.bz2
sssd-9651a27ec14f3a378e861ca39852480f37f1ef08.zip
sss_cache: Add option to invalidate all entries
Option -E/--everething was added to invalide all types of entries. https://fedorahosted.org/sssd/ticket/1988
Diffstat (limited to 'src')
-rw-r--r--src/man/sss_cache.8.xml10
-rw-r--r--src/tools/sss_cache.c14
2 files changed, 24 insertions, 0 deletions
diff --git a/src/man/sss_cache.8.xml b/src/man/sss_cache.8.xml
index 2a6bd0f8..bf5e36d7 100644
--- a/src/man/sss_cache.8.xml
+++ b/src/man/sss_cache.8.xml
@@ -39,6 +39,16 @@
<variablelist remap='IP'>
<varlistentry>
<term>
+ <option>-E</option>,<option>--everything</option>
+ </term>
+ <listitem>
+ <para>
+ Invalidate all cached entries except for sudo rules.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
<option>-u</option>,<option>--user</option>
<replaceable>login</replaceable>
</term>
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index c9096fa9..b1139b39 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -38,6 +38,15 @@
#define INVALIDATE_SERVICES 8
#define INVALIDATE_AUTOFSMAPS 16
+#ifdef BUILD_AUTOFS
+#define INVALIDATE_EVERYTHING (INVALIDATE_USERS | INVALIDATE_GROUPS | \
+ INVALIDATE_NETGROUPS | INVALIDATE_SERVICES | \
+ INVALIDATE_AUTOFSMAPS)
+#else
+#define INVALIDATE_EVERYTHING (INVALIDATE_USERS | INVALIDATE_GROUPS | \
+ INVALIDATE_NETGROUPS | INVALIDATE_SERVICES)
+#endif
+
enum sss_cache_entry {
TYPE_USER=0,
TYPE_GROUP,
@@ -517,6 +526,8 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx)
POPT_AUTOHELP
{ "debug", '\0', POPT_ARG_INT | POPT_ARGFLAG_DOC_HIDDEN, &debug,
0, _("The debug level to run with"), NULL },
+ { "everything", 'E', POPT_ARG_NONE, NULL, 'e',
+ _("Invalidate all cached entries except for sudo rulese"), NULL },
{ "user", 'u', POPT_ARG_STRING, &user, 0,
_("Invalidate particular user"), NULL },
{ "users", 'U', POPT_ARG_NONE, NULL, 'u',
@@ -569,6 +580,9 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx)
case 'a':
idb |= INVALIDATE_AUTOFSMAPS;
break;
+ case 'e':
+ idb = INVALIDATE_EVERYTHING;
+ break;
}
}