diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-01-18 02:37:55 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-01-18 02:37:55 +0000 |
commit | 1fb9ccc4e2a91bf7124fba076ffa5458a1cbf404 (patch) | |
tree | e62b44816d89c4b8ad6ce5ccaf3050afc148ce20 /source3/nsswitch/winbindd_user.c | |
parent | 9d05373a767cef2e841640f192e74da37fbb099f (diff) | |
download | samba-1fb9ccc4e2a91bf7124fba076ffa5458a1cbf404.tar.gz samba-1fb9ccc4e2a91bf7124fba076ffa5458a1cbf404.tar.bz2 samba-1fb9ccc4e2a91bf7124fba076ffa5458a1cbf404.zip |
This is the 'winbind default domain' patch from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.
The idea is the domain\username is rather harsh for unix systems - people don't
expect to have to FTP, SSH and (in particular) e-mail with a username like
that.
This 'corrects' that - but is not without its own problems.
As you can see from the changes to files like username.c and wb_client.c (smbd's
winbind client code) a lot of assumptions are made in a lot of places about
lp_winbind_seperator determining a users's status as a domain or local user.
The main change I will shortly be making is to investigate and kill off
winbind_initgroups() - as far as I know it was a workaround for an old bug in
winbind itself (and a bug in RH 5.2) and should no longer be relevent.
I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters
to determine a user/groups's 'local' status, rather than the presence of the
seperator.
As such, this functionality is recommended for servers providing unix services,
but is currently less than optimal for windows clients.
(TODO: remove all references to lp_winbind_seperator() and
lp_winbind_use_default_domain() from smbd)
Andrew Bartlett
(This used to be commit 07a21fcd2311d2d9b430b99303e3532a8c1159e4)
Diffstat (limited to 'source3/nsswitch/winbindd_user.c')
-rw-r--r-- | source3/nsswitch/winbindd_user.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index e5cacbb989..6a825c81f4 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -217,6 +217,7 @@ enum winbindd_result winbindd_getpwuid(struct winbindd_cli_state *state) if (strcmp("\\", lp_winbind_separator())) string_sub(user_name, "\\", lp_winbind_separator(), sizeof(fstring)); + strip_domain_name_if_needed(&user_name); /* Get some user info */ @@ -500,9 +501,8 @@ enum winbindd_result winbindd_getpwent(struct winbindd_cli_state *state) /* Lookup user info */ - slprintf(domain_user_name, sizeof(domain_user_name) - 1, - "%s%s%s", ent->domain_name, sep, - name_list[ent->sam_entry_index].name); + fill_domain_username(domain_user_name, ent->domain_name, + name_list[ent->sam_entry_index].name); result = winbindd_fill_pwent( ent->domain_name, @@ -596,9 +596,7 @@ enum winbindd_result winbindd_list_users(struct winbindd_cli_state *state) fstrcpy(acct_name, info[i].acct_name); } - slprintf(name, sizeof(name) - 1, "%s%s%s", - domain->name, lp_winbind_separator(), - acct_name); + fill_domain_username(name, domain->name, acct_name); /* Append to extra data */ memcpy(&extra_data[extra_data_len], name, |