The Samba-Bugzilla – Attachment 559 Details for
Bug 1297
Option 'username map' broken in 3.0.3rc1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
make sure map_username() is only called once per session.
look (text/plain), 2.59 KB, created by
Gerald (Jerry) Carter (dead mail address)
on 2004-07-06 14:41:22 UTC
(
hide
)
Description:
make sure map_username() is only called once per session.
Filename:
MIME Type:
Creator:
Gerald (Jerry) Carter (dead mail address)
Created:
2004-07-06 14:41:22 UTC
Size:
2.59 KB
patch
obsolete
>Index: smbd/sesssetup.c >=================================================================== >--- smbd/sesssetup.c (revision 1369) >+++ smbd/sesssetup.c (working copy) >@@ -242,6 +242,8 @@ > > /* lookup the passwd struct, create a new user if necessary */ > >+ map_username( user ); >+ > pw = smb_getpwnam( user, real_username, True ); > > if (!pw) { >Index: auth/auth_util.c >=================================================================== >--- auth/auth_util.c (revision 1369) >+++ auth/auth_util.c (working copy) >@@ -972,25 +972,25 @@ > { > struct passwd *pw = NULL; > char *p; >- fstring mapped_username; >- fstring strip_username; >+ fstring username; > > /* we only save a copy of the username it has been mangled > by winbindd use default domain */ > > save_username[0] = '\0'; >- >- /* save a local copy of the username and run it through the >- username map */ > >- fstrcpy( mapped_username, domuser ); >- map_username( mapped_username ); >+ /* don't call map_username() here since it has to be done higher >+ up the stack so we don't call it mutliple times */ >+ >+ fstrcpy( username, domuser ); > >- p = strchr_m( mapped_username, *lp_winbind_separator() ); >+ p = strchr_m( username, *lp_winbind_separator() ); > > /* code for a DOMAIN\user string */ > > if ( p ) { >+ fstring strip_username; >+ > pw = Get_Pwnam( domuser ); > if ( pw ) { > /* make sure we get the case of the username correct */ >@@ -999,8 +999,10 @@ > if ( !strchr_m( pw->pw_name, *lp_winbind_separator() ) ) { > char *domain; > >- domain = mapped_username; >+ /* split the domain and username into 2 strings */ > *p = '\0'; >+ domain = username; >+ > fstr_sprintf(save_username, "%s%c%s", domain, *lp_winbind_separator(), pw->pw_name); > } > else >@@ -1011,26 +1013,26 @@ > } > > /* setup for lookup of just the username */ >- /* remember that p and mapped_username are overlapping memory */ >+ /* remember that p and username are overlapping memory */ > > p++; > fstrcpy( strip_username, p ); >- fstrcpy( mapped_username, strip_username ); >+ fstrcpy( username, strip_username ); > } > > /* just lookup a plain username */ > >- pw = Get_Pwnam(mapped_username); >+ pw = Get_Pwnam(username); > > /* Create local user if requested. */ > > if ( !pw && create ) { > /* Don't add a machine account. */ >- if (mapped_username[strlen(mapped_username)-1] == '$') >+ if (username[strlen(username)-1] == '$') > return NULL; > >- auth_add_user_script(NULL, mapped_username); >- pw = Get_Pwnam(mapped_username); >+ auth_add_user_script(NULL, username); >+ pw = Get_Pwnam(username); > } > > /* one last check for a valid passwd struct */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1297
: 559