Lines Matching refs:cmdctx

33 static int autofs_cmd_send_error(struct autofs_cmd_ctx *cmdctx, int err)
35 return sss_cmd_send_error(cmdctx->cctx, err);
39 autofs_cmd_send_empty(struct autofs_cmd_ctx *cmdctx)
41 return sss_cmd_send_empty(cmdctx->cctx, cmdctx);
45 autofs_cmd_done(struct autofs_cmd_ctx *cmdctx, int ret)
53 ret = autofs_cmd_send_empty(cmdctx);
68 ret = autofs_cmd_send_error(cmdctx, ret);
72 sss_cmd_done(cmdctx->cctx, cmdctx);
233 struct autofs_cmd_ctx *cmdctx);
242 struct autofs_cmd_ctx *cmdctx;
252 cmdctx = talloc_zero(client, struct autofs_cmd_ctx);
253 if (!cmdctx) {
256 cmdctx->cctx = client;
258 pctx = talloc_get_type(cmdctx->cctx->protocol_ctx, struct cli_protocol);
278 req = setautomntent_send(cmdctx, rawname, cmdctx);
285 tevent_req_set_callback(req, sss_autofs_cmd_setautomntent_done, cmdctx);
289 return autofs_cmd_done(cmdctx, ret);
294 struct autofs_cmd_ctx *cmdctx =
308 autofs_cmd_done(cmdctx, reqret);
312 pctx = talloc_get_type(cmdctx->cctx->protocol_ctx, struct cli_protocol);
328 talloc_free(cmdctx);
341 sss_cmd_done(cmdctx->cctx, NULL);
350 struct autofs_cmd_ctx *cmdctx;
416 struct autofs_cmd_ctx *cmdctx)
422 struct cli_ctx *client = cmdctx->cctx;
437 state->cmdctx = cmdctx;
445 dctx->cmd_ctx = state->cmdctx;
476 cmdctx->check_next = true;
588 tevent_req_post(req, cmdctx->cctx->ev);
912 getautomntent_process(struct autofs_cmd_ctx *cmdctx,
924 struct autofs_cmd_ctx *cmdctx;
937 cmdctx = talloc_zero(client, struct autofs_cmd_ctx);
938 if (!cmdctx) {
941 cmdctx->cctx = client;
949 pctx = talloc_get_type(cmdctx->cctx->protocol_ctx, struct cli_protocol);
961 cmdctx->mapname = (char *) body+c;
964 if (cmdctx->mapname[namelen] != '\0') {
970 if (!sss_utf8_check((const uint8_t *) cmdctx->mapname, namelen -1)) {
975 SAFEALIGN_COPY_UINT32_CHECK(&cmdctx->cursor, body+c+namelen+1, blen, &c);
976 SAFEALIGN_COPY_UINT32_CHECK(&cmdctx->max_entries, body+c+namelen+1, blen, &c);
980 cmdctx->mapname, cmdctx->cursor, cmdctx->max_entries);
982 ret = get_autofs_map(actx, cmdctx->mapname, &map);
985 req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx);
992 tevent_req_set_callback(req, getautomntent_implicit_done, cmdctx);
1004 req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx);
1011 tevent_req_set_callback(req, getautomntent_implicit_done, cmdctx);
1023 ret = getautomntent_process(cmdctx, map, cmdctx->cursor, cmdctx->max_entries);
1026 return autofs_cmd_done(cmdctx, ret);
1034 struct autofs_cmd_ctx *cmdctx =
1037 talloc_get_type(cmdctx->cctx->rctx->pvt_ctx, struct autofs_ctx);
1050 ret = get_autofs_map(actx, cmdctx->mapname, &map);
1063 ret = getautomntent_process(cmdctx, map,
1064 cmdctx->cursor, cmdctx->max_entries);
1066 autofs_cmd_done(cmdctx, ret);
1071 getautomntent_process(struct autofs_cmd_ctx *cmdctx,
1083 pctx = talloc_get_type(cmdctx->cctx->protocol_ctx, struct cli_protocol);
1098 return autofs_cmd_done(cmdctx, ret);
1139 sss_cmd_done(cmdctx->cctx, cmdctx);
1197 getautomntbyname_process(struct autofs_cmd_ctx *cmdctx,
1207 struct autofs_cmd_ctx *cmdctx;
1220 cmdctx = talloc_zero(client, struct autofs_cmd_ctx);
1221 if (!cmdctx) {
1224 cmdctx->cctx = client;
1232 pctx = talloc_get_type(cmdctx->cctx->protocol_ctx, struct cli_protocol);
1245 cmdctx->mapname = (char *) body+c;
1248 if (cmdctx->mapname[namelen] != '\0') {
1254 if (!sss_utf8_check((const uint8_t *) cmdctx->mapname, namelen -1)) {
1269 cmdctx->key = (char *) body+c;
1272 if (cmdctx->key[keylen] != '\0') {
1278 if (!sss_utf8_check((const uint8_t *) cmdctx->key, keylen -1)) {
1284 "Requested data of map %s key %s\n", cmdctx->mapname, cmdctx->key);
1286 ret = get_autofs_map(actx, cmdctx->mapname, &map);
1289 req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx);
1296 tevent_req_set_callback(req, getautomntbyname_implicit_done, cmdctx);
1308 req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx);
1315 tevent_req_set_callback(req, getautomntbyname_implicit_done, cmdctx);
1325 "Looking up value for [%s] in [%s]\n", cmdctx->key, map->mapname);
1327 ret = getautomntbyname_process(cmdctx, map, cmdctx->key);
1330 return autofs_cmd_done(cmdctx, ret);
1338 struct autofs_cmd_ctx *cmdctx =
1341 talloc_get_type(cmdctx->cctx->rctx->pvt_ctx, struct autofs_ctx);
1354 ret = get_autofs_map(actx, cmdctx->mapname, &map);
1367 ret = getautomntbyname_process(cmdctx, map, cmdctx->key);
1369 autofs_cmd_done(cmdctx, ret);
1374 getautomntbyname_process(struct autofs_cmd_ctx *cmdctx,
1388 pctx = talloc_get_type(cmdctx->cctx->protocol_ctx, struct cli_protocol);
1402 return autofs_cmd_done(cmdctx, ret);
1425 return autofs_cmd_done(cmdctx, ret);
1457 sss_cmd_done(cmdctx->cctx, cmdctx);