summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-05-08 14:52:46 +0200
committerSumit Bose <sbose@redhat.com>2012-05-08 14:52:46 +0200
commiteaaec54173733d27dcccff368813073b16577cd8 (patch)
tree508e35cbfe701e42ca318922fef38dd36f20efa4
parent66e02ef2b0667c6d88f46cda29c885293ae3be26 (diff)
downloadfreeipa-WIP.tar.gz
freeipa-WIP.tar.xz
freeipa-WIP.zip
Fix + debugWIP
-rw-r--r--daemons/ipa-kdb/ipa_kdb_mspac.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/daemons/ipa-kdb/ipa_kdb_mspac.c b/daemons/ipa-kdb/ipa_kdb_mspac.c
index bc82db6ba..ccff27b1b 100644
--- a/daemons/ipa-kdb/ipa_kdb_mspac.c
+++ b/daemons/ipa-kdb/ipa_kdb_mspac.c
@@ -784,18 +784,25 @@ static int read_group_sids_from_env(TALLOC_CTX *memctx,
size_t *_ipa_group_sids_count,
struct dom_sid **_ipa_group_sids)
{
+ char *dummy;
char *env;
char *s;
+ char *endptr;
int ret;
size_t ipa_group_sids_count = 0;
struct dom_sid *ipa_group_sids = NULL;
size_t c;
- env = getenv("IPA_GROUP_SIDS_FOR_PAC_TESTING");
- if (env == NULL) {
+ dummy = getenv("IPA_GROUP_SIDS_FOR_PAC_TESTING");
+ if (dummy == NULL) {
ret = 0;
goto done;
}
+ env = talloc_strdup(memctx, dummy);
+ if (env == NULL) {
+ ret = ENOMEM;
+ goto done;
+ }
s = env;
while((s = strchr(s, ',')) != NULL) {
@@ -813,17 +820,20 @@ static int read_group_sids_from_env(TALLOC_CTX *memctx,
c = 0;
s = env;
do {
+ endptr = strchr(s, ',');
+ if (endptr != NULL) {
+ *endptr = '\0';
+ }
ret = string_to_sid(s, &ipa_group_sids[c]);
if (ret != 0) {
+ krb5_klog_syslog(LOG_ERR, "string_to_sid failed for [%s]", s);
goto done;
}
c++;
- s = strchr(s, ',');
- if (s != NULL) {
- s++;
- }
- } while(s != NULL);
+ s = endptr;
+ s++;
+ } while(endptr != NULL);
ret = 0;