diff options
| author | Andrew Tridgell <tridge@samba.org> | 2008-09-23 11:15:46 -0700 |
|---|---|---|
| committer | Andrew Tridgell <tridge@samba.org> | 2008-09-23 11:15:46 -0700 |
| commit | 66092ced5e1dc4d35923a3c90bcb3214a885b17d (patch) | |
| tree | d40fd46e86244f1b45abda2a95c8fe84bfc88c3c /source3/winbindd/winbindd_util.c | |
| parent | 9cf29abee296ea2fcdf712687a6ce2cf9fd9d74c (diff) | |
| parent | 353aaf26c5f71d9a94e799a1c1e37449211e7a87 (diff) | |
| download | samba-66092ced5e1dc4d35923a3c90bcb3214a885b17d.tar.gz samba-66092ced5e1dc4d35923a3c90bcb3214a885b17d.tar.xz samba-66092ced5e1dc4d35923a3c90bcb3214a885b17d.zip | |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/winbindd/winbindd_util.c')
| -rw-r--r-- | source3/winbindd/winbindd_util.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index e7b6576317..5b5ca41a74 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -1160,7 +1160,7 @@ void parse_add_domuser(void *buf, char *domuser, int *len) } } - safe_strcpy(buf, user, *len); + safe_strcpy((char *)buf, user, *len); } /* Ensure an incoming username from NSS is fully qualified. Replace the @@ -1213,6 +1213,33 @@ void fill_domain_username(fstring name, const char *domain, const char *user, bo } } +/** + * talloc version of fill_domain_username() + * return NULL on talloc failure. + */ +char *fill_domain_username_talloc(TALLOC_CTX *mem_ctx, + const char *domain, + const char *user, + bool can_assume) +{ + char *tmp_user, *name; + + tmp_user = talloc_strdup(mem_ctx, user); + strlower_m(tmp_user); + + if (can_assume && assume_domain(domain)) { + name = tmp_user; + } else { + name = talloc_asprintf(mem_ctx, "%s%c%s", + domain, + *lp_winbind_separator(), + tmp_user); + TALLOC_FREE(tmp_user); + } + + return name; +} + /* * Winbindd socket accessor functions */ |
