Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-02

How to use pam?

6 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

I need to authenticate user name and password under Linux. These are normal accounts so I guess "libpam" is the weapon of choice. But I can't find any pam binding in the FPC sources.
Is there a better way or has really no one yet used pam with fpc?

thanks,
Mattias

ik
to Mattias Gaertner
Mattias Gaertner wrote 10 lines
** Hi, I need to authenticate user name and password under Linux. These are normal accounts so I guess "libpam" is the weapon of choice. But I can't find any pam binding in the FPC sources.

Is there a better way or has really no one yet used pam with fpc?

You can use the /etc/shadows and /etc/passwd files yourself, but that require you to implement the hashing algorithm for the password inside (depends on what the user/admin choose as local login).

Show quoted text 12 lines
thanks, Mattias _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Daniel Gaspary
to Mattias Gaertner: I need to authenticate user name and password under Linux. These are normal accounts so I…
Mattias Gaertner wrote 8 lines
Hi, I need to authenticate user name and password under Linux. These are normal accounts so I guess "libpam" is the weapon of choice. But I can't find any pam binding in the FPC sources. Is there a better way or has really no one yet used pam with fpc?

At [1] there's a good recipe of how to implement a PAM login app, I believe it could be an interesting point to start a fpc binding.

[1] http://www.ibm.com/developerworks/linux/library/l-pam/index.html (search for "10 steps to designing a simple PAM login app")

Sven Barth
to ik: Is there a better way or has really no one yet used pam with fpc? You can use the…
ik wrote 17 lines
On Mon, Feb 6, 2012 at 18:37, Mattias Gaertner < > wrote: __ Hi, I need to authenticate user name and password under Linux. These are normal accounts so I guess "libpam" is the weapon of choice. But I can't find any pam binding in the FPC sources. Is there a better way or has really no one yet used pam with fpc? You can use the /etc/shadows and /etc/passwd files yourself, but that require you to implement the hashing algorithm for the password inside (depends on what the user/admin choose as local login).

Processing these files does not allow you to utilize other mechanisms for authentication like fingerprint sensors or security keys which are supported by PAM. So implementing a PAM binding is the way to go.

Regards,
Sven

Sven Barth
to Mattias Gaertner: I need to authenticate user name and password under Linux. These are normal accounts so I…
Mattias Gaertner wrote 7 lines
Hi, I need to authenticate user name and password under Linux. These are normal accounts so I guess "libpam" is the weapon of choice. But I can't find any pam binding in the FPC sources. Is there a better way or has really no one yet used pam with fpc?

If no one comes up with a header translation you might simply try whether h2pas can convert the header files of libpam.

Regards,
Sven

Marco van de Voort
to Mattias Gaertner: I need to authenticate user name and password under Linux. These are normal accounts so I…

In our previous episode, Mattias Gaertner said:

I need to authenticate user name and password under Linux. These are normal accounts so I guess "libpam" is the weapon of choice. But I can't find any pam binding in the FPC sources. Is there a better way or has really no one yet used pam with fpc?

There is an user package that deals with username and pwd via libc, and also works on FreeBSD.