-/*
+/*
Unix SMB/CIFS implementation.
Winbind Utility functions
{
struct wbcDomainSid dom_sid;
wbcErr result;
- enum wbcSidType type;
+ enum wbcSidType type;
result = wbcLookupName(dom_name, name, &dom_sid, &type);
if (result != WBC_ERR_SUCCESS)
return false;
memcpy(sid, &dom_sid, sizeof(struct dom_sid));
- *name_type = (enum lsa_SidType)type;
+ *name_type = (enum lsa_SidType)type;
- return true;
+ return true;
}
/* Call winbindd to convert sid to name */
char *domain_name = NULL;
char *account_name = NULL;
- memcpy(&dom_sid, sid, sizeof(dom_sid));
+ memcpy(&dom_sid, sid, sizeof(dom_sid));
result = wbcLookupSid(&dom_sid, &domain_name, &account_name, &type);
if (result != WBC_ERR_SUCCESS)
/* Copy out result */
- if (domain) {
+ if (domain) {
*domain = talloc_strdup(mem_ctx, domain_name);
}
if (name) {
}
*name_type = (enum lsa_SidType)type;
- DEBUG(10, ("winbind_lookup_sid: SUCCESS: SID %s -> %s %s\n",
+ DEBUG(10, ("winbind_lookup_sid: SUCCESS: SID %s -> %s %s\n",
sid_string_dbg(sid), domain_name, account_name));
wbcFreeMemory(domain_name);
wbcFreeMemory(account_name);
- if ((domain && !*domain) || (name && !*name)) {
+ if ((domain && !*domain) || (name && !*name)) {
DEBUG(0,("winbind_lookup_sid: talloc() failed!\n"));
return false;
- }
+ }
return true;
struct wbcDomainSid dom_sid;
wbcErr result;
- memcpy(&dom_sid, sid, sizeof(dom_sid));
+ memcpy(&dom_sid, sid, sizeof(dom_sid));
- result = wbcSidToUid(&dom_sid, puid);
+ result = wbcSidToUid(&dom_sid, puid);
- return (result == WBC_ERR_SUCCESS);
+ return (result == WBC_ERR_SUCCESS);
}
/* Call winbindd to convert uid to sid */
struct wbcDomainSid dom_sid;
wbcErr result;
- memcpy(&dom_sid, sid, sizeof(dom_sid));
+ memcpy(&dom_sid, sid, sizeof(dom_sid));
- result = wbcSidToGid(&dom_sid, pgid);
+ result = wbcSidToGid(&dom_sid, pgid);
- return (result == WBC_ERR_SUCCESS);
+ return (result == WBC_ERR_SUCCESS);
}
/* Call winbindd to convert gid to sid */
wbcFreeMemory(info);
}
- return result;
+ return result;
}
/* Lookup a set of rids in a given domain */
enum wbcSidType *name_types = NULL;
struct wbcDomainSid dom_sid;
wbcErr ret;
- int i;
+ int i;
memcpy(&dom_sid, domain_sid, sizeof(struct wbcDomainSid));
ret = wbcLookupRids(&dom_sid, num_rids, rids,
&dom_name, &namelist, &name_types);
- if (ret != WBC_ERR_SUCCESS) {
+ if (ret != WBC_ERR_SUCCESS) {
return false;
- }
+ }
*domain_name = talloc_strdup(mem_ctx, dom_name);
*names = talloc_array(mem_ctx, const char*, num_rids);
wbcFreeMemory(namelist);
wbcFreeMemory(name_types);
- return true;
+ return true;
}
/* Ask Winbind to allocate a new uid for us */
bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid)
{
- return false;
+ return false;
}
/* Call winbindd to convert gid to sid */