tcl−pam − PAM Authentication for Tcl |
package require pam pam service username password Returns: "Success" on success, otherwise an Error_Message |
This project provides a Tcl interface to Pluggable Authentication Modules as implemented in Linux. It implements a Tcl package that exports the client−side functionality of PAM to the Tcl programming language. This allows Tcl scripts to use PAM for authentication. Pluggable authentication modules or PAM are a mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API), which allows for programs that rely on authentication to be written independently of the underlying authentication scheme. PAM is currently supported in the AIX operating system, FreeBSD, HP−UX, Linux, Mac OS X, NetBSD and Solaris. PAM was later standardized as part of the X/Open UNIX standardization process, resulting in the X/Open Single Sign−on (XSSO) standard. service A string that identifies the program or service that requests PAM authentication. There must be a PAM entry to handle this program or service. Read Linux−PAM documentation for details. username The username string. password The password string. The Error_Message can be one of the following self−explanatory strings: "General failure." On success the string "Success" is returned. |
package require pam fconfigure stdout −buffering none fconfigure stdin −buffering none puts −nonewline "Username: " gets stdin user puts −nonewline "Password: " gets stdin pass puts [pam "sudo" $user $pass] |
Username: root Password: blablabla Success Username: root Password: blablabla1 The user was not authenticated. |
Alexandros Stergiakis sterg@kth.se |
Copyright (C) 2008 Alexandros Stergiakis This program is free software: you can redistribute it
and/or This program is distributed in the hope that it will be
useful, You should have received a copy of the GNU General Public
License |