read_pwd.c (68651) | read_pwd.c (100928) |
---|---|
1/* crypto/des/read_pwd.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 42 unchanged lines hidden (view full) --- 51 * SUCH DAMAGE. 52 * 53 * The licence and distribution terms for any publically available version or 54 * derivative of this code cannot be changed. i.e. this code cannot simply be 55 * copied and put under another distribution licence 56 * [including the GNU Public Licence.] 57 */ 58 | 1/* crypto/des/read_pwd.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 42 unchanged lines hidden (view full) --- 51 * SUCH DAMAGE. 52 * 53 * The licence and distribution terms for any publically available version or 54 * derivative of this code cannot be changed. i.e. this code cannot simply be 55 * copied and put under another distribution licence 56 * [including the GNU Public Licence.] 57 */ 58 |
59#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) | 59#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(VXWORKS) |
60#include <openssl/opensslconf.h> 61#ifdef OPENSSL_UNISTD 62# include OPENSSL_UNISTD 63#else 64# include <unistd.h> 65#endif 66/* If unistd.h defines _POSIX_VERSION, we conclude that we 67 * are on a POSIX system and have sigaction and termios. */ --- 60 unchanged lines hidden (view full) --- 128#endif 129 130#if !defined(TERMIO) && !defined(TERMIOS) && !defined(VMS) && !defined(MSDOS) && !defined(MAC_OS_pre_X) && !defined(MAC_OS_GUSI_SOURCE) 131#undef TERMIOS 132#undef TERMIO 133#define SGTTY 134#endif 135 | 60#include <openssl/opensslconf.h> 61#ifdef OPENSSL_UNISTD 62# include OPENSSL_UNISTD 63#else 64# include <unistd.h> 65#endif 66/* If unistd.h defines _POSIX_VERSION, we conclude that we 67 * are on a POSIX system and have sigaction and termios. */ --- 60 unchanged lines hidden (view full) --- 128#endif 129 130#if !defined(TERMIO) && !defined(TERMIOS) && !defined(VMS) && !defined(MSDOS) && !defined(MAC_OS_pre_X) && !defined(MAC_OS_GUSI_SOURCE) 131#undef TERMIOS 132#undef TERMIO 133#define SGTTY 134#endif 135 |
136#if defined(VXWORKS) 137#undef TERMIOS 138#undef TERMIO 139#undef SGTTY 140#endif 141 |
|
136#ifdef TERMIOS 137#include <termios.h> 138#define TTY_STRUCT struct termios 139#define TTY_FLAGS c_lflag 140#define TTY_get(tty,data) tcgetattr(tty,data) 141#define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) 142#endif 143 --- 91 unchanged lines hidden (view full) --- 235 { 236#ifdef VMS 237 struct IOSB iosb; 238 $DESCRIPTOR(terminal,"TT"); 239 long tty_orig[3], tty_new[3]; 240 long status; 241 unsigned short channel = 0; 242#else | 142#ifdef TERMIOS 143#include <termios.h> 144#define TTY_STRUCT struct termios 145#define TTY_FLAGS c_lflag 146#define TTY_get(tty,data) tcgetattr(tty,data) 147#define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) 148#endif 149 --- 91 unchanged lines hidden (view full) --- 241 { 242#ifdef VMS 243 struct IOSB iosb; 244 $DESCRIPTOR(terminal,"TT"); 245 long tty_orig[3], tty_new[3]; 246 long status; 247 unsigned short channel = 0; 248#else |
243#ifndef MSDOS | 249#if !defined(MSDOS) && !defined(VXWORKS) |
244 TTY_STRUCT tty_orig,tty_new; 245#endif 246#endif 247 int number; 248 int ok; 249 /* statics are simply to avoid warnings about longjmp clobbering 250 things */ 251 static int ps; --- 11 unchanged lines hidden (view full) --- 263 ok=0; 264 ps=0; 265 is_a_tty=1; 266 tty=NULL; 267 268#ifdef MSDOS 269 if ((tty=fopen("con","r")) == NULL) 270 tty=stdin; | 250 TTY_STRUCT tty_orig,tty_new; 251#endif 252#endif 253 int number; 254 int ok; 255 /* statics are simply to avoid warnings about longjmp clobbering 256 things */ 257 static int ps; --- 11 unchanged lines hidden (view full) --- 269 ok=0; 270 ps=0; 271 is_a_tty=1; 272 tty=NULL; 273 274#ifdef MSDOS 275 if ((tty=fopen("con","r")) == NULL) 276 tty=stdin; |
271#elif defined(MAC_OS_pre_X) | 277#elif defined(MAC_OS_pre_X) || defined(VXWORKS) |
272 tty=stdin; 273#else 274#ifndef MPE 275 if ((tty=fopen("/dev/tty","r")) == NULL) 276#endif 277 tty=stdin; 278#endif 279 --- 81 unchanged lines hidden (view full) --- 361 /* continue; */ 362 } 363 } 364 ok=1; 365 } 366 367error: 368 fprintf(stderr,"\n"); | 278 tty=stdin; 279#else 280#ifndef MPE 281 if ((tty=fopen("/dev/tty","r")) == NULL) 282#endif 283 tty=stdin; 284#endif 285 --- 81 unchanged lines hidden (view full) --- 367 /* continue; */ 368 } 369 } 370 ok=1; 371 } 372 373error: 374 fprintf(stderr,"\n"); |
369#ifdef DEBUG | 375#if 0 |
370 perror("fgets(tty)"); 371#endif 372 /* What can we do if there is an error? */ 373#if defined(TTY_set) && !defined(VMS) 374 if (ps >= 2) TTY_set(fileno(tty),&tty_orig); 375#endif 376#ifdef VMS 377 if (ps >= 2) --- 128 unchanged lines hidden --- | 376 perror("fgets(tty)"); 377#endif 378 /* What can we do if there is an error? */ 379#if defined(TTY_set) && !defined(VMS) 380 if (ps >= 2) TTY_set(fileno(tty),&tty_orig); 381#endif 382#ifdef VMS 383 if (ps >= 2) --- 128 unchanged lines hidden --- |