/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "k5-int.h"
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <limits.h>
/* Is vxworks broken w.r.t. termios? --tlyu */
#ifdef __vxworks
#define ECHO_PASSWORD
#endif
#include <termios.h>
#ifdef POSIX_SIGNALS
#else
#endif
static void catch_signals(osiginfo *);
static void restore_signals(osiginfo *);
void *data,
const char *name,
const char *banner,
int num_prompts,
{
char *retp;
if (name) {
}
if (banner) {
}
/*
* Get a non-buffered stream on stdin.
*/
if (fd < 0)
return KRB5_LIBOS_CANTREADPWD;
goto cleanup;
goto cleanup;
for (i = 0; i < num_prompts; i++) {
/* fgets() takes int, but krb5_data.length is unsigned. */
goto cleanup;
if (errcode)
break;
/* put out the prompt */
got_int = 0;
fp);
putchar('\n');
/* Solaris Kerberos */
}
if (got_int)
else
break;
}
/* replace newline with null */
*retp = '\0';
else {
/* flush rest of input line */
do {
}
if (errcode)
break;
}
else if (fd >= 0)
return errcode;
}
static krb5_sigtype
{
got_int = 1;
}
static void
{
#ifdef POSIX_SIGNALS
#else
#endif
}
static void
{
#ifdef POSIX_SIGNALS
#else
#endif
}
static krb5_error_code
{
int fd;
do {
ret = 0;
break;
}
break;
#ifndef ECHO_PASSWORD
if (hidden)
#endif
break;
ret = 0;
} while (0);
/* If we're losing, restore signal handlers. */
if (ret)
return ret;
}
static krb5_error_code
{
ret = 0;
if (ret < 0)
else
ret = 0;
}
return ret;
}
#else /* non-Cygwin Windows, or Mac */
#if defined(_WIN32)
#include <io.h>
void *data,
const char *name,
const char *banner,
int num_prompts,
{
char *ptr;
int scratchchar;
int i;
if (handle == INVALID_HANDLE_VALUE)
return ENOTTY;
return ENOTTY;
new_mode &= ~( ENABLE_ECHO_INPUT );
return ENOTTY;
return ENOTTY;
if (name) {
}
if (banner) {
}
for (i = 0; i < num_prompts; i++) {
goto cleanup;
}
}
== NULL) {
putchar('\n');
goto cleanup;
}
putchar('\n');
/* fgets always null-terminates the returned string */
/* replace newline with null */
*ptr = '\0';
else /* flush rest of input line */
do {
scratchchar = getchar();
goto cleanup;
}
}
if (errcode) {
for (i = 0; i < num_prompts; i++) {
}
}
return errcode;
}
#else /* !_WIN32 */
void *data,
const char *name,
const char *banner,
int num_prompts,
{
return(EINVAL);
}
#endif /* !_WIN32 */
#endif /* Windows or Mac */
void
{
}
{
return context->prompt_types;
}