… | |
… | |
441 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
441 | AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) |
442 | else |
442 | else |
443 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
443 | AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) |
444 | fi |
444 | fi |
445 | ]) |
445 | ]) |
|
|
446 | |
|
|
447 | AC_DEFUN([TTY_GROUP_CHECK], |
|
|
448 | [ |
|
|
449 | AC_CACHE_CHECK([for tty group], tty_group, |
|
|
450 | [AC_TRY_RUN([ |
|
|
451 | #include <sys/types.h> |
|
|
452 | #include <sys/stat.h> |
|
|
453 | #include <unistd.h> |
|
|
454 | #include <grp.h> |
|
|
455 | |
|
|
456 | main() |
|
|
457 | { |
|
|
458 | struct stat st; |
|
|
459 | struct group *gr; |
|
|
460 | char *tty; |
|
|
461 | gr = getgrnam("tty"); |
|
|
462 | tty = ttyname(0); |
|
|
463 | if (gr != 0 |
|
|
464 | && tty != 0 |
|
|
465 | && (stat(tty, &st)) == 0 |
|
|
466 | && st.st_gid == gr->gr_gid) |
|
|
467 | return 0; |
|
|
468 | else |
|
|
469 | return 1; |
|
|
470 | }], |
|
|
471 | [tty_group=yes],[tty_group=no],[tty_group=no])]) |
|
|
472 | if test x$tty_group = xyes; then |
|
|
473 | AC_DEFINE(TTY_GID_SUPPORT, 1, "") |
|
|
474 | fi]) |
|
|
475 | |