[Mono-devel-list] Login application
Rafael Teixeira
monoman at gmail.com
Tue Aug 10 15:51:53 EDT 2004
Oi Jurandy,
Some Posix functionality is available in the Mono.Posix assembly
(overview here http://www.nullenvoid.com/mono/wiki/index.php/MonoPosix).
It looks like there is not much of PAM integration classes there, so
you my need to write some code yourself to P/Invoke in the correct
libraries (because probably your code won't have direct access to the
passwords file in /etc, and may need to be more useful than this
Python example that doesn't work well with shadow passwords).
<brazilian-portuguese-plug>
Você conhece o MonoBrasil (http://monobrasil.softwarelivre.org/twiki/bin/view)?
</brazilian-portuguese-plug>
Sorry for not being able to really help you with this...
Fun,
On Tue, 10 Aug 2004 11:15:47 -0300, Jurandy Martins Soares Junior
<jurandy at lsd.ic.unicamp.br> wrote:
> Hi, all!
>
> I'm new in the list (but not in C#).
>
> Does anyone know how to write in C# a sample application for login?
>
> Something similar to the one below, written in Python.
>
> Regards,
> Jurandy Martins
>
> ----------------------------
> #!/usr/bin/python
> import crypt, getpass, pwd
>
> def login():
> username = raw_input('Python login:')
> cryptedpasswd = pwd.getpwnam(username)[1]
> if cryptedpasswd:
> if cryptedpasswd == 'x' or cryptedpasswd == '*':
> raise "Sorry, currently no support for shadow passwords"
> cleartext = getpass.getpass()
> if crypt.crypt(cleartext, cryptedpasswd[:2]) == cryptedpasswd:
> print "Authentication succeed!"
> else:
> print "Failure login!"
>
> login()
--
Rafael "Monoman" Teixeira
---------------------------------------
Cognition is not a representation of an objectively existing world
but is a bringing forth of a world in the process of living.
-- Fritjof Capra, citing
Humberto Maturana and Francisco Varella's "Santiago Theory of Cognition"
More information about the Mono-devel-list
mailing list