diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 11:40:19 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 20:55:47 +0100 |
commit | 53aefebdca2ec9151aff87ae21ee4203eaa9a03a (patch) | |
tree | e51c7dd8eb2e436d60156280b5668d8f0f728f4f /src/tools/sss_userdel.c | |
parent | dd1dbf1e10a864f4ec0796aae3a6f272104b098e (diff) | |
download | sssd-53aefebdca2ec9151aff87ae21ee4203eaa9a03a.tar.gz sssd-53aefebdca2ec9151aff87ae21ee4203eaa9a03a.tar.xz sssd-53aefebdca2ec9151aff87ae21ee4203eaa9a03a.zip |
TOOLS: Split querying nss responder into a separate function
The tools query the responder in order to sync the memcache after
performing changes to the local database. The functions will be reused
by other tools so I split them into a separate functions.
Diffstat (limited to 'src/tools/sss_userdel.c')
-rw-r--r-- | src/tools/sss_userdel.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c index 84ae96091..1f7d5fa6a 100644 --- a/src/tools/sss_userdel.c +++ b/src/tools/sss_userdel.c @@ -32,7 +32,6 @@ #include "util/find_uid.h" #include "tools/tools_util.h" #include "tools/sss_sync_ops.h" -#include "sss_client/sss_cli.h" #ifndef KILL_CMD #define KILL_CMD "killall" @@ -121,10 +120,6 @@ int main(int argc, const char **argv) int ret = EXIT_SUCCESS; struct tools_ctx *tctx = NULL; const char *pc_username = NULL; - struct sss_cli_req_data rd; - uint8_t *repbuf = NULL; - size_t replen; - enum nss_status nret; int pc_debug = SSSDBG_DEFAULT; int pc_remove = 0; @@ -292,18 +287,11 @@ int main(int argc, const char **argv) } /* Delete user from memory cache */ - rd.data = pc_username; - rd.len = strlen(pc_username) + 1; - - sss_nss_lock(); - nret = sss_nss_make_request(SSS_NSS_GETPWNAM, &rd, - &repbuf, &replen, &ret); - - sss_nss_unlock(); - free(repbuf); - if (nret != NSS_STATUS_SUCCESS && nret != NSS_STATUS_NOTFOUND) { + ret = sss_mc_refresh_user(pc_username); + if (ret != EOK) { ERROR("NSS request failed (%1$d). Entry might remain in memory " - "cache.\n",nret); + "cache.\n", ret); + /* Nothing we can do about it */ } if (tctx->octx->remove_homedir) { |