kohsuke / libpam4j

libpam4j
http://libpam4j.kohsuke.org/
MIT License
44 stars 47 forks source link

getUserName() returns the input username and not the correct name #5

Open Horcrux7 opened 11 years ago

Horcrux7 commented 11 years ago

The method UnixUser.getUserName() returns the same string that was pass in the method PAM.authenticate(). That the writing depends from the input. Expected is the right writing of the USER from pamlib.

A possible fix can be to replace the line:

return new UnixUser(userName,pwd);

with:

return new UnixUser(pwd.getPwName(),pwd);