Proposal for modifying Get_Pwnam() [Re: couple of getpwnam() questions]

okuyamak at dd.iij4u.or.jp okuyamak at dd.iij4u.or.jp
Sun Nov 26 17:43:34 GMT 2000


>>>>> "GC" == Gerald Carter <gcarter at valinux.com> writes:
GC> ok.  Here is my proposal for a change.  Psuedo code to follow...
GC> struct passwd* Get_Pwnam(char* username, BOOL flag)
GC> {

GC>     1. attempt to lookup the username in all lower case
GC>        if success
GC>           return

GC>     2. attempt to lookup the username as transmitted (if 
GC>        transmitted in mixed case).
GC>        if success
GC>           return

GC>     3. attempt to lookup the username in all caps
GC>        if success
GC>           return

GC>     4. perform number case permutations defined by 
GC>        'username level' (defaults to 0)

GC>     return failure;

GC> }

1. Why did you not make "AS-IS" test first?
# I thought this is the easiest, and yet highest possible...

2. I wonder what will happen if Japanese version of Windows Client
  having username of Japanese......
  Maybe we should make Get_Pwnam() as 'pointer to function',
  and leave the way to switch to correct one according to 'coding
  system' option.
---- 
Kenichi Okuyama at Tokyo Research Lab., IBM-Japan, Co.




More information about the samba-technical mailing list