On 28 Jun 2001, NAKAJI Hiroyuki wrote:
> Dear developpers,
>
> I'm using OpenSSH_2.9p1 with prngd on my Sony NEWS-OS 4.2.1R.
> NEWS-OS 4.x is based on 4.3BSD and lack of many POSIX and ANSI features.
>
> Today I tried to make the latest openssh_cvs and got the following error,
>
> gcc -g -O2 -Wall -O -I. -I.. -I. -I./.. -I/usr/local/ssl/include
-DHAVE_CONFIG_H -c readpassphrase.c
> readpassphrase.c: In function `readpassphrase':
> readpassphrase.c:89: `_POSIX_VDISABLE' undeclared (first use this
function)
> readpassphrase.c:89: (Each undeclared identifier is reported only once
> readpassphrase.c:89: for each function it appears in.)
> readpassphrase.c:54: warning: `status' might be used uninitialized in
this function
> gmake[1]: *** [readpassphrase.o] Error 1
>
Will the attach patch fix the problem. It's very much untested (I'll
fire
my NeXT box up this weekend for OpenSSH -head testing), but as long as
VSTATUS is not set. Then it's safe to wrap the whole _POSIX_VDISABLE
stuff around #ifdef and ignore it on those platforms.
Not stating it's the best solution. =) But I think it is more correct
then defining _POSIX_VDISABLE if it does not exist. But it may not be a
bad idea to unset VSTATUS if _POSIX_VDISABLE does not exist just to
ensure.
- Ben
Index: readpassphrase.c
==================================================================RCS file:
/var/cvs/openssh/openbsd-compat/readpassphrase.c,v
retrieving revision 1.2
diff -u -r1.2 readpassphrase.c
--- readpassphrase.c 2001/06/27 13:26:39 1.2
+++ readpassphrase.c 2001/06/28 03:45:20
@@ -51,7 +51,9 @@
{
struct termios term;
char ch, *p, *end;
+#ifdef _POSIX_VDISABLE
u_char status;
+#endif
int echo, input, output;
sigset_t oset, nset;
@@ -86,7 +88,9 @@
/* Turn off echo if possible. */
echo = 0;
+#ifdef _POSIX_VDISABLE
status = _POSIX_VDISABLE;
+#endif
if (tcgetattr(input, &term) == 0) {
if (!(flags & RPP_ECHO_ON) && (term.c_lflag & ECHO)) {
echo = 1;
@@ -124,7 +128,11 @@
}
}
*p = '\0';
+#ifdef _POSIX_VDISABLE
if (echo || status != _POSIX_VDISABLE) {
+#else
+ if (echo) {
+#endif
if (echo) {
(void)write(output, "\n", 1);
term.c_lflag |= ECHO;