From 93076cb9bc56a515bbefb6d88470d6776169779a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 22 May 2004 07:55:48 +0000 Subject: r816: - Make use of tridge's new samdb_result_sid_prefix() helper function. - Remove legacy sid_to_string (which contained a memleak) - Remove some unused parts of lib/util_sid.c Andrew Bartlett (This used to be commit 7c69a85984e47c004ddfd9bb5eadcb3191b56f9d) --- source4/lib/util_sid.c | 70 -------------------------------------------------- 1 file changed, 70 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/util_sid.c b/source4/lib/util_sid.c index 6f63e25c5d..5ce72a6f51 100644 --- a/source4/lib/util_sid.c +++ b/source4/lib/util_sid.c @@ -143,76 +143,6 @@ void generate_wellknown_sids(void) initialised = True; } -/************************************************************************** - Splits a name of format \DOMAIN\name or name into its two components. - Sets the DOMAIN name to lp_netbios_name() if it has not been specified. -***************************************************************************/ - -void split_domain_name(const char *fullname, char *domain, char *name) -{ - pstring full_name; - const char *sep; - char *p; - - sep = lp_winbind_separator(); - - *domain = *name = '\0'; - - if (fullname[0] == sep[0] || fullname[0] == '\\') - fullname++; - - pstrcpy(full_name, fullname); - p = strchr_m(full_name+1, '\\'); - if (!p) p = strchr_m(full_name+1, sep[0]); - - if (p != NULL) { - *p = 0; - fstrcpy(domain, full_name); - fstrcpy(name, p+1); - } else { - fstrcpy(domain, lp_netbios_name()); - fstrcpy(name, full_name); - } - - DEBUG(10,("split_domain_name:name '%s' split into domain :'%s' and user :'%s'\n", - fullname, domain, name)); -} - -/***************************************************************** - Convert a SID to an ascii string. -*****************************************************************/ - -char *sid_to_string(fstring sidstr_out, const struct dom_sid *sid) -{ - char *tmp_string; - TALLOC_CTX *mem_ctx; - if (!(mem_ctx = talloc_init("sid_to_string temp context"))) { - return NULL; - } - - tmp_string = dom_sid_string(mem_ctx, sid); - if (!tmp_string) - return NULL; - - fstrcpy(sidstr_out, tmp_string); - return sidstr_out; -} - -/***************************************************************** - Removes the last rid from the end of a sid -*****************************************************************/ - -BOOL sid_split_rid(struct dom_sid *sid, uint32 *rid) -{ - if (sid->num_auths > 0) { - sid->num_auths--; - if (rid) - *rid = sid->sub_auths[sid->num_auths]; - return True; - } - return False; -} - /***************************************************************** Return the last rid from the end of a sid *****************************************************************/ -- cgit