You're using a deprecated browser that does not properly support web standards. This site will not render properly in your browser.
![]() |
|
||||||
getpg is a simple pair of C functions designed to be a drop-in replacement for getpwnam() and getpwuid(). They provide for authentication against "virtual" user accounts stored in a PostgreSQL database. Theoretically, replacing all occurrences of getpwnam() with getpgnam(), and all occurrences of getpwuid() with getpguid() would give an application "virtual" user support.
As of v0.52, the getpg functions have the ability to utilize three additional fields. The boolean enabled field indicates whether or not an account is active. This allows accounts to be deactivated without having to delete database records. The timestamp start field indicates a valid start time for the account, and the timestamp stop field indicates a valid stop time for the account. Together, they can be used to provide temporary and/or expiring accounts.
As of v0.53, the getpg functions have the ability to utilize an additional field. The timestamp last field indicates when a user last attempted to authenticate. It can be automatically updated if desired.
By themselves, the getpg functions are completely useless. They don't do anything. Their intended use is to patch source code of any type of program that authenticates users against standard unix user accounts referenced by the /etc/passwd file. This might include mail servers, ftp servers, login programs, etc.
If you use getpg to give virtual user capability to an application, please email me, and I will list it here.
The latest version of getpg is 0.56. Download it here.
Thanks to David Harris for pointing out a potential security hole in version 0.51 and earlier. Version 0.52 addressed the issue, and also somewhat changed the way folders are handled. If you were using a previous version, please read the included CHANGELOG for details.
Thanks to Marty Lee for suggesting static variable declaration to avoid corruption.
The latest version of the UW-IMAP patch is 0.60. Download it here. You do not need to download the getpg package as well -- it is included. This patch has been tested with Linux kernel v2.2, PostgreSQL versions 6.5.3 and 7.0, and UW-IMAP v4.7c2. It allows running the IMAP daemon as the virtual user owner instead of root, but can do database authentication only -- users with real accounts must have appropriate database records in order to access the IMAP server.
This patch does not work with MySQL! takeshi@softagency.co.jp has a MySQL patch available here.
If you use qmail, you should also check out Michael Devogelaer's patches that allow it to deliver mail to the same virtual users. This patch has been designed to work hand in hand with his.
Alessandro Gardich has modified the getpg functions to create PAM and NSS modules that work with PostgreSQL. His page is here.