Lines Matching refs:sbus_req
88 int ifp_users_find_by_name(struct sbus_request *sbus_req,
101 req = cache_req_user_by_name_send(sbus_req, ctx->rctx->ev, ctx->rctx,
107 tevent_req_set_callback(req, ifp_users_find_by_name_done, sbus_req);
116 struct sbus_request *sbus_req;
122 sbus_req = tevent_req_callback_data(req, struct sbus_request);
124 ret = cache_req_user_by_name_recv(sbus_req, req, &result, &domain, NULL);
127 error = sbus_error_new(sbus_req, SBUS_ERROR_NOT_FOUND,
131 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
136 object_path = ifp_users_build_path_from_msg(sbus_req, domain,
139 error = sbus_error_new(sbus_req, SBUS_ERROR_INTERNAL,
148 sbus_request_fail_and_finish(sbus_req, error);
152 iface_ifp_users_FindByName_finish(sbus_req, object_path);
158 int ifp_users_find_by_id(struct sbus_request *sbus_req,
171 req = cache_req_user_by_id_send(sbus_req, ctx->rctx->ev, ctx->rctx,
177 tevent_req_set_callback(req, ifp_users_find_by_id_done, sbus_req);
186 struct sbus_request *sbus_req;
192 sbus_req = tevent_req_callback_data(req, struct sbus_request);
194 ret = cache_req_user_by_id_recv(sbus_req, req, &result, &domain);
197 error = sbus_error_new(sbus_req, SBUS_ERROR_NOT_FOUND,
201 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
206 object_path = ifp_users_build_path_from_msg(sbus_req, domain,
209 error = sbus_error_new(sbus_req, SBUS_ERROR_INTERNAL,
216 sbus_request_fail_and_finish(sbus_req, error);
220 iface_ifp_users_FindByID_finish(sbus_req, object_path);
226 int ifp_users_find_by_cert(struct sbus_request *sbus_req, void *data,
241 ret = sss_cert_pem_to_derb64(sbus_req, pem_cert, &derb64);
249 error = sbus_error_new(sbus_req, DBUS_ERROR_INVALID_ARGS,
251 sbus_request_fail_and_finish(sbus_req, error);
257 req = cache_req_user_by_cert_send(sbus_req, ctx->rctx->ev, ctx->rctx,
263 tevent_req_set_callback(req, ifp_users_find_by_cert_done, sbus_req);
271 struct sbus_request *sbus_req;
277 sbus_req = tevent_req_callback_data(req, struct sbus_request);
279 ret = cache_req_user_by_cert_recv(sbus_req, req, &result, &domain, NULL);
282 error = sbus_error_new(sbus_req, SBUS_ERROR_NOT_FOUND,
286 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
291 object_path = ifp_users_build_path_from_msg(sbus_req, domain,
294 error = sbus_error_new(sbus_req, SBUS_ERROR_INTERNAL,
301 sbus_request_fail_and_finish(sbus_req, error);
305 iface_ifp_users_FindByCertificate_finish(sbus_req, object_path);
334 int ifp_users_list_by_name(struct sbus_request *sbus_req,
348 list_ctx = ifp_list_ctx_new(sbus_req, ctx, filter, limit);
378 struct sbus_request *sbus_req;
384 sbus_req = list_ctx->sbus_req;
386 ret = cache_req_user_by_name_recv(sbus_req, req, &result, &domain, NULL);
389 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
391 sbus_request_fail_and_finish(sbus_req, error);
397 error = sbus_error_new(sbus_req, SBUS_ERROR_INTERNAL,
399 sbus_request_fail_and_finish(sbus_req, error);
410 error = sbus_error_new(sbus_req, SBUS_ERROR_INTERNAL,
412 sbus_request_fail_and_finish(sbus_req, error);
419 iface_ifp_users_ListByName_finish(list_ctx->sbus_req,
426 int ifp_users_list_by_domain_and_name(struct sbus_request *sbus_req,
442 list_ctx = ifp_list_ctx_new(sbus_req, ctx, filter, limit);
462 struct sbus_request *sbus_req;
469 sbus_req = list_ctx->sbus_req;
471 ret = cache_req_user_by_name_recv(sbus_req, req, &result, &domain, NULL);
474 error = sbus_error_new(sbus_req, SBUS_ERROR_NOT_FOUND,
478 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
490 error = sbus_error_new(sbus_req, SBUS_ERROR_INTERNAL,
500 sbus_request_fail_and_finish(sbus_req, error);
504 iface_ifp_users_ListByDomainAndName_finish(sbus_req,
511 ifp_users_user_get(struct sbus_request *sbus_req,
522 ret = ifp_users_decompose_path(ifp_ctx->rctx->domains, sbus_req->path,
526 "[%s] [%d]: %s\n", sbus_req->path, ret, sss_strerror(ret));
531 ret = sysdb_getpwuid_with_views(sbus_req, domain, uid, &res);
558 static void ifp_users_get_as_string(struct sbus_request *sbus_req,
581 ret = ifp_users_user_get(sbus_req, ifp_ctx, NULL, &domain, &msg);
591 static void ifp_users_get_name(struct sbus_request *sbus_req,
615 ret = ifp_users_user_get(sbus_req, ifp_ctx, NULL, &domain, &msg);
626 *_out = ifp_format_name_attr(sbus_req, ifp_ctx, in_name, domain);
630 static void ifp_users_get_as_uint32(struct sbus_request *sbus_req,
653 ret = ifp_users_user_get(sbus_req, ifp_ctx, NULL, &domain, &msg);
665 int ifp_users_user_update_groups_list(struct sbus_request *sbus_req,
681 ret = ifp_users_user_get(sbus_req, data, NULL, &domain, &user);
692 req = cache_req_initgr_by_name_send(sbus_req, ctx->rctx->ev, ctx->rctx,
700 sbus_req);
708 struct sbus_request *sbus_req;
711 sbus_req = tevent_req_callback_data(req, struct sbus_request);
713 ret = cache_req_initgr_by_name_recv(sbus_req, req, NULL, NULL, NULL);
716 error = sbus_error_new(sbus_req, SBUS_ERROR_NOT_FOUND,
720 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
727 sbus_request_fail_and_finish(sbus_req, error);
731 iface_ifp_users_user_UpdateGroupsList_finish(sbus_req);
735 void ifp_users_user_get_name(struct sbus_request *sbus_req,
739 ifp_users_get_name(sbus_req, data, SYSDB_NAME, _out);
742 void ifp_users_user_get_uid_number(struct sbus_request *sbus_req,
746 ifp_users_get_as_uint32(sbus_req, data, SYSDB_UIDNUM, _out);
749 void ifp_users_user_get_gid_number(struct sbus_request *sbus_req,
753 ifp_users_get_as_uint32(sbus_req, data, SYSDB_GIDNUM, _out);
756 void ifp_users_user_get_gecos(struct sbus_request *sbus_req,
760 ifp_users_get_as_string(sbus_req, data, SYSDB_GECOS, _out);
763 void ifp_users_user_get_home_directory(struct sbus_request *sbus_req,
767 ifp_users_get_as_string(sbus_req, data, SYSDB_HOMEDIR, _out);
770 void ifp_users_user_get_login_shell(struct sbus_request *sbus_req,
774 ifp_users_get_as_string(sbus_req, data, SYSDB_SHELL, _out);
777 void ifp_users_user_get_unique_id(struct sbus_request *sbus_req,
781 ifp_users_get_as_string(sbus_req, data, SYSDB_UUID, _out);
784 void ifp_users_user_get_groups(struct sbus_request *sbus_req,
815 ret = ifp_users_user_get(sbus_req, ifp_ctx, NULL, &domain, &user);
827 ret = sysdb_initgroups_with_views(sbus_req, domain, username, &res);
838 out = talloc_zero_array(sbus_req, const char *, res->count);
867 void ifp_users_user_get_extra_attributes(struct sbus_request *sbus_req,
896 extra = ifp_get_user_extra_attributes(sbus_req, ifp_ctx);
902 ret = ifp_users_user_get(sbus_req, data, &uid, &domain, NULL);
907 basedn = sysdb_user_base_dn(sbus_req, domain);
913 filter = talloc_asprintf(sbus_req, "(&(%s=%s)(%s=%u))",
921 ret = sysdb_search_entry(sbus_req, domain->sysdb, basedn,
938 ret = sss_hash_create(sbus_req, 10, &table);
980 int ifp_cache_list_user(struct sbus_request *sbus_req,
983 return ifp_cache_list(sbus_req, data, IFP_CACHE_USER);
986 int ifp_cache_list_by_domain_user(struct sbus_request *sbus_req,
990 return ifp_cache_list_by_domain(sbus_req, data, domain, IFP_CACHE_USER);
993 int ifp_cache_object_store_user(struct sbus_request *sbus_req,
1001 ret = ifp_users_user_get(sbus_req, data, NULL, &domain, &user);
1003 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
1005 return sbus_request_fail_and_finish(sbus_req, error);
1009 return ifp_cache_object_store(sbus_req, domain, user->dn);
1012 int ifp_cache_object_remove_user(struct sbus_request *sbus_req,
1020 ret = ifp_users_user_get(sbus_req, data, NULL, &domain, &user);
1022 error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to fetch "
1024 return sbus_request_fail_and_finish(sbus_req, error);
1028 return ifp_cache_object_remove(sbus_req, domain, user->dn);