summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-03-04 05:53:10 +0100
committerVolker Lendecke <vl@samba.org>2011-03-05 14:29:32 +0100
commitc97ea5976c50ef9d883eafed334ff69b5b43e259 (patch)
tree93e131330ee003d5337a7e2ddb8548c9359b3c5f
parente0fae3d49483c33329628534591f966d4841e474 (diff)
downloadsamba-c97ea5976c50ef9d883eafed334ff69b5b43e259.tar.gz
samba-c97ea5976c50ef9d883eafed334ff69b5b43e259.tar.bz2
samba-c97ea5976c50ef9d883eafed334ff69b5b43e259.zip
s3-net: Use wbcSidToStringBuf
-rw-r--r--source3/utils/net_rpc.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index ae7d5d0c1f..0bb4305d59 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -4617,7 +4617,7 @@ static bool get_user_sids(const char *domain, const char *user, struct security_
enum wbcSidType type;
fstring full_name;
struct wbcDomainSid wsid;
- char *sid_str = NULL;
+ char sid_str[WBC_SID_STRING_BUFLEN];
struct dom_sid user_sid;
uint32_t num_groups;
gid_t *groups = NULL;
@@ -4636,13 +4636,9 @@ static bool get_user_sids(const char *domain, const char *user, struct security_
return false;
}
- wbc_status = wbcSidToString(&wsid, &sid_str);
- if (!WBC_ERROR_IS_OK(wbc_status)) {
- return false;
- }
+ wbcSidToStringBuf(&wsid, sid_str, sizeof(sid_str));
if (type != WBC_SID_NAME_USER) {
- wbcFreeMemory(sid_str);
DEBUG(1, ("%s is not a user\n", full_name));
return false;
}
@@ -4652,9 +4648,6 @@ static bool get_user_sids(const char *domain, const char *user, struct security_
return false;
}
- wbcFreeMemory(sid_str);
- sid_str = NULL;
-
init_user_token(token, &user_sid);
/* And now the groups winbind knows about */
@@ -4678,18 +4671,11 @@ static bool get_user_sids(const char *domain, const char *user, struct security_
return false;
}
- wbc_status = wbcSidToString(&wsid, &sid_str);
- if (!WBC_ERROR_IS_OK(wbc_status)) {
- wbcFreeMemory(groups);
- return false;
- }
+ wbcSidToStringBuf(&wsid, sid_str, sizeof(sid_str));
DEBUG(3, (" %s\n", sid_str));
string_to_sid(&sid, sid_str);
- wbcFreeMemory(sid_str);
- sid_str = NULL;
-
add_sid_to_token(token, &sid);
}
wbcFreeMemory(groups);