bad_installation ();
error (FAIL_EXEC, 0, gettext ("needs to be installed setuid `root'"));
main (int argc, char **argv){  struct group *grp;  struct stat s;  char *pty;  gid_t gid;  uid_t uid;  if (argc != 1)    usage ();  if (geteuid () != 0)    bad_installation ();  grp = getgrnam (TTY_GROUP);  gid = grp ? grp->gr_gid : getgid ();  uid = getuid ();  /* Check that fd is a valid pty master -- call ptsname().  */  pty = ptsname (PTY_FD);  if (pty == NULL)    return errno == EBADF ? FAIL_EBADF : FAIL_EINVAL;  close (PTY_FD);  /* Check that target file is a character device.  */  if (stat (pty, &s))    return FAIL_EINVAL; /* This should only fail if pty doesn't exist.  */  if (!S_ISCHR (s.st_mode))    return FAIL_EINVAL;  if (chmod (pty, 0620))    return FAIL_EACCES;  /* XXX: Probably not true. */  if (chown (pty, uid, gid))    return FAIL_EACCES;  return 0;}