git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7ffa7e4
)
pam_winbind: Use wbcSidToStringBuf
author
Volker Lendecke
<vl@samba.org>
Fri, 4 Mar 2011 04:49:20 +0000
(
05:49
+0100)
committer
Volker Lendecke
<vl@samba.org>
Sat, 5 Mar 2011 13:29:32 +0000
(14:29 +0100)
nsswitch/pam_winbind.c
patch
|
blob
|
history
diff --git
a/nsswitch/pam_winbind.c
b/nsswitch/pam_winbind.c
index e640b711bd098e643cbcb4254e071a7319f0a32d..7005c25fae4d669dbed90b8d17f2ec54ddee1271 100644
(file)
--- a/
nsswitch/pam_winbind.c
+++ b/
nsswitch/pam_winbind.c
@@
-1077,12
+1077,11
@@
static bool winbind_name_to_sid_string(struct pwb_context *ctx,
char *sid_list_buffer,
int sid_list_buffer_size)
{
char *sid_list_buffer,
int sid_list_buffer_size)
{
- const char* sid_string = NULL;
- char *sid_str = NULL;
+ char sid_string[WBC_SID_STRING_BUFLEN];
/* lookup name? */
if (IS_SID_STRING(name)) {
/* lookup name? */
if (IS_SID_STRING(name)) {
- s
id_string = name
;
+ s
trlcpy(sid_string, name, sizeof(sid_string))
;
} else {
wbcErr wbc_status;
struct wbcDomainSid sid;
} else {
wbcErr wbc_status;
struct wbcDomainSid sid;
@@
-1098,21
+1097,13
@@
static bool winbind_name_to_sid_string(struct pwb_context *ctx,
return false;
}
return false;
}
- wbc_status = wbcSidToString(&sid, &sid_str);
- if (!WBC_ERROR_IS_OK(wbc_status)) {
- return false;
- }
-
- sid_string = sid_str;
+ wbcSidToStringBuf(&sid, sid_string, sizeof(sid_string));
}
if (!safe_append_string(sid_list_buffer, sid_string,
sid_list_buffer_size)) {
}
if (!safe_append_string(sid_list_buffer, sid_string,
sid_list_buffer_size)) {
- wbcFreeMemory(sid_str);
return false;
}
return false;
}
-
- wbcFreeMemory(sid_str);
return true;
}
return true;
}