Lines Matching refs:tmp_ctx
208 TALLOC_CTX *tmp_ctx;
210 tmp_ctx = talloc_new(NULL);
211 if (!tmp_ctx) {
221 ret = sysdb_search_entry(tmp_ctx, sysdb, dn,
257 talloc_free(tmp_ctx);
273 TALLOC_CTX *tmp_ctx;
277 tmp_ctx = talloc_new(NULL);
278 if (tmp_ctx == NULL) {
283 ret = ldb_search(ldb, tmp_ctx, &res,
300 talloc_zfree(tmp_ctx);
359 TALLOC_CTX *tmp_ctx;
367 tmp_ctx = talloc_new(NULL);
368 if (!tmp_ctx) {
372 basedn = ldb_dn_new_fmt(tmp_ctx, domain->sysdb->ldb,
379 filter = talloc_asprintf(tmp_ctx, filter_str, sid_str);
385 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, basedn, LDB_SCOPE_SUBTREE,
402 talloc_zfree(tmp_ctx);
420 TALLOC_CTX *tmp_ctx;
429 tmp_ctx = talloc_new(NULL);
430 if (tmp_ctx == NULL) {
434 dn_filter = talloc_asprintf(tmp_ctx, "(&(%s)%s(|", object_class, filter);
462 talloc_zfree(tmp_ctx);
473 TALLOC_CTX *tmp_ctx;
484 tmp_ctx = talloc_new(NULL);
485 if (!tmp_ctx) {
493 basedn = sysdb_user_base_dn(tmp_ctx, domain);
503 basedn = sysdb_domain_dn(tmp_ctx, domain);
506 basedn = sysdb_group_base_dn(tmp_ctx, domain);
519 ret = sss_filter_sanitize_for_dom(tmp_ctx, name, domain, &sanitized_name,
525 filter = talloc_asprintf(tmp_ctx, filter_tmpl, lc_sanitized_name,
532 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, basedn, LDB_SCOPE_SUBTREE,
553 talloc_zfree(tmp_ctx);
572 TALLOC_CTX *tmp_ctx;
580 tmp_ctx = talloc_new(NULL);
581 if (!tmp_ctx) {
585 basedn = sysdb_user_base_dn(tmp_ctx, domain);
591 filter = talloc_asprintf(tmp_ctx, SYSDB_PWUID_FILTER, (unsigned long)uid);
601 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, basedn,
618 talloc_zfree(tmp_ctx);
642 TALLOC_CTX *tmp_ctx;
650 tmp_ctx = talloc_new(NULL);
651 if (tmp_ctx == NULL) {
656 ret = sss_filter_sanitize(tmp_ctx, upn, &sanitized);
663 base_dn = sysdb_user_base_dn(tmp_ctx, domain);
665 base_dn = sysdb_base_dn(domain->sysdb, tmp_ctx);
672 ret = ldb_search(domain->sysdb->ldb, tmp_ctx, &res,
706 talloc_zfree(tmp_ctx);
717 TALLOC_CTX *tmp_ctx;
721 tmp_ctx = talloc_new(NULL);
722 if (tmp_ctx == NULL) {
727 ret = sysdb_search_user_by_upn_res(tmp_ctx, domain, domain_scope, upn, attrs, &res);
741 talloc_zfree(tmp_ctx);
762 TALLOC_CTX *tmp_ctx;
770 tmp_ctx = talloc_new(NULL);
771 if (!tmp_ctx) {
775 basedn = sysdb_group_base_dn(tmp_ctx, domain);
781 filter = talloc_asprintf(tmp_ctx, SYSDB_GRGID_FILTER, (unsigned long)gid);
791 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, basedn, LDB_SCOPE_SUBTREE,
808 talloc_zfree(tmp_ctx);
833 TALLOC_CTX *tmp_ctx;
840 tmp_ctx = talloc_new(NULL);
841 if (!tmp_ctx) {
845 basedn = sysdb_netgroup_dn(tmp_ctx, domain, name);
851 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, basedn, LDB_SCOPE_BASE,
867 talloc_zfree(tmp_ctx);
882 TALLOC_CTX *tmp_ctx;
891 tmp_ctx = talloc_new(NULL);
892 if (tmp_ctx == NULL) {
897 ret = sysdb_search_ts_entry(tmp_ctx,
926 talloc_zfree(tmp_ctx);
942 TALLOC_CTX *tmp_ctx;
948 tmp_ctx = talloc_new(NULL);
949 if (tmp_ctx == NULL) {
958 msg = sysdb_attrs2msg(tmp_ctx, entry_dn, attrs, 0);
978 talloc_zfree(tmp_ctx);
1023 TALLOC_CTX *tmp_ctx;
1031 tmp_ctx = talloc_new(NULL);
1032 if (tmp_ctx == NULL) {
1037 ts_attrs = sysdb_new_attrs(tmp_ctx);
1085 talloc_free(tmp_ctx);
1163 TALLOC_CTX *tmp_ctx;
1166 tmp_ctx = talloc_new(NULL);
1167 if (!tmp_ctx) {
1171 ret = get_sysdb_obj_dn(tmp_ctx, domain, obj_type, obj_name, &entry_dn);
1179 talloc_zfree(tmp_ctx);
1191 TALLOC_CTX *tmp_ctx;
1198 tmp_ctx = talloc_new(NULL);
1199 if (tmp_ctx == NULL) {
1203 ret = get_sysdb_obj_dn(tmp_ctx, domain, obj_type, obj_name, &entry_dn);
1208 ts_attrs = ts_obj_attrs(tmp_ctx, obj_type);
1221 talloc_zfree(tmp_ctx);
1262 TALLOC_CTX *tmp_ctx;
1264 tmp_ctx = talloc_new(NULL);
1265 if (!tmp_ctx) {
1274 msg = sysdb_attrs2msg(tmp_ctx, entry_dn, attrs, mod_op);
1296 talloc_zfree(tmp_ctx);
1376 TALLOC_CTX *tmp_ctx;
1383 tmp_ctx = talloc_new(NULL);
1384 if (!tmp_ctx) {
1388 ts_attrs = sysdb_filter_ts_attrs(tmp_ctx, attrs);
1407 talloc_zfree(tmp_ctx);
1419 TALLOC_CTX *tmp_ctx;
1422 tmp_ctx = talloc_new(NULL);
1423 if (!tmp_ctx) {
1427 dn = sysdb_user_dn(tmp_ctx, domain, name);
1440 talloc_zfree(tmp_ctx);
1452 TALLOC_CTX *tmp_ctx;
1455 tmp_ctx = talloc_new(NULL);
1456 if (!tmp_ctx) {
1461 dn = sysdb_group_dn(tmp_ctx, domain, name);
1474 talloc_free(tmp_ctx);
1487 TALLOC_CTX *tmp_ctx;
1489 tmp_ctx = talloc_new(NULL);
1490 if (!tmp_ctx) {
1494 dn = sysdb_netgroup_dn(tmp_ctx, domain, name);
1503 talloc_free(tmp_ctx);
1512 TALLOC_CTX *tmp_ctx;
1525 tmp_ctx = talloc_new(NULL);
1526 if (!tmp_ctx) {
1536 base_dn = sysdb_domain_dn(tmp_ctx, domain);
1538 talloc_zfree(tmp_ctx);
1544 talloc_zfree(tmp_ctx);
1549 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, base_dn, LDB_SCOPE_BASE,
1588 filter = talloc_asprintf(tmp_ctx,
1596 filter = talloc_asprintf(tmp_ctx,
1607 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, base_dn, LDB_SCOPE_SUBTREE,
1646 msg = ldb_msg_new(tmp_ctx);
1679 talloc_zfree(tmp_ctx);
1695 TALLOC_CTX *tmp_ctx;
1697 tmp_ctx = talloc_new(NULL);
1698 if (!tmp_ctx) {
1702 msg = ldb_msg_new(tmp_ctx);
1758 talloc_zfree(tmp_ctx);
1770 TALLOC_CTX *tmp_ctx;
1777 tmp_ctx = talloc_new(NULL);
1778 if (!tmp_ctx) {
1782 msg = ldb_msg_new(tmp_ctx);
1849 talloc_free(tmp_ctx);
1859 TALLOC_CTX *tmp_ctx;
1871 tmp_ctx = talloc_new(NULL);
1872 if (!tmp_ctx) {
1876 ret = sss_filter_sanitize(tmp_ctx, name, &sanitized_name);
1881 filter = talloc_asprintf(tmp_ctx, "(|(%s=%s)",
1910 tmpdn = sysdb_user_dn(tmp_ctx, domain, name);
1922 tmpdn = ldb_dn_new(tmp_ctx, domain->sysdb->ldb, SYSDB_BASE);
1933 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, tmpdn, LDB_SCOPE_SUBTREE,
1947 talloc_free(tmp_ctx);
1964 TALLOC_CTX *tmp_ctx;
1996 tmp_ctx = talloc_new(NULL);
1997 if (!tmp_ctx) {
2004 talloc_free(tmp_ctx);
2014 ret = sysdb_search_group_by_name(tmp_ctx, domain, name, NULL, &msg);
2026 ret = sysdb_search_group_by_gid(tmp_ctx, domain, uid, NULL, &msg);
2041 ret = sysdb_search_user_by_uid(tmp_ctx, domain, uid, NULL, &msg);
2060 attrs = sysdb_new_attrs(tmp_ctx);
2084 id_attrs = sysdb_new_attrs(tmp_ctx);
2137 talloc_zfree(tmp_ctx);
2148 TALLOC_CTX *tmp_ctx;
2150 tmp_ctx = talloc_new(NULL);
2151 if (!tmp_ctx) {
2155 msg = ldb_msg_new(tmp_ctx);
2187 talloc_zfree(tmp_ctx);
2200 TALLOC_CTX *tmp_ctx;
2214 tmp_ctx = talloc_new(NULL);
2215 if (!tmp_ctx) {
2222 talloc_free(tmp_ctx);
2232 ret = sysdb_search_user_by_name(tmp_ctx, domain, name, NULL, &msg);
2246 ret = sysdb_search_user_by_uid(tmp_ctx, domain, gid, NULL, &msg);
2265 ret = sysdb_search_group_by_gid(tmp_ctx, domain, gid, NULL, &msg);
2297 attrs = sysdb_new_attrs(tmp_ctx);
2364 talloc_zfree(tmp_ctx);
2377 TALLOC_CTX *tmp_ctx;
2386 tmp_ctx = talloc_new(NULL);
2387 if (!tmp_ctx) {
2391 ret = sysdb_search_group_by_gid(tmp_ctx, domain, gid, group_attrs, &msg);
2430 attrs = sysdb_new_attrs(tmp_ctx);
2467 talloc_zfree(tmp_ctx);
2576 TALLOC_CTX *tmp_ctx;
2579 tmp_ctx = talloc_new(NULL);
2580 if (!tmp_ctx) {
2587 talloc_free(tmp_ctx);
2596 attrs = sysdb_new_attrs(tmp_ctx);
2636 talloc_zfree(tmp_ctx);
2684 TALLOC_CTX *tmp_ctx;
2695 tmp_ctx = talloc_new(NULL);
2696 if (!tmp_ctx) {
2701 attrs = sysdb_new_attrs(tmp_ctx);
2721 ret = sysdb_search_user_by_name(tmp_ctx, domain, name, NULL, &msg);
2763 talloc_zfree(tmp_ctx);
2907 TALLOC_CTX *tmp_ctx;
2929 tmp_ctx = talloc_new(NULL);
2930 if (!tmp_ctx) {
2941 ret = sysdb_search_group_by_name(tmp_ctx, domain, name, src_attrs, &msg);
2954 attrs = sysdb_new_attrs(tmp_ctx);
2992 talloc_zfree(tmp_ctx);
3097 TALLOC_CTX *tmp_ctx = talloc_new(NULL);
3098 if (!tmp_ctx) {
3102 ret = sss_parse_internal_fqname(tmp_ctx, member,
3121 member_dn = sysdb_user_dn(tmp_ctx, member_dom, member);
3123 member_dn = sysdb_group_dn(tmp_ctx, member_dom, member);
3135 group_dn = sysdb_group_dn(tmp_ctx, domain, group);
3137 group_dn = ldb_dn_new(tmp_ctx, domain->sysdb->ldb, group);
3148 talloc_free(tmp_ctx);
3184 TALLOC_CTX *tmp_ctx;
3190 tmp_ctx = talloc_new(NULL);
3191 if (!tmp_ctx) {
3195 ret = s3crypt_gen_salt(tmp_ctx, &salt);
3201 ret = s3crypt_sha512(tmp_ctx, password, salt, &hash);
3207 attrs = sysdb_new_attrs(tmp_ctx);
3237 talloc_zfree(tmp_ctx);
3244 talloc_zfree(tmp_ctx);
3266 TALLOC_CTX *tmp_ctx;
3270 tmp_ctx = talloc_new(NULL);
3271 if (tmp_ctx == NULL) {
3281 basedn = sysdb_custom_subtree_dn(tmp_ctx, domain, subtree_name);
3297 talloc_free(tmp_ctx);
3309 TALLOC_CTX *tmp_ctx;
3319 tmp_ctx = talloc_new(NULL);
3320 if (!tmp_ctx) {
3324 basedn = sysdb_custom_dn(tmp_ctx, domain, object_name, subtree_name);
3336 ret = sysdb_search_entry(tmp_ctx, domain->sysdb, basedn,
3352 talloc_zfree(tmp_ctx);
3380 TALLOC_CTX *tmp_ctx;
3385 tmp_ctx = talloc_new(NULL);
3386 if (tmp_ctx == NULL) {
3390 ret = sss_filter_sanitize(tmp_ctx, member_dn, &sanitized_dn);
3395 filter = talloc_asprintf(tmp_ctx, "(%s=%s)", SYSDB_ORIG_DN, sanitized_dn);
3419 talloc_free(tmp_ctx);
3430 TALLOC_CTX *tmp_ctx;
3444 tmp_ctx = talloc_new(NULL);
3445 if (!tmp_ctx) {
3456 msg = ldb_msg_new(tmp_ctx);
3462 msg->dn = sysdb_custom_dn(tmp_ctx, domain, object_name, subtree_name);
3496 talloc_zfree(tmp_ctx);
3506 TALLOC_CTX *tmp_ctx;
3514 tmp_ctx = talloc_new(NULL);
3515 if (!tmp_ctx) {
3519 dn = sysdb_custom_dn(tmp_ctx, domain, object_name, subtree_name);
3542 talloc_zfree(tmp_ctx);
3557 TALLOC_CTX *tmp_ctx;
3564 tmp_ctx = talloc_new(NULL);
3565 if (!tmp_ctx) {
3569 ctrl = talloc_array(tmp_ctx, struct ldb_control *, 2);
3600 res = talloc_zero(tmp_ctx, struct ldb_result);
3606 ret = ldb_build_search_req(&ldb_req, domain->sysdb->ldb, tmp_ctx,
3627 talloc_zfree(tmp_ctx);
3637 talloc_zfree(tmp_ctx);
3651 TALLOC_CTX *tmp_ctx;
3656 tmp_ctx = talloc_new(NULL);
3657 if (!tmp_ctx) {
3661 basedn = sysdb_user_base_dn(tmp_ctx, domain);
3668 filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_UC, sub_filter);
3685 talloc_zfree(tmp_ctx);
3695 talloc_zfree(tmp_ctx);
3725 TALLOC_CTX *tmp_ctx;
3733 tmp_ctx = talloc_new(NULL);
3734 if (tmp_ctx == NULL) {
3738 ret = sysdb_search_ts_users(tmp_ctx, domain, sub_filter, NULL, &ts_res);
3740 ret = sysdb_cache_search_users(tmp_ctx, domain, domain->sysdb->ldb,
3756 ret = cleanup_dn_filter(tmp_ctx, &ts_res, SYSDB_UC, sub_filter, &dn_filter);
3761 ret = sysdb_search_ts_matches(tmp_ctx, domain->sysdb, attrs,
3777 talloc_free(tmp_ctx);
3816 TALLOC_CTX *tmp_ctx;
3826 tmp_ctx = talloc_new(NULL);
3827 if (!tmp_ctx) {
3832 ret = sysdb_search_user_by_name(tmp_ctx, domain, name, NULL, &msg);
3834 ret = sysdb_search_user_by_uid(tmp_ctx, domain, uid, NULL, &msg);
3863 ret = sss_filter_sanitize(tmp_ctx, name, &sanitized_name);
3868 filter = talloc_asprintf(tmp_ctx, "(%s=%s)",
3875 ret = sysdb_search_groups(tmp_ctx, domain, filter, attrs,
3882 msg = ldb_msg_new(tmp_ctx);
3911 talloc_zfree(tmp_ctx);
3916 talloc_zfree(tmp_ctx);
3931 TALLOC_CTX *tmp_ctx;
3936 tmp_ctx = talloc_new(NULL);
3937 if (!tmp_ctx) {
3941 basedn = sysdb_group_base_dn(tmp_ctx, domain);
3948 filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_GC, sub_filter);
3965 talloc_zfree(tmp_ctx);
3975 talloc_zfree(tmp_ctx);
4005 TALLOC_CTX *tmp_ctx;
4013 tmp_ctx = talloc_new(NULL);
4014 if (tmp_ctx == NULL) {
4018 ret = sysdb_search_ts_groups(tmp_ctx, domain, sub_filter, NULL, &ts_res);
4020 ret = sysdb_cache_search_groups(tmp_ctx, domain, domain->sysdb->ldb,
4036 ret = cleanup_dn_filter(tmp_ctx, &ts_res, SYSDB_GC, sub_filter, &dn_filter);
4041 ret = sysdb_search_ts_matches(tmp_ctx, domain->sysdb, attrs,
4057 talloc_free(tmp_ctx);
4096 TALLOC_CTX *tmp_ctx;
4100 tmp_ctx = talloc_new(NULL);
4101 if (!tmp_ctx) {
4106 ret = sysdb_search_group_by_name(tmp_ctx, domain, name, NULL, &msg);
4108 ret = sysdb_search_group_by_gid(tmp_ctx, domain, gid, NULL, &msg);
4139 talloc_zfree(tmp_ctx);
4144 talloc_zfree(tmp_ctx);
4157 TALLOC_CTX *tmp_ctx;
4162 tmp_ctx = talloc_new(NULL);
4163 if (!tmp_ctx) {
4167 basedn = ldb_dn_new_fmt(tmp_ctx, domain->sysdb->ldb,
4175 filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_NC, sub_filter);
4191 talloc_zfree(tmp_ctx);
4200 talloc_zfree(tmp_ctx);
4209 TALLOC_CTX *tmp_ctx;
4215 tmp_ctx = talloc_new(NULL);
4216 if (!tmp_ctx) {
4220 ret = sysdb_search_netgroup_by_name(tmp_ctx, domain, name, NULL, &msg);
4242 talloc_free(tmp_ctx);
4250 TALLOC_CTX *tmp_ctx;
4256 tmp_ctx = talloc_new(NULL);
4257 if (!tmp_ctx) {
4261 ret = sysdb_search_object_by_sid(tmp_ctx, domain, sid_str, NULL, &res);
4291 talloc_free(tmp_ctx);
4308 TALLOC_CTX *tmp_ctx;
4310 tmp_ctx = talloc_new(NULL);
4311 if (!tmp_ctx) {
4370 talloc_free(tmp_ctx);
4385 TALLOC_CTX *tmp_ctx;
4409 tmp_ctx = talloc_new(NULL);
4410 if (tmp_ctx == NULL) {
4415 short_pw = talloc_strndup(tmp_ctx, password, (pw_len - cached_fa2_len));
4422 ret = s3crypt_sha512(tmp_ctx, short_pw, userhash, &comphash);
4439 talloc_free(tmp_ctx);
4452 TALLOC_CTX *tmp_ctx;
4491 tmp_ctx = talloc_new(NULL);
4492 if (!tmp_ctx) {
4498 talloc_zfree(tmp_ctx);
4503 ret = sysdb_search_user_by_name(tmp_ctx, domain, name, attrs, &ldb_msg);
4555 ret = s3crypt_sha512(tmp_ctx, password, userhash, &comphash);
4562 update_attrs = sysdb_new_attrs(tmp_ctx);
4650 talloc_free(tmp_ctx);
4666 TALLOC_CTX *tmp_ctx = talloc_new(NULL);
4667 if(!tmp_ctx) {
4722 talloc_free(tmp_ctx);
4850 TALLOC_CTX *tmp_ctx;
4859 tmp_ctx = talloc_new(NULL);
4860 if (!tmp_ctx) {
4864 basedn = sysdb_domain_dn(tmp_ctx, domain);
4871 ret = ldb_search(domain->sysdb->ldb, tmp_ctx, &res, basedn,
4907 talloc_zfree(tmp_ctx);
4974 TALLOC_CTX *tmp_ctx;
4980 tmp_ctx = talloc_new(NULL);
4981 if (!tmp_ctx) {
4985 ret = sss_filter_sanitize_for_dom(tmp_ctx, name, domain, &sanitized_name,
4991 filter = talloc_asprintf(tmp_ctx, SYSDB_NAME_FILTER, sanitized_alias_name,
5001 talloc_free(tmp_ctx);
5180 TALLOC_CTX *tmp_ctx;
5187 tmp_ctx = talloc_new(NULL);
5188 if (tmp_ctx == NULL) {
5192 ret = sysdb_search_group_by_name(tmp_ctx, dom, group_name, NULL, &msg);
5198 ret = sysdb_asq_search(tmp_ctx, dom, msg->dn, NULL, SYSDB_MEMBER, attrs,
5204 sids = talloc_array(tmp_ctx, const char*, m_count);
5210 dns = talloc_array(tmp_ctx, const char*, m_count);
5250 talloc_free(tmp_ctx);
5259 TALLOC_CTX *tmp_ctx;
5269 tmp_ctx = talloc_new(NULL);
5270 if (tmp_ctx == NULL) {
5274 base_dn = sysdb_base_dn(dom->sysdb, tmp_ctx);
5281 ret = sss_filter_sanitize(tmp_ctx, ldb_dn_get_linearized(group_dn),
5290 filter = talloc_asprintf(tmp_ctx, "(&("SYSDB_UC")("SYSDB_MEMBEROF"=%s))",
5298 ret = sysdb_search_entry(tmp_ctx, dom->sysdb, base_dn, LDB_SCOPE_SUBTREE,
5304 res = talloc_zero(tmp_ctx, struct ldb_result);
5324 talloc_free(tmp_ctx);
5391 TALLOC_CTX *tmp_ctx;
5393 tmp_ctx = talloc_new(NULL);
5394 if (tmp_ctx == NULL) {
5398 msg = ldb_msg_new(tmp_ctx);
5450 talloc_free(tmp_ctx);
5459 TALLOC_CTX *tmp_ctx;
5461 tmp_ctx = talloc_new(NULL);
5462 if (tmp_ctx == NULL) {
5466 ldbdn = ldb_dn_from_ldb_val(tmp_ctx, dom->sysdb->ldb, dn_val);
5475 talloc_free(tmp_ctx);
5488 TALLOC_CTX *tmp_ctx;
5494 tmp_ctx = talloc_new(NULL);
5495 if (!tmp_ctx) {
5500 entry_dn = sysdb_user_dn(tmp_ctx, domain, name);
5502 entry_dn = sysdb_group_dn(tmp_ctx, domain, name);
5510 attrs = sysdb_new_attrs(tmp_ctx);
5551 talloc_zfree(tmp_ctx);