Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bizarre Solaris problem



This has me perplexed. I have a small program, attached below, which
does little more than a gethostbyname() call.

I compile it *statically* under SunOS 4.1.3, using either acc or gcc,
and attempt to run it under Solaris 2.5.1.

It works OK for any standard /bin/sh or /bin/csh login.  If however I
use an account with /usr/local/bin/zsh (3.0.5) as the login (/etc/passwd)
shell, it hangs in the gethostbyname() call.

Further investigation using subshells from a /bin/csh login reveals:

su <zsh> : OK
zsh -l : OK
su - <zsh> : hangs

Having got into a "hang" configuration, su - <csh> *doesn't* reverse
back into a working state.

Those four pieces of evidence seem to rule out the problem as being in
the environment or the zlogin file?

Other info:  I'm unaware of anything needed to "authorize" zsh (a la
e.g. /etc/shells under some BSD-like environments).  Vanilla 3.0.5
compilation (except for my vared patch sent to the list a week or
two ago).  Nothing in zlogin except for an stty config line.

Where does one start looking here?  

Anthony
---------

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

int main(int argc, char *argv[])
{
  struct hostent *m;
  unsigned char *a;

  if (argc < 2) {
    fprintf(stderr, "usage: %s <hostname>\n", argv[0]); 
    exit(1);
  }
  m=gethostbyname(argv[1]);
  if (!m || !m->h_addr_list || !m->h_addr_list[0]) {
    fprintf(stderr, "No such host %s\n", argv[1]);
    exit(1);
  }
  a = (unsigned char *)m->h_addr_list[0];
  fprintf(stderr, "%d.%d.%d.%d\n", a[0], a[1], a[2], a[3]);
  return 0;
}



Messages sorted by: Reverse Date, Date, Thread, Author