[Mono-dev] check for a valid system user with mono

Jonathan Pryor jonpryor at vt.edu
Wed Jul 11 06:47:42 EDT 2007


On Wed, 2007-07-11 at 06:47 +0300, Anton Andreev wrote:
> How to use Mono.Unix or Mono.Unix.Native to check whether a specific 
> system username and password are valid?

Checking that the username is valid is easy enough -- create a
UnixUserInfo instance.  An ArgumentException is thrown if the username
is invalid:

http://www.go-mono.org/docs/index.aspx?tlink=0@ecma%3a112%23UnixUserInfo
%2fC%2f0

Alas, I don't know how to check the password, as the
UnixUserInfo.Password property doesn't contain the password hash (at
least on systems with a "shadow passwd file," which is most/all current
Unix systems).

 - Jon





More information about the Mono-devel-list mailing list