|
|
5fca41 |
From 3e04a812772191e2c0e4f4be70584990a7235cbe Mon Sep 17 00:00:00 2001
|
|
|
5fca41 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
5fca41 |
Date: Thu, 15 Aug 2019 12:52:04 +0200
|
|
|
5fca41 |
Subject: [PATCH 87/90] autofs: allow to run only setent without enumeration in
|
|
|
5fca41 |
test tool
|
|
|
5fca41 |
MIME-Version: 1.0
|
|
|
5fca41 |
Content-Type: text/plain; charset=UTF-8
|
|
|
5fca41 |
Content-Transfer-Encoding: 8bit
|
|
|
5fca41 |
|
|
|
5fca41 |
So we can test that setent stores only the map object.
|
|
|
5fca41 |
|
|
|
5fca41 |
Resolves:
|
|
|
5fca41 |
https://pagure.io/SSSD/sssd/issue/2607
|
|
|
5fca41 |
|
|
|
5fca41 |
Reviewed-by: Tomáš Halman <thalman@redhat.com>
|
|
|
5fca41 |
---
|
|
|
5fca41 |
src/sss_client/autofs/autofs_test_client.c | 6 ++++++
|
|
|
5fca41 |
1 file changed, 6 insertions(+)
|
|
|
5fca41 |
|
|
|
5fca41 |
diff --git a/src/sss_client/autofs/autofs_test_client.c b/src/sss_client/autofs/autofs_test_client.c
|
|
|
5fca41 |
index 6bbd2a0e8..18d666895 100644
|
|
|
5fca41 |
--- a/src/sss_client/autofs/autofs_test_client.c
|
|
|
5fca41 |
+++ b/src/sss_client/autofs/autofs_test_client.c
|
|
|
5fca41 |
@@ -44,9 +44,11 @@ int main(int argc, const char *argv[])
|
|
|
5fca41 |
char *key = NULL;
|
|
|
5fca41 |
char *value = NULL;
|
|
|
5fca41 |
char *pc_key = NULL;
|
|
|
5fca41 |
+ int pc_setent = 0;
|
|
|
5fca41 |
struct poptOption long_options[] = {
|
|
|
5fca41 |
POPT_AUTOHELP
|
|
|
5fca41 |
{ "by-name", 'n', POPT_ARG_STRING, &pc_key, 0, "Request map by name", NULL },
|
|
|
5fca41 |
+ { "only-setent", 's', POPT_ARG_VAL, &pc_setent, 1, "Run only setent, do not enumerate", NULL },
|
|
|
5fca41 |
POPT_TABLEEND
|
|
|
5fca41 |
};
|
|
|
5fca41 |
poptContext pc = NULL;
|
|
|
5fca41 |
@@ -75,6 +77,10 @@ int main(int argc, const char *argv[])
|
|
|
5fca41 |
}
|
|
|
5fca41 |
printf("setautomntent done for %s\n", mapname);
|
|
|
5fca41 |
|
|
|
5fca41 |
+ if (pc_setent) {
|
|
|
5fca41 |
+ goto end;
|
|
|
5fca41 |
+ }
|
|
|
5fca41 |
+
|
|
|
5fca41 |
if (!pc_key) {
|
|
|
5fca41 |
do {
|
|
|
5fca41 |
ret = _sss_getautomntent_r(&key, &value, ctx);
|
|
|
5fca41 |
--
|
|
|
5fca41 |
2.20.1
|
|
|
5fca41 |
|