/* return the binary string representation of a DOM_SID caller must free */ char *sid_binstring(DOM_SID *sid) { char *buf, *s; int len = sid_size(sid); buf = malloc(len); if (!buf) return NULL; sid_linearize(buf, len, sid); s = binary_string(buf, len); free(buf); return s; }
char *sid_binstring_hex(const DOM_SID *sid) { char *buf, *s; int len = ndr_size_dom_sid(sid, NULL, 0); buf = (char *)SMB_MALLOC(len); if (!buf) return NULL; sid_linearize(buf, len, sid); s = binary_string(buf, len); free(buf); return s; }