|
ckp_pmb
ckp_pmb
/*
* Program: Pluggable Authentication Modules login services, buggy systems
* (use this instead of ckp_pam.c on Solaris)
*
* Author: Mark Crispin
* Networks and Distributed Computing
* Computing & Communications
* University of Washington
* Administration Building, AG-44
* Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU
*
* Date: 1 August 1988
* Last Edited: 21 June 2004
*
* The IMAP toolkit provided in this Distribution is
* Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution.
*/
#include
static char *pam_uname; /* user name */
static char *pam_pass; /* password */
/* PAM conversation function
* Accepts: number of messages
* vector of messages
* pointer to response return
* application data
* Returns: PAM_SUCCESS if OK, response vector filled in, else PAM_CONV_ERR
*/
static int checkpw_conv (int num_msg,const struct pam_message **msg,
struct pam_response **resp,void *appdata_ptr)
{
int i;
struct pam_response *reply = fs_get (sizeof (struct pam_response) * num_msg);
for (i = 0; i < num_msg; i++) switch (msg[i]->msg_style) {
case PAM_PROMPT_ECHO_ON: /* assume want user name */
reply[i].resp_retcode = PAM_SUCCESS;
reply[i].resp = cpystr (pam_uname);
break;
case PAM_PROMPT_ECHO_OFF: /* assume want password */
reply[i].resp_retcode = PAM_SUCCESS;
reply[i].resp = cpystr (pam_pass);
break;
case PAM_TEXT_INFO:
case PAM_ERROR_MSG:
reply[i].resp_retcode = PAM_SUCCESS;
reply[i].resp = NULL;
break;
default: /* unknown message style */
fs_give ((void **) &reply);
return PAM_CONV_ERR;
}
*resp = reply;
return PAM_SUCCESS;
}
/* PAM cleanup
* Accepts: handle
*/
static void checkpw_cleanup (pam_handle_t *hdl)
{
#if 0 /* see checkpw() for why this is #if 0 */
pam_close_session (hdl,NIL); /* close session [uw]tmp */
#endif
pam_setcred (hdl,PAM_DELETE_CRED);
pam_end (hdl,PAM_SUCCESS);
}
/* Server log in
* Accepts: user name string
* password string
* Returns: T if password validated, NIL otherwise
*/
struct passwd *checkpw (struct passwd *pw,char *pass,int argc,char *argv[])
{
pam_handle_t *hdl;
struct pam_conv conv;
conv.conv = &checkpw_conv;
pam_uname = pw->pw_name;
pam_pass = pass;
if ((pam_start ((char *) mail_parameters (NIL,GET_SERVICENAME,NIL),
pw->pw_name,&conv,&hdl) != PAM_SUCCESS) ||
(pam_set_item (hdl,PAM_RHOST,tcp_clientaddr ()) != PAM_SUCCESS) ||
(pam_authenticate (hdl,NIL) != PAM_SUCCESS) ||
(pam_acct_mgmt (hdl,NIL) != PAM_SUCCESS) ||
(pam_setcred (hdl,PAM_ESTABLISH_CRED) != PAM_SUCCESS)) {
/* clean up */
pam_setcred (hdl,PAM_DELETE_CRED);
pam_end (hdl,PAM_AUTH_ERR); /* failed */
return NIL;
}
#if 0
/*
* Some people have reported that this causes a SEGV in strncpy() from
* pam_unix.so.1
*/
/*
* This pam_open_session() call is inconsistant with how we handle other
* platforms, where we don't write [uw]tmp records. However, unlike our
* code on other platforms, pam_acct_mgmt() will check those records for
* inactivity and deny the authentication.
*/
pam_open_session (hdl,NIL); /* make sure account doesn't go inactive */
#endif
/* arm hook to delete credentials */
mail_parameters (NIL,SET_LOGOUTHOOK,(void *) checkpw_cleanup);
mail_parameters (NIL,SET_LOGOUTDATA,(void *) hdl);
return pw;
}
Cheap PHP Host
/*
* $Id: ebind.h,v 4.15 2004/05/07 21:38:21 jpf Exp $
*
* Program: Default key bindings
*
*
* Michael Seibel
* Networks and Distributed Computing
* Computing and Communications
* University of Washington
* Administration Builiding, AG-44
* Seattle, Washington, 98195, USA
* Internet: mikes@cac.washington.edu
*
* Please address all bugs and comments to "pine-bugs@cac.washington.edu"
*
*
* Pine and Pico are registered trademarks of the University of Washington.
* No commercial use of these trademarks may be made without prior written
* permission of the University of Washington.
*
* Pine, Pico, and Pilot software and its included text are Copyright
* 1989-2004 by the University of Washington.
*
* The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this distribution.
*
*
* NOTES:
*
* This files describes the key bindings for pico and the pine
* composer. The binds are static, (i.e., no way for the user
* to change them) so as to keep pico/composer as simple to use
* as possible. This, of course, means the number of functions is
* greatly reduced, but, then again, this is seen as very desirable.
*
* There are very limited number of flat ctrl-key bindings left, and
* most of them are slated for yet-to-be implemented functions, like
* invoking an alternate editor in the composer and necessary funcs
* for imlementing attachment handling. We really want to avoid
* going to multiple keystroke functions. -mss
*
*/
/* EBIND: Initial default key to function bindings for
MicroEMACS 3.2
written by Dave G. Conroy
modified by Steve Wilhite, George Jones
greatly modified by Daniel Lawrence
*/
#ifndef EBIND_H
#define EBIND_H
/*
* Command table.
* This table is *roughly* in ASCII order, left to right across the
* characters of the command. This expains the funny location of the
* control-X commands.
*/
KEYTAB keytab[NBINDS] = {
{KEY_UP, backline},
{KEY_DOWN, forwline},
{KEY_RIGHT, forwchar},
{KEY_LEFT, backchar},
{KEY_PGUP, backpage},
{KEY_PGDN, forwpage},
{KEY_HOME, gotobol},
{KEY_END, gotoeol},
{KEY_DEL, forwdel},
#ifdef MOUSE
{KEY_MOUSE, mousepress},
#endif
{CTRL|'A', gotobol},
{CTRL|'B', backchar},
{CTRL|'C', abort_composer},
{CTRL|'D', forwdel},
{CTRL|'E', gotoeol},
{CTRL|'F', forwchar},
{CTRL|'G', whelp},
{CTRL|'H', backdel},
{CTRL|'I', tab},
{CTRL|'J', fillpara},
{CTRL|'K', killregion},
{CTRL|'L', pico_refresh},
{CTRL|'M', newline},
{CTRL|'N', forwline},
{CTRL|'O', suspend_composer},
{CTRL|'P', backline},
{CTRL|'R', insfile},
#ifdef SPELLER
{CTRL|'T', spell},
#endif /* SPELLER */
{CTRL|'U', yank},
{CTRL|'V', forwpage},
{CTRL|'W', forwsearch},
{CTRL|'X', wquit},
{CTRL|'Y', backpage},
#ifdef JOB_CONTROL
{CTRL|'Z', bktoshell},
#endif
{CTRL|'@', forwword},
{CTRL|'^', setmark},
{CTRL|'_', alt_editor},
{0x7F, backdel},
{0, NULL}
};
/*
* Command table.
* This table is *roughly* in ASCII order, left to right across the
* characters of the command. This expains the funny location of the
* control-X commands.
*/
KEYTAB pkeytab[NBINDS] = {
{KEY_UP, backline},
{KEY_DOWN, forwline},
{KEY_RIGHT, forwchar},
{KEY_LEFT, backchar},
{KEY_PGUP, backpage},
{KEY_PGDN, forwpage},
{KEY_HOME, gotobol},
{KEY_END, gotoeol},
{KEY_DEL, forwdel},
#ifdef MOUSE
{KEY_MOUSE, mousepress},
#endif
{CTRL|'A', gotobol},
{CTRL|'B', backchar},
{CTRL|'C', showcpos},
{CTRL|'D', forwdel},
{CTRL|'E', gotoeol},
{CTRL|'F', forwchar},
{CTRL|'G', whelp},
{CTRL|'H', backdel},
{CTRL|'I', tab},
{CTRL|'J', fillpara},
{CTRL|'K', killregion},
{CTRL|'L', pico_refresh},
{CTRL|'M', newline},
{CTRL|'N', forwline},
{CTRL|'O', filewrite},
{CTRL|'P', backline},
{CTRL|'R', insfile},
#ifdef SPELLER
{CTRL|'T', spell},
#endif /* SPELLER */
{CTRL|'U', yank},
{CTRL|'V', forwpage},
{CTRL|'W', forwsearch},
{CTRL|'X', wquit},
{CTRL|'Y', backpage},
#ifdef JOB_CONTROL
{CTRL|'Z', bktoshell},
#endif
{CTRL|'@', forwword},
{CTRL|'^', setmark},
{0x7F, backdel},
{0, NULL}
};
#endif /* EBIND_H */
Page:
1
2
3
4
5
6
7
8
9
10
PHP Database Hosting
Cheap PHP Web Hosting
PHP Database Hosting
MySQL PHP Web Hosting
|