tcl-pam

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
OUTPUT
AUTHOR
COPYRIGHT

NAME

tcl−pam − PAM Authentication for Tcl

SYNOPSIS

package require pam

pam service username password

Returns: "Success" on success, otherwise an Error_Message

DESCRIPTION

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."
"General failure."
"Memory buffer error."
"Internal error. The implementation has a bug."
"The user was not authenticated."
"For some reason the application does not have sufficient credentials to authenticate the user."
"One or more of the authentication modules has reached its limit of tries authenticating the user. Do not try again."
"User unknown to authentication service."

On success the string "Success" is returned.

EXAMPLE

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]

OUTPUT

Username: root
Password: blablabla
Success

Username: root
Password: blablabla1
The user was not authenticated.

AUTHOR

Alexandros Stergiakis sterg@kth.se

COPYRIGHT

Copyright (C) 2008 Alexandros Stergiakis

This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.