autofssrv_cmd.c revision 129310e872a0a70e721ba59363e518176ef406d6
08d6658a4e2ec8104cd1307f6baa75fdb07a24f8Mark Washenberger Jakub Hrozek <jhrozek@redhat.com>
a550b0fbcf7e876eeb88f4528209ed28cc416752Timo Sirainen Copyright (C) 2012 Red Hat
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen Autofs responder: commands
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen This program is free software; you can redistribute it and/or modify
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen it under the terms of the GNU General Public License as published by
d99107ddf4d9bccb710994482daf65276a9d6321Timo Sirainen the Free Software Foundation; either version 3 of the License, or
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen (at your option) any later version.
ecb1b2d6236942bf82f822e8d0167f0e160b206dTimo Sirainen This program is distributed in the hope that it will be useful,
657afb33796f8216c568ad813627da89970760beTimo Sirainen but WITHOUT ANY WARRANTY; without even the implied warranty of
657afb33796f8216c568ad813627da89970760beTimo Sirainen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen GNU General Public License for more details.
a3b3e5b452be15049a1f8bfd5b3bb640af41121cTimo Sirainen You should have received a copy of the GNU General Public License
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
5363f51ad46344f4e5952f2fef211a7cf8f95ddcTimo Sirainenstatic int autofs_cmd_send_error(struct autofs_cmd_ctx *cmdctx, int err)
657afb33796f8216c568ad813627da89970760beTimo Sirainenautofs_cmd_send_empty(struct autofs_cmd_ctx *cmdctx)
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen return sss_cmd_send_empty(cmdctx->cctx, cmdctx);
ad49932dae8ba31e07544b66bbc4f4de707a751cTimo Sirainenautofs_cmd_done(struct autofs_cmd_ctx *cmdctx, int ret)
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* all fine, just return here */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* async processing, just return here */
a7e2c98560cf54dc656711a237cb07da8a5a9ee4Timo Sirainen /* very bad error */
cc4d0d30fbba883d5d1b600646491fb77bdb989cTimo Sirainen return setent_add_ref(memctx, map_ctx, &map_ctx->reqs, req);
cc4d0d30fbba883d5d1b600646491fb77bdb989cTimo Sirainenautofs_setent_notify(struct autofs_map_ctx *map_ctx, errno_t ret)
9d75363d3fbabc2fbc2d80f06672e3ed8965804aTimo Sirainen *map = talloc_get_type(value.ptr, struct autofs_map_ctx);
fbee9bffb56d882b98146dd0de76a5bcccc2bdc3Timo Sirainen } else if (hret == HASH_ERROR_KEY_NOT_FOUND) {
5363f51ad46344f4e5952f2fef211a7cf8f95ddcTimo Sirainen ("Unexpected error reading from autofs map hash [%d][%s]\n",
5363f51ad46344f4e5952f2fef211a7cf8f95ddcTimo Sirainenstatic int autofs_map_hash_remove (TALLOC_CTX *ctx);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Missing netgroup name.\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* Add this entry to the hash table */
ea95a057fa5f02d50027122cacd3147fce7679faTimo Sirainen ("Unable to add hash table entry for [%s]", key.str));
ea95a057fa5f02d50027122cacd3147fce7679faTimo Sirainen ("Hash error [%d][%s]", hret, hash_error_string(hret)));
e69e7b734b625de1f8921b7e0d92afa1df6b900dTimo Sirainen talloc_set_destructor((TALLOC_CTX *) map, autofs_map_hash_remove);
1e0bdb2d0fa7bbd0a0a254754680f6c6d0195333Timo Sirainen /* Remove the netgroup result object from the lookup table */
aefe17424820c57bcb05b0aaec4a930e8222baccTimo Sirainen ("Could not remove key from table! [%d][%s]\n",
662a9000b1788f1cdf765e6b1c89df9a42cc3e32Timo Sirainenstatic struct tevent_req *
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainenstatic errno_t setautomntent_recv(struct tevent_req *req);
662a9000b1788f1cdf765e6b1c89df9a42cc3e32Timo Sirainenstatic void sss_autofs_cmd_setautomntent_done(struct tevent_req *req);
ccef83820a01bb37ad48653a05a9c5aa6560826aTimo Sirainen/* FIXME - file a ticket to have per-responder private
ccef83820a01bb37ad48653a05a9c5aa6560826aTimo Sirainen * data instead of growing the cli_ctx structure */
ccef83820a01bb37ad48653a05a9c5aa6560826aTimo Sirainensss_autofs_cmd_setautomntent(struct cli_ctx *client)
662a9000b1788f1cdf765e6b1c89df9a42cc3e32Timo Sirainen DEBUG(SSSDBG_TRACE_INTERNAL, ("sss_autofs_cmd_setautomntent\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen cmdctx = talloc_zero(client, struct autofs_cmd_ctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen sss_packet_get_body(client->creq->in, &body, &blen);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen /* if not terminated fail */
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen /* If the body isn't valid UTF-8, fail */
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen ("Got request for automount map named %s\n", rawname));
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen req = setautomntent_send(cmdctx, rawname, cmdctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen DEBUG(0, ("Fatal error calling setautomntent_send\n"));
2c8ff32886e56a5e037169c9ebef4219f85a5629Timo Sirainen tevent_req_set_callback(req, sss_autofs_cmd_setautomntent_done, cmdctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainenstatic void sss_autofs_cmd_setautomntent_done(struct tevent_req *req)
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen tevent_req_callback_data(req, struct autofs_cmd_ctx);
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_TRACE_INTERNAL, ("setautomntent done\n"));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_recv failed\n"));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen /* Either we succeeded or no domains were eligible */
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_TRACE_FUNC, ("setautomntent did not find requested map\n"));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen /* Notify the caller that this entry wasn't found */
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen sss_cmd_empty_packet(cmdctx->cctx->creq->out);
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_TRACE_FUNC, ("setautomntent found data\n"));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen ret = sss_packet_grow(packet, 2*sizeof(uint32_t));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Couldn't grow the packet\n"));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen ((uint32_t *)body)[0] = 1; /* Got some results */
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Error creating packet\n"));
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainenlookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx);
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainenautofs_map_result_timeout(struct tevent_context *ev,
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen /* Free the autofs map result context
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen * The destructor for the autofs map will remove itself
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen * from the hash table
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("Could not set up life timer for autofs maps. "
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen "Entries may become stale.\n"));
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainenstatic struct tevent_req *
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen talloc_get_type(client->rctx->pvt_ctx, struct autofs_ctx);
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen req = tevent_req_create(mem_ctx, &state, struct setautomntent_state);
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen ("Could not create tevent request for setautomntent\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen dctx = talloc_zero(state, struct autofs_dom_ctx);
91233a89f0060f95542ed661683e5d99a50f1778Timo Sirainen DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ret = sss_parse_name(state, client->rctx->names, rawname,
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("Requesting info for automount map [%s] from [%s]\n",
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen dctx->domain = responder_get_domain(client->rctx->domains, domname);
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen client->automntmap_name = talloc_strdup(client, rawname);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* this is a multidomain search */
48ac75465ae154b1d705f18de6d95045ab714b65Timo Sirainen client->automntmap_name = talloc_strdup(client, state->mapname);
a72dde3805d0e9148de4caf44d6f4dc167431380Timo Sirainen dctx->check_provider = NEED_CHECK_PROVIDER(dctx->domain->provider);
a72dde3805d0e9148de4caf44d6f4dc167431380Timo Sirainen /* Is the result context already available?
a72dde3805d0e9148de4caf44d6f4dc167431380Timo Sirainen * Check for existing lookups for this map
a72dde3805d0e9148de4caf44d6f4dc167431380Timo Sirainen ret = get_autofs_map(actx, state->mapname, &state->map);
a72dde3805d0e9148de4caf44d6f4dc167431380Timo Sirainen /* Another process already requested this map
a72dde3805d0e9148de4caf44d6f4dc167431380Timo Sirainen * Check whether it's ready for processing.
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen ("Map %s is ready to be processed\n", state->mapname));
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen ("Map %s was marked as nonexistent\n", state->mapname));
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen /* Result object is still being constructed
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen * Register for notification when it's ready
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen ("Map %s is being looked up, registering for notification\n",
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen ret = autofs_setent_add_ref(state, state->map, req);
9ed2951bd0bb1878a27437d7c00611b2baadd614Timo Sirainen /* Will return control below */
7242e1ce7803b83bc82e239ef111b47c1c72dd4bAndrey Panin ("Map %s needs to be looked up\n", state->mapname));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen state->map = talloc_zero(actx, struct autofs_map_ctx);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen state->map->mapname = talloc_strdup(state->map, state->mapname);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ret = autofs_setent_add_ref(state, state->map, req);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* Perform lookup */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen lookup_ctx = talloc_zero(state->map, struct setautomntent_lookup_ctx);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* Steal the dom_ctx onto the lookup_ctx so it doesn't go out of scope if
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen * this request is canceled while other requests are in-progress.
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen lookup_ctx->dctx = talloc_steal(lookup_ctx, state->dctx);
382c7aec3e3449ed8271c2a202b67cefaa31dc8eTimo Sirainen DEBUG(SSSDBG_TRACE_INTERNAL, ("lookup_automntmap_step "
382c7aec3e3449ed8271c2a202b67cefaa31dc8eTimo Sirainen "is refreshing the cache, re-entering the mainloop\n"));
382c7aec3e3449ed8271c2a202b67cefaa31dc8eTimo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get data from cache\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("Unexpected error from get_autofs_map [%d]: %s\n",
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainenlookup_automntmap_update_cache(struct setautomntent_lookup_ctx *lookup_ctx);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainenlookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx)
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen struct sss_domain_info *dom = lookup_ctx->dctx->domain;
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen struct autofs_dom_ctx *dctx = lookup_ctx->dctx;
4f2248a8a70985c7295afc3bf91c848e81d740d9Timo Sirainen /* Check each domain for this map name */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* if it is a domainless search, skip domains that require fully
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen * qualified names instead */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen while (dom && dctx->cmd_ctx->check_next && dom->fqnames) {
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* No domains left to search */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen if (!dom) break;
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen /* make sure we reset the check_provider flag when we check
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen * a new domain */
50782de8a9d5ebe11ee61496b4e695a1d3875230Timo Sirainen /* make sure to update the dctx if we changed domain */
e76073ebaf90fa29abfdc364873acf78983949aaTimo Sirainen DEBUG(SSSDBG_TRACE_FUNC, ("Requesting info for [%s@%s]\n",
2c8ff32886e56a5e037169c9ebef4219f85a5629Timo Sirainen ret = sysdb_get_ctx_from_list(lookup_ctx->rctx->db_list, dom, &sysdb);
657afb33796f8216c568ad813627da89970760beTimo Sirainen ("Fatal: Sysdb CTX not found for this domain!\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* Look into the cache */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ret = sysdb_get_map_byname(dctx, sysdb, lookup_ctx->mapname,
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen DEBUG(SSSDBG_OP_FAILURE, ("Could not check cache\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("No automount map [%s] in cache for domain [%s]\n",
3ccab0bac68040f179a7de45c516cec258e28fdbTimo Sirainen DEBUG(SSSDBG_TRACE_INTERNAL, ("Moving on to next domain\n"));
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen ret = get_autofs_map(lookup_ctx->actx, lookup_ctx->mapname, &map);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* Something really bad happened! */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Autofs map entry was lost!\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen if (dctx->map == NULL && !dctx->check_provider) {
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("Autofs map not found, setting negative cache\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen set_autofs_map_lifetime(lookup_ctx->actx->neg_timeout, lookup_ctx, map);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ret = lookup_automntmap_update_cache(lookup_ctx);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("Looking up automount maps from the DP\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ("Error looking up automount maps [%d]: %s\n",
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* OK, the map is in cache and valid.
50782de8a9d5ebe11ee61496b4e695a1d3875230Timo Sirainen * Let's get all members and return it
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainen ret = sysdb_autofs_entries_by_map(map, sysdb, map->mapname,
615c4aba4cc0b17eefba3263b85972adaba04586Timo Sirainen ("Error looking automount map entries [%d]: %s\n",
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen set_autofs_map_lifetime(lookup_ctx->actx->neg_timeout, lookup_ctx, map);
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainen ("setautomntent done for map %s\n", lookup_ctx->mapname));
3313a51ef9b245248d672c20f930c52a577a42f7Timo Sirainen set_autofs_map_lifetime(dom->autofsmap_timeout, lookup_ctx, map);
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen map = talloc_zero(lookup_ctx->actx, struct autofs_map_ctx);
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen map->mapname = talloc_strdup(map, lookup_ctx->mapname);
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen set_autofs_map_lifetime(lookup_ctx->actx->neg_timeout, lookup_ctx, map);
0f39a57760d93cddbce3ca43096d78e0fe2f42fdTimo Sirainen /* If we've gotten here, then no domain contained this map */
ecb1b2d6236942bf82f822e8d0167f0e160b206dTimo Sirainenstatic void lookup_automntmap_cache_updated(uint16_t err_maj, uint32_t err_min,
d5cebe7f98e63d4e2822863ef2faa4971e8b3a5dTimo Sirainenstatic void autofs_dp_send_map_req_done(struct tevent_req *req);
daa7e7459749ae8f82cd3eed9c44522d81c609a3Timo Sirainenlookup_automntmap_update_cache(struct setautomntent_lookup_ctx *lookup_ctx)
657afb33796f8216c568ad813627da89970760beTimo Sirainen struct autofs_dom_ctx *dctx = lookup_ctx->dctx;
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen cache_expire = ldb_msg_find_attr_as_uint64(dctx->map,
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* if we have any reply let's check cache validity */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen ret = sss_cmd_check_cache(dctx->map, 0, cache_expire);
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen DEBUG(SSSDBG_TRACE_FUNC, ("Cached entry is valid, returning..\n"));
226259ee6fb9830dafc1a5ba1e95bf5a4345b406Timo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Error checking cache: %d\n", ret));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* dont loop forever :-) */
615c4aba4cc0b17eefba3263b85972adaba04586Timo Sirainen /* keep around current data in case backend is offline */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen /* FIXME - do this by default */
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen req = sss_dp_get_autofs_send(lookup_ctx->cctx, lookup_ctx->rctx,
ad49932dae8ba31e07544b66bbc4f4de707a751cTimo Sirainen ("Out of memory sending data provider request\n"));
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen cb_ctx = talloc_zero(lookup_ctx->dctx, struct dp_callback_ctx);
3b8d05391336c0e4d24c8ddcc962f350409ffbd3Timo Sirainen cb_ctx->callback = lookup_automntmap_cache_updated;
3b8d05391336c0e4d24c8ddcc962f350409ffbd3Timo Sirainen cb_ctx->cctx = lookup_ctx->dctx->cmd_ctx->cctx;
3b8d05391336c0e4d24c8ddcc962f350409ffbd3Timo Sirainen tevent_req_set_callback(req, autofs_dp_send_map_req_done, cb_ctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen ret = autofs_cmd_send_error(lookup_ctx->dctx->cmd_ctx, ret);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n"));
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen autofs_cmd_done(lookup_ctx->dctx->cmd_ctx, ret);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainenstatic void autofs_dp_send_map_req_done(struct tevent_req *req)
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen tevent_req_callback_data(req, struct dp_callback_ctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen talloc_get_type(cb_ctx->ptr, struct setautomntent_lookup_ctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen ret = sss_dp_get_autofs_recv(cb_ctx->mem_ctx, req,
50782de8a9d5ebe11ee61496b4e695a1d3875230Timo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n"));
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainen cb_ctx->callback(err_maj, err_min, err_msg, cb_ctx->ptr);
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainenstatic void lookup_automntmap_cache_updated(uint16_t err_maj, uint32_t err_min,
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen talloc_get_type(ptr, struct setautomntent_lookup_ctx);
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen struct autofs_dom_ctx *dctx = lookup_ctx->dctx;
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen ("Unable to get information from Data Provider\n"
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen "Error: %u, %u, %s\n"
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen "Will try to return what we have in cache\n",
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen (unsigned int)err_maj, (unsigned int)err_min, err_msg));
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen /* Loop to the next domain if possible */
2872c818f9c6704609f4d67d984b033a63e3a108Timo Sirainen if (dctx->domain->next && dctx->cmd_ctx->check_next) {
static errno_t
return EOK;
static errno_t
char *name;
size_t c = 0;
if (!cmdctx) {
return ENOMEM;
if (!actx) {
return EIO;
if (namelen == 0) {
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
static errno_t
const char *key;
const char *value;
return ret;
goto done;
goto done;
goto done;
rp = 0;
done:
return EOK;
static errno_t
const char *key);
char *name;
char *key;
size_t c = 0;
if (!cmdctx) {
return ENOMEM;
if (!actx) {
return EIO;
if (namelen == 0) {
goto done;
goto done;
goto done;
if (keylen == 0) {
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
static errno_t
const char *key)
size_t i;
const char *value;
return ret;
goto done;
goto done;
goto done;
rp = 0;
done:
return EOK;
return ret;
return EOK;
return autofs_cli_protocol_version;
return autofs_cmds;