projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More CVS ignore stuff...
[openssl.git]
/
crypto
/
des
/
read_pwd.c
diff --git
a/crypto/des/read_pwd.c
b/crypto/des/read_pwd.c
index 75d035cf9c08d8b9b17981818d04952c7640210f..3041ab2dfe8ebaa1ea80888969fc5b590cc374d5 100644
(file)
--- a/
crypto/des/read_pwd.c
+++ b/
crypto/des/read_pwd.c
@@
-1,5
+1,5
@@
/* crypto/des/read_pwd.c */
/* crypto/des/read_pwd.c */
-/* Copyright (C) 1995-199
7
Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-199
8
Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* All rights reserved.
*
* This package is an SSL implementation written
@@
-56,6
+56,7
@@
* [including the GNU Public Licence.]
*/
* [including the GNU Public Licence.]
*/
+/* #define SIGACTION */ /* Define this if you have sigaction() */
#ifdef WIN16TTY
#undef WIN16
#undef _WINDOWS
#ifdef WIN16TTY
#undef WIN16
#undef _WINDOWS
@@
-164,17
+165,21
@@
static int noecho_fgets();
#endif
#endif
#endif
#endif
-#if
ndef NOPROTO
-
static void (*savsig[NX509_SIG])(int )
;
+#if
def SIGACTION
+
static struct sigaction savsig[NX509_SIG]
;
#else
#else
-static void (*savsig[NX509_SIG])();
+# ifndef NOPROTO
+ static void (*savsig[NX509_SIG])(int );
+# else
+ static void (*savsig[NX509_SIG])();
+# endif
#endif
static jmp_buf save;
int des_read_pw_string(buf, length, prompt, verify)
char *buf;
int length;
#endif
static jmp_buf save;
int des_read_pw_string(buf, length, prompt, verify)
char *buf;
int length;
-char *prompt;
+c
onst c
har *prompt;
int verify;
{
char buff[BUFSIZ];
int verify;
{
char buff[BUFSIZ];
@@
-204,7
+209,7
@@
int des_read_pw(buf, buff, size, prompt, verify)
char *buf;
char *buff;
int size;
char *buf;
char *buff;
int size;
-char *prompt;
+c
onst c
har *prompt;
int verify;
{
#ifdef VMS
int verify;
{
#ifdef VMS
@@
-218,14
+223,27
@@
int verify;
TTY_STRUCT tty_orig,tty_new;
#endif
#endif
TTY_STRUCT tty_orig,tty_new;
#endif
#endif
- int number=5;
- int ok=0;
- int ps=0;
- int is_a_tty=1;
-
- FILE *tty=NULL;
+ int number;
+ int ok;
+ /* statics are simply to avoid warnings about longjmp clobbering
+ things */
+ static int ps;
+ int is_a_tty;
+ static FILE *tty;
char *p;
char *p;
+ if (setjmp(save))
+ {
+ ok=0;
+ goto error;
+ }
+
+ number=5;
+ ok=0;
+ ps=0;
+ is_a_tty=1;
+ tty=NULL;
+
#ifndef MSDOS
if ((tty=fopen("/dev/tty","r")) == NULL)
tty=stdin;
#ifndef MSDOS
if ((tty=fopen("/dev/tty","r")) == NULL)
tty=stdin;
@@
-241,6
+259,13
@@
int verify;
if (errno == ENOTTY)
is_a_tty=0;
else
if (errno == ENOTTY)
is_a_tty=0;
else
+#endif
+#ifdef EINVAL
+ /* Ariel Glenn ariel@columbia.edu reports that solaris
+ * can return EINVAL instead. This should be ok */
+ if (errno == EINVAL)
+ is_a_tty=0;
+ else
#endif
return(-1);
}
#endif
return(-1);
}
@@
-255,11
+280,6
@@
int verify;
return(-1);
#endif
return(-1);
#endif
- if (setjmp(save))
- {
- ok=0;
- goto error;
- }
pushsig();
ps=1;
pushsig();
ps=1;
@@
-359,7
+379,21
@@
static void pushsig()
int i;
for (i=1; i<NX509_SIG; i++)
int i;
for (i=1; i<NX509_SIG; i++)
+ {
+#ifdef SIGUSR1
+ if (i == SIGUSR1)
+ continue;
+#endif
+#ifdef SIGUSR2
+ if (i == SIGUSR2)
+ continue;
+#endif
+#ifdef SIGACTION
+ sigaction(i,NULL,&savsig[i]);
+#else
savsig[i]=signal(i,recsig);
savsig[i]=signal(i,recsig);
+#endif
+ }
#ifdef SIGWINCH
signal(SIGWINCH,SIG_DFL);
#ifdef SIGWINCH
signal(SIGWINCH,SIG_DFL);
@@
-371,7
+405,21
@@
static void popsig()
int i;
for (i=1; i<NX509_SIG; i++)
int i;
for (i=1; i<NX509_SIG; i++)
+ {
+#ifdef SIGUSR1
+ if (i == SIGUSR1)
+ continue;
+#endif
+#ifdef SIGUSR2
+ if (i == SIGUSR2)
+ continue;
+#endif
+#ifdef SIGACTION
+ sigaction(i,&savsig[i],NULL);
+#else
signal(i,savsig[i]);
signal(i,savsig[i]);
+#endif
+ }
}
static void recsig(i)
}
static void recsig(i)