summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-01-22 15:17:19 +0100
committerJim Meyering <meyering@redhat.com>2010-01-25 11:43:49 +0100
commitaad0bde0b5aa6ccf2714f43676d4941f820c6283 (patch)
treea086cfa067f6896226dfaea57b2bf44b6fa36a5a /m4
parent0caead1ea0b2ef63173cde6b583249bea3194817 (diff)
downloadcoreutils-aad0bde0b5aa6ccf2714f43676d4941f820c6283.tar.xz
who --mesg (-T) can use a more accurate test for TTY writability
Enabled when coreutils is configured with --with-tty-group. Based on a patch written by Piotr Gackiewicz. Details at http://bugzilla.redhat.com/454261 * src/who.c (is_tty_writable): A new function returning true if a TTY device is writable by the group. Additionally it checks the group to be the same as TTY_GROUP_NAME when compiled with --with-tty-group. * m4/jm-macros.m4: Introduce a new configure option --with-tty-group. * NEWS: Mention the change.
Diffstat (limited to 'm4')
-rw-r--r--m4/jm-macros.m419
1 files changed, 19 insertions, 0 deletions
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 271382723..0ddbf2fdc 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -144,6 +144,25 @@ AC_DEFUN([coreutils_MACROS],
])
AC_REQUIRE([AM_LANGINFO_CODESET])
+
+ # Accept configure options: --with-tty-group[=GROUP], --without-tty-group
+ # You can determine the group of a TTY via 'stat --format %G /dev/tty'
+ # Omitting this option is equivalent to using --without-tty-group.
+ AC_ARG_WITH([tty-group],
+ AS_HELP_STRING([--with-tty-group[[[=NAME]]]],
+ [group used by system for TTYs, "tty" when not specified]
+ [ (default: do not rely on any group used for TTYs)]),
+ [tty_group_name=$withval],
+ [tty_group_name=no])
+
+ if test "x$tty_group_name" != xno; then
+ if test "x$tty_group_name" = xyes; then
+ tty_group_name=tty
+ fi
+ AC_MSG_NOTICE([TTY group used by system set to "$tty_group_name"])
+ AC_DEFINE_UNQUOTED([TTY_GROUP_NAME], ["$tty_group_name"],
+ [group used by system for TTYs])
+ fi
])
AC_DEFUN([gl_CHECK_ALL_HEADERS],