/usr/share/doc/pam-devel/html
NameSizeModeActions
adg-author.html30980644editdlrm
adg-copyright.html36240644editdlrm
adg-example.html36760644editdlrm
adg-files.html22390644editdlrm
adg-glossary.html32860644editdlrm
adg-interface-by-app-expected.html624720644editdlrm
adg-interface-of-app-expected.html84570644editdlrm
adg-interface-programming-notes.html26140644editdlrm
adg-interface.html50190644editdlrm
adg-introduction-description.html33730644editdlrm
adg-introduction-synopsis.html26830644editdlrm
adg-introduction.html20640644editdlrm
adg-libpam-functions.html134490644editdlrm
adg-libpam_misc.html34210644editdlrm
adg-overview.html83570644editdlrm
adg-porting.html43060644editdlrm
adg-security-conv-function.html23460644editdlrm
adg-security-library-calls.html32030644editdlrm
adg-security-resources.html29030644editdlrm
adg-security-service-name.html45350644editdlrm
adg-security-user-identity.html55120644editdlrm
adg-security.html38240644editdlrm
adg-see-also.html22140644editdlrm
Linux-PAM_ADG.html86130644editdlrm
Linux-PAM_MWG.html88030644editdlrm
mwg-author.html30750644editdlrm
mwg-copyright.html36030644editdlrm
mwg-example.html20050644editdlrm
mwg-expected-by-module-item.html464570644editdlrm
mwg-expected-by-module-other.html83520644editdlrm
mwg-expected-by-module.html41170644editdlrm
mwg-expected-of-module-acct.html61870644editdlrm
mwg-expected-of-module-auth.html109680644editdlrm
mwg-expected-of-module-chauthtok.html79770644editdlrm
mwg-expected-of-module-overview.html64370644editdlrm
mwg-expected-of-module-session.html71260644editdlrm
mwg-expected-of-module.html43740644editdlrm
mwg-introduction-description.html39710644editdlrm
mwg-introduction-synopsis.html20280644editdlrm
mwg-introduction.html20320644editdlrm
mwg-see-also.html22310644editdlrm
mwg-see-options.html29960644editdlrm
mwg-see-programming-libs.html30150644editdlrm
mwg-see-programming-sec.html91410644editdlrm
mwg-see-programming-syslog.html47410644editdlrm
mwg-see-programming.html30780644editdlrm
Edit: /usr/share/doc/pam-devel/html/adg-porting.html (4306B)
Chapter 6. Porting legacy applications

Chapter 6. Porting legacy applications

The point of PAM is that the application is not supposed to have any idea how the attached authentication modules will choose to authenticate the user. So all they can do is provide a conversation function that will talk directly to the user(client) on the modules' behalf.

Consider the case that you plug a retinal scanner into the login program. In this situation the user would be prompted: "please look into the scanner". No username or password would be needed - all this information could be deduced from the scan and a database lookup. The point is that the retinal scanner is an ideal task for a "module".

While it is true that a pop-daemon program is designed with the POP protocol in mind and no-one ever considered attaching a retinal scanner to it, it is also the case that the "clean" PAM'ification of such a daemon would allow for the possibility of a scanner module being be attached to it. The point being that the "standard" pop-authentication protocol(s) [which will be needed to satisfy inflexible/legacy clients] would be supported by inserting an appropriate pam_qpopper module(s). However, having rewritten popd once in this way any new protocols can be implemented in-situ.

One simple test of a ported application would be to insert the pam_permit module and see if the application demands you type a password... In such a case, xlock would fail to lock the terminal - or would at best be a screen-saver, ftp would give password free access to all etc.. Neither of these is a very secure thing to do, but they do illustrate how much flexibility PAM puts in the hands of the local admin.

The key issue, in doing things correctly, is identifying what is part of the authentication procedure (how many passwords etc..) the exchange protocol (prefixes to prompts etc., numbers like 331 in the case of ftpd) and what is part of the service that the application delivers. PAM really needs to have total control in the authentication "procedure", the conversation function should only deal with reformatting user prompts and extracting responses from raw input.