home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / pty4 / part03 / CHECKCONF.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-19  |  2.7 KB  |  91 lines

  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <sys/time.h>
  4. #include <sys/stat.h>
  5. #include <sys/file.h>
  6. #include "config/fdsettrouble.h"
  7. #include "config/genericptr.h"
  8. #include "config/devmty.h"
  9. #include "config/devsty.h"
  10. #include "config/posix.h"
  11. #include "config/ptybin.h"
  12. #include "config/ptydir.h"
  13. #include "config/ptyext.h"
  14. #include "config/ptygroup.h"
  15. #include "config/ptylongname.h"
  16. #include "config/ptymodes.h"
  17. #include "config/ptyopts.h"
  18. #include "config/ttyopts.h"
  19. #include "config/sessconnfile.h"
  20. #include "config/sessfile.h"
  21. #include <utmp.h>
  22. #include "config/utmpfile.h"
  23. #include "config/wtmpfile.h"
  24. #include <grp.h>
  25.  
  26. main()
  27. {
  28.  int nothing;
  29.  struct group *grp;
  30.  printf("Check through this list carefully.\n");
  31.  printf("master tty extension: %s\n",DEVMTY);
  32.  printf("slave tty extension: %s\n",DEVSTY);
  33.  printf("pty names: %s[%s][%s]\n",DEVMTY,PTYEXT1,PTYEXT2);
  34.  printf("pty binary directory: %s\n",PTYBIN);
  35.  printf("pty session directory: %s\n",PTYDIR);
  36.  printf("utmp file: %s  wtmp file: %s\n",UTMP_FILE,WTMP_FILE);
  37.  printf("session-connection now: %s  log: %s\n",SESSCONNNOW_FILE,SESSCONNLOG_FILE);
  38.  printf("session now: %s  log: %s\n",SESSNOW_FILE,SESSLOG_FILE);
  39. #ifdef DESPERATE_FD_SET
  40.  printf("DESPERATE_FD_SET turned on.\n");
  41. #else
  42. #ifdef LACKING_FD_ZERO
  43.  printf("LACKING_FD_ZERO turned on.\n");
  44. #else
  45.  printf("System must have normal fd_set and FD_ZERO support.\n");
  46. #endif
  47. #endif
  48.  /* XXX: GENERICPTR? */
  49. #ifdef POSIX_SILLINESS
  50.  printf("POSIX turned on. System must have setsid().\n");
  51. #else
  52.  printf("POSIX turned off. System should not have setsid().\n");
  53. #endif
  54.  printf("pty group: %d. ",PTYGROUP);
  55.  grp = getgrnam("tty");
  56.  if (!grp)
  57.    printf("\nAack! You should add a tty group, group %d, to /etc/group.\n",PTYGROUP);
  58.  else
  59.    if (grp->gr_gid == PTYGROUP)
  60.      printf("Okay, this matches the tty entry in /etc/group.\n");
  61.    else
  62.      printf("\nAack! This doesn't match the tty group entry (%d) in /etc/group.\nYou should probably edit config/ptygroup.h.\n",grp->gr_gid);
  63.  printf("session long name length: %d\n",PTYLONGNAMELEN);
  64.  printf("pty modes: %o used %o unused\n",PTYMODE_USED,PTYMODE_UNUSED);
  65.  printf("MUSTNOT: "); nothing = 1;
  66. #ifdef PTY_MUSTNOT_SESSION
  67.  printf("session "); nothing = 0;
  68. #endif
  69. #ifdef PTY_MUSTNOT_UTMPHOST
  70.  printf("utmphost "); nothing = 0;
  71. #endif
  72. #ifdef PTY_MUSTNOT_UTMP
  73.  printf("utmp "); nothing = 0;
  74. #endif
  75. #ifdef PTY_MUSTNOT_WTMP
  76.  printf("wtmp "); nothing = 0;
  77. #endif
  78. #ifdef PTY_MUSTNOT_CHOWN
  79.  printf("chown "); nothing = 0;
  80. #endif
  81.  if (nothing) printf("(nothing)");
  82.  printf("\n");
  83. #ifdef TTY_AUXCHARS
  84.  printf("System must support tty auxiliary characters.\n");
  85. #endif
  86. #ifdef TTY_WINDOWS
  87.  printf("System must support tty windows and SIGWINCH.\n");
  88. #endif
  89.  exit(0);
  90. }
  91.