[159] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Sun4c SunOS4.1.1 problems

daemon@ATHENA.MIT.EDU (James Bottomley)
Fri Jul 5 23:09:57 1991

From: James Bottomley <jejb@lattice.amtp.cam.ac.uk>
Date: Fri, 5 Jul 91 22:51:09 BST
To: krb5-bugs@ATHENA.MIT.EDU

Have Built and partially tested the krb5kdc server successfully after noting
the following problems:

1) The distribution won't build with gcc on a sun

   Reason: the dbm_... routines rely on the passing and returning of a
   structure (datum), and sun's cc still follows the pre-ANSI rules which
   send and receive the structure by its value, whereas gcc uses the ANSI
   rules and puts the entire structure on the stack, thus making it
   incompatible with the ndbm library.

2) the lib/os/read_pwd.c program crashes out with an illegal ioctl for device.
   I assume this is because Sun prefers to implement these by the gtty and 
   stty function calls. Below is a diff for the file that uses these calls if
   the variable `sun' is defined.
   (The RCS id's are completely up the spout, I forgot to fix them before
   checking the files in, sorry.)

-----------------------------------------------------------------------
2c2
<  * $Source: /usr3/kerberos/kerberos5/RCS/read_pwd.c,v $
---
>  * $Source: /tmp_mnt/Nfs/usr3/kerberos/kerberos5/lib/os/RCS/read_pwd.c,v $
30c30
< "$Id: read_pwd.c,v 1.1 1991/07/02 09:10:09 jejb Exp $";
---
> "$Id: read_pwd.c,v 1.1 91/07/02 09:10:09 jejb Exp Locker: jejb $";
39a40,43
> #ifdef sun
> #include <sgtty.h>
> #endif
> 
54c58,60
< #define cleanup(errcode) (void) signal(SIGINT, ointrfunc); tcsetattr(0, TCSANOW, &save_control); return errcode;
---
> #define cleanup(errcode) (void) signal(SIGINT, ointrfunc); tcsetattr(fd, TCSANOW, &save_control); return errcode;
> #elif defined(sun)
> #define cleanup(errcode) (void) signal(SIGINT, ointrfunc); stty(fd, (char *)&tty_savestate); return errcode;
56c62
< #define cleanup(errcode) (void) signal(SIGINT, ointrfunc); ioctl(0, TIOCSETP, (char *)&tty_savestate); return errcode;
---
> #define cleanup(errcode) (void) signal(SIGINT, ointrfunc); ioctl(fd, TIOCSETP, (char *)&tty_savestate); return errcode;
86a93
>     int fd;
88c95,102
<     if (tcgetattr(0, &echo_control) == -1)
---
>     /* get the file descriptor associated with stdin */
>     fd=fileno(stdin);
> 
> #ifdef sun
>     /* don't want to read password from anything but a terminal */
>     if (!isatty(fd)) {
>         fprintf(stderr,"Can only read password from a tty\n");
>         errno=ENOTTY; /* say innapropriate ioctl for device */
89a104,105
>     }
> #endif /* sun */
90a107,109
>     if (tcgetattr(fd, &echo_control) == -1)
> 	return errno;
> 
94c113
<     if (tcsetattr(0, TCSANOW, &echo_control) == -1)
---
>     if (tcsetattr(fd, TCSANOW, &echo_control) == -1)
98a118
>     int fd;
99a120,131
>     /* get the file descriptor associated with stdin */
>     fd=fileno(stdin);
> 
> #ifdef sun
>     /* don't want to read password from anything but a terminal */
>     if (!isatty(fd)) {
>         fprintf(stderr,"Can only read password from a tty\n");
>         errno=ENOTTY; /* say innapropriate ioctl for device */
> 	return errno;
>     }
> #endif /* sun */
> 
101c133,139
<     if (ioctl(0,TIOCGETP,(char *)&tty_savestate) == -1) 
---
>     if (
> #ifdef sun
> 	gtty(fd,(char *)&tty_savestate)
> #else
> 	ioctl(fd,TIOCGETP,(char *)&tty_savestate)
> #endif
> 	== -1) 
107c145,151
<     if (ioctl(0,TIOCSETP,(char *)&tty_state) == -1)
---
>     if (
> #ifdef sun
> 	stty(fd,(char *)&tty_state)
> #else
> 	ioctl(fd,TIOCSETP,(char *)&tty_state)
> #endif
> 	== -1)
187c231
<     if (tcsetattr(0, TCSANOW, &save_control) == -1)
---
>     if (tcsetattr(fd, TCSANOW, &save_control) == -1)
190c234,240
<     if (ioctl(0, TIOCSETP, (char *)&tty_savestate) == -1)
---
>     if (
> #ifdef sun
> 	stty(fd, (char *)&tty_savestate)
> #else
> 	ioctl(fd, TIOCSETP, (char *)&tty_savestate)
> #endif
> 	== -1)

home help back first fref pref prev next nref lref last post