summaryrefslogtreecommitdiff
path: root/source3/auth/auth_util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-13 12:21:07 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-13 12:21:07 +0000
commitac04f498a2b8ec6bc2eb06fb2f0db68c5aa2270b (patch)
treec13fbe0970e4c9596f62df2e08eaf37931a57267 /source3/auth/auth_util.c
parent05f6c8dea105b34c6031fcd037d74eddc1eba869 (diff)
downloadsamba-ac04f498a2b8ec6bc2eb06fb2f0db68c5aa2270b.tar.gz
samba-ac04f498a2b8ec6bc2eb06fb2f0db68c5aa2270b.tar.bz2
samba-ac04f498a2b8ec6bc2eb06fb2f0db68c5aa2270b.zip
Fix to debian bug #171071 - we had the wrong dereference on the pointer to be
Realloc()ed, causing it to fail. Big thanks to Sandor Sonfeld <sonf@linuxmail.org> for the debug, stack and valgrind traces! Andrew Bartlett (This used to be commit 7abca6d281da6388899f78e3440d7ce37bf2094e)
Diffstat (limited to 'source3/auth/auth_util.c')
-rw-r--r--source3/auth/auth_util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 744b4668aa..ff0c392219 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -678,10 +678,10 @@ static NTSTATUS get_user_groups_from_local_sam(const DOM_SID *user_sid,
}
if (sys_getgrouplist(usr->pw_name, usr->pw_gid, *unix_groups, &n_unix_groups) == -1) {
- *unix_groups = Realloc(unix_groups, sizeof(gid_t) * n_unix_groups);
+ *unix_groups = Realloc(*unix_groups, sizeof(gid_t) * n_unix_groups);
if (sys_getgrouplist(usr->pw_name, usr->pw_gid, *unix_groups, &n_unix_groups) == -1) {
DEBUG(0, ("get_user_groups_from_local_sam: failed to get the unix group list\n"));
- SAFE_FREE(unix_groups);
+ SAFE_FREE(*unix_groups);
passwd_free(&usr);
return NT_STATUS_NO_SUCH_USER; /* what should this return value be? */
}
@@ -695,7 +695,7 @@ static NTSTATUS get_user_groups_from_local_sam(const DOM_SID *user_sid,
*groups = malloc(sizeof(DOM_SID) * n_unix_groups);
if (!*groups) {
DEBUG(0, ("get_user_group_from_local_sam: malloc() failed for DOM_SID list!\n"));
- SAFE_FREE(unix_groups);
+ SAFE_FREE(*unix_groups);
return NT_STATUS_NO_MEMORY;
}
}
@@ -704,7 +704,7 @@ static NTSTATUS get_user_groups_from_local_sam(const DOM_SID *user_sid,
for (i = 0; i < *n_groups; i++) {
if (!gid_to_sid(&(*groups)[i], (*unix_groups)[i])) {
- DEBUG(1, ("get_user_groups_from_local_sam: failed to convert gid %ld to a sid!\n", (long int)unix_groups[i+1]));
+ DEBUG(1, ("get_user_groups_from_local_sam: failed to convert gid %ld to a sid!\n", (long int)(*unix_groups)[i+1]));
SAFE_FREE(groups);
SAFE_FREE(unix_groups);
return NT_STATUS_NO_SUCH_USER;