Skip to content

Commit

Permalink
Silence gcc longjmp warnings:
Browse files Browse the repository at this point in the history
* prompter.c (krb5_prompter_posix): Make ointrfunc, fd, and errcode volatile.
* promptusr.c (krb5_os_get_tty_uio): Make ointrfunc and retval volatile.
* read_pwd.c (krb5_read_password): Make ointrfunc volatile.  Fix volatile decl
for readin_string (pointer is volatile, doesn't point to volatile).

* changepw.c (krb5_change_password): Wait only two minutes, not indefinitely,
for a response from the kpasswd server.


git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11873 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
raeburn committed Oct 22, 1999
1 parent e019daa commit c03b99a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/lib/krb5/os/ChangeLog
@@ -1,3 +1,16 @@
1999-10-22 Ken Raeburn <raeburn@mit.edu>

* prompter.c (krb5_prompter_posix): Make ointrfunc, fd, and
errcode volatile.
* promptusr.c (krb5_os_get_tty_uio): Make ointrfunc and retval
volatile.
* read_pwd.c (krb5_read_password): Make ointrfunc volatile. Fix
volatile decl for readin_string (pointer is volatile, doesn't
point to volatile).

* changepw.c (krb5_change_password): Wait only two minutes, not
indefinitely, for a response from the kpasswd server.

1999-10-18 Ken Raeburn <raeburn@mit.edu>

* localaddr.c (krb5_os_localaddr): Don't bother trying to create
Expand Down
18 changes: 18 additions & 0 deletions src/lib/krb5/os/changepw.c
Expand Up @@ -188,6 +188,9 @@ krb5_change_password(context, creds, newpw, result_code,

for (i=0; i<naddr_p; i++)
{
fd_set fdset;
struct timeval timeout;

if (connect(s2, &addr_p[i], sizeof(addr_p[i])) == SOCKET_ERROR)
{
if ((SOCKET_ERRNO == ECONNREFUSED) || (SOCKET_ERRNO == EHOSTUNREACH))
Expand Down Expand Up @@ -288,6 +291,21 @@ krb5_change_password(context, creds, newpw, result_code,
chpw_rep.data = (char *) malloc(chpw_rep.length);

/* XXX need a timeout/retry loop here */
FD_ZERO (&fdset);
FD_SET (s1, &fdset);
timeout.tv_sec = 120;
timeout.tv_usec = 0;
switch (select (s1 + 1, &fdset, 0, 0, &timeout)) {
case -1:
code = SOCKET_ERRNO;
goto cleanup;
case 0:
code = ETIMEDOUT;
goto cleanup;
default:
/* fall through */
;
}

/* "recv" would be good enough here... except that Windows/NT
commits the atrocity of returning -1 to indicate failure,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/krb5/os/prompter.c
Expand Up @@ -34,12 +34,12 @@ krb5_prompter_posix(krb5_context context,

register char *ptr;
int scratchchar;
krb5_sigtype (*ointrfunc)();
krb5_error_code errcode;
krb5_sigtype (*volatile ointrfunc)();
volatile krb5_error_code errcode;
int i;
#ifndef ECHO_PASSWORD
struct termios echo_control, save_control;
int fd;
volatile int fd;
#endif

if (name) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/krb5/os/promptusr.c
Expand Up @@ -41,8 +41,8 @@ krb5_os_get_tty_uio(context, uio)
krb5_context context;
krb5_uio uio;
{
krb5_error_code retval;
krb5_sigtype (*ointrfunc)();
volatile krb5_error_code retval;
krb5_sigtype (*volatile ointrfunc)();
krb5_uio p;
struct termios echo_control, save_control;
int fd;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/krb5/os/read_pwd.c
Expand Up @@ -60,10 +60,10 @@ krb5_read_password(context, prompt, prompt2, return_pwd, size_return)
{
/* adapted from Kerberos v4 des/read_password.c */
/* readin_string is used after a longjmp, so must be volatile */
volatile char *readin_string = 0;
char *volatile readin_string = 0;
register char *ptr;
int scratchchar;
krb5_sigtype (*ointrfunc)();
krb5_sigtype (*volatile ointrfunc)();
krb5_error_code errcode;
#ifndef ECHO_PASSWORD
struct termios echo_control, save_control;
Expand Down

0 comments on commit c03b99a

Please sign in to comment.