|
|
2fc102 |
From ccb2fe6ee1397b3c3d413d6c546cb88701958de3 Mon Sep 17 00:00:00 2001
|
|
|
2fc102 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
2fc102 |
Date: Thu, 7 Nov 2013 11:09:48 +0100
|
|
|
2fc102 |
Subject: [PATCH 22/31] free idmapped binary SIDs correctly
|
|
|
2fc102 |
|
|
|
2fc102 |
Resolves:
|
|
|
2fc102 |
https://fedorahosted.org/sssd/ticket/2133
|
|
|
2fc102 |
---
|
|
|
2fc102 |
src/responder/nss/nsssrv_cmd.c | 2 +-
|
|
|
2fc102 |
src/tests/sss_idmap-tests.c | 10 +++++-----
|
|
|
2fc102 |
2 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
2fc102 |
|
|
|
2fc102 |
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
|
|
|
2fc102 |
index 07f31188074bf45664969fb33388edb475e53b96..550017c0e4385a7147ed5ef83da2c37cb97c8092 100644
|
|
|
2fc102 |
--- a/src/responder/nss/nsssrv_cmd.c
|
|
|
2fc102 |
+++ b/src/responder/nss/nsssrv_cmd.c
|
|
|
2fc102 |
@@ -4341,7 +4341,7 @@ static int nss_cmd_getbysid(enum sss_cli_command cmd, struct cli_ctx *cctx)
|
|
|
2fc102 |
/* If the body isn't a SID, fail */
|
|
|
2fc102 |
err = sss_idmap_sid_to_bin_sid(nctx->idmap_ctx, sid_str,
|
|
|
2fc102 |
&bin_sid, &bin_sid_length);
|
|
|
2fc102 |
- talloc_free(bin_sid);
|
|
|
2fc102 |
+ sss_idmap_free_bin_sid(nctx->idmap_ctx, bin_sid);
|
|
|
2fc102 |
if (err != IDMAP_SUCCESS) {
|
|
|
2fc102 |
DEBUG(SSSDBG_OP_FAILURE, ("sss_idmap_sid_to_bin_sid failed for [%s].\n",
|
|
|
2fc102 |
body));
|
|
|
2fc102 |
diff --git a/src/tests/sss_idmap-tests.c b/src/tests/sss_idmap-tests.c
|
|
|
2fc102 |
index 888be82248045058093d6943ef73742d8812eac3..f5ec68383679bfc685467bd625c86b8d6f474d48 100644
|
|
|
2fc102 |
--- a/src/tests/sss_idmap-tests.c
|
|
|
2fc102 |
+++ b/src/tests/sss_idmap-tests.c
|
|
|
2fc102 |
@@ -242,7 +242,7 @@ START_TEST(idmap_test_bin_sid2uid)
|
|
|
2fc102 |
"sss_idmap_bin_sid_to_unix returned wrong id, "
|
|
|
2fc102 |
"got [%d], expected [%d].", id, 1000 + IDMAP_RANGE_MIN);
|
|
|
2fc102 |
|
|
|
2fc102 |
- talloc_free(bin_sid);
|
|
|
2fc102 |
+ sss_idmap_free_bin_sid(idmap_ctx, bin_sid);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
END_TEST
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -331,7 +331,7 @@ START_TEST(idmap_test_uid2bin_sid)
|
|
|
2fc102 |
"expected [%s], got [%s].", "S-1-5-21-1-2-3-1000", sid);
|
|
|
2fc102 |
|
|
|
2fc102 |
sss_idmap_free_sid(idmap_ctx, sid);
|
|
|
2fc102 |
- talloc_free(bin_sid);
|
|
|
2fc102 |
+ sss_idmap_free_bin_sid(idmap_ctx, bin_sid);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
END_TEST
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -359,7 +359,7 @@ START_TEST(idmap_test_bin_sid2dom_sid)
|
|
|
2fc102 |
"Binary SIDs do not match.");
|
|
|
2fc102 |
|
|
|
2fc102 |
sss_idmap_free_dom_sid(idmap_ctx, dom_sid);
|
|
|
2fc102 |
- talloc_free(new_bin_sid);
|
|
|
2fc102 |
+ sss_idmap_free_bin_sid(idmap_ctx, new_bin_sid);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
END_TEST
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -437,7 +437,7 @@ START_TEST(idmap_test_sid2bin_sid)
|
|
|
2fc102 |
fail_unless(memcmp(bin_sid, test_bin_sid, test_bin_sid_length) == 0,
|
|
|
2fc102 |
"Binary SIDs do not match");
|
|
|
2fc102 |
|
|
|
2fc102 |
- talloc_free(bin_sid);
|
|
|
2fc102 |
+ sss_idmap_free_bin_sid(idmap_ctx, bin_sid);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
END_TEST
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -496,7 +496,7 @@ START_TEST(idmap_test_smb_sid2bin_sid)
|
|
|
2fc102 |
fail_unless(memcmp(bin_sid, test_bin_sid, test_bin_sid_length) == 0,
|
|
|
2fc102 |
"Binary SIDs do not match.");
|
|
|
2fc102 |
|
|
|
2fc102 |
- talloc_free(bin_sid);
|
|
|
2fc102 |
+ sss_idmap_free_bin_sid(idmap_ctx, bin_sid);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
END_TEST
|
|
|
2fc102 |
|
|
|
2fc102 |
--
|
|
|
2fc102 |
1.8.4.2
|
|
|
2fc102 |
|