cumulative update with various fixes

This commit is contained in:
Ondrej Vasik 2010-04-28 15:48:52 +00:00
parent 12226c563d
commit f28f512e31
8 changed files with 118 additions and 21 deletions

View File

@ -0,0 +1,75 @@
diff -urNp coreutils-7.6-orig/m4/jm-macros.m4 coreutils-7.6/m4/jm-macros.m4
--- coreutils-7.6-orig/m4/jm-macros.m4 2010-04-28 17:44:36.000000000 +0200
+++ coreutils-7.6/m4/jm-macros.m4 2010-04-28 17:45:01.000000000 +0200
@@ -146,6 +146,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],
diff -urNp coreutils-7.6-orig/src/who.c coreutils-7.6/src/who.c
--- coreutils-7.6-orig/src/who.c 2010-04-28 17:44:36.000000000 +0200
+++ coreutils-7.6/src/who.c 2010-04-28 17:45:01.000000000 +0200
@@ -36,6 +36,10 @@
#include "error.h"
#include "quote.h"
+#ifdef TTY_GROUP_NAME
+# include <grp.h>
+#endif
+
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "who"
@@ -307,6 +311,22 @@ print_line (int userlen, const char *use
free (x_exitstr);
}
+/* Return true if a terminal device given as PSTAT allows other users
+ to send messages to; false otherwise */
+static bool
+is_tty_writable (struct stat const *pstat)
+{
+#ifdef TTY_GROUP_NAME
+ /* Ensure the group of the TTY device matches TTY_GROUP_NAME, more info at
+ https://bugzilla.redhat.com/454261 */
+ struct group *ttygr = getgrnam (TTY_GROUP_NAME);
+ if (!ttygr || (pstat->st_gid != ttygr->gr_gid))
+ return false;
+#endif
+
+ return pstat->st_mode & S_IWGRP;
+}
+
/* Send properly parsed USER_PROCESS info to print_line. The most
recent boot time is BOOTTIME. */
static void
@@ -345,7 +365,7 @@ print_user (const STRUCT_UTMP *utmp_ent,
if (stat (line, &stats) == 0)
{
- mesg = (stats.st_mode & S_IWGRP) ? '+' : '-';
+ mesg = is_tty_writable (&stats) ? '+' : '-';
last_change = stats.st_atime;
}
else

View File

@ -1,5 +1,5 @@
# Configuration file for the color ls utility
# Synchronized with coreutils 8.1 dircolors
# Synchronized with coreutils 8.5 dircolors
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
@ -45,9 +45,11 @@ TERM mach-color
TERM mlterm
TERM putty
TERM rxvt
TERM rxvt-256color
TERM rxvt-cygwin
TERM rxvt-cygwin-native
TERM rxvt-unicode
TERM rxvt-unicode256
TERM screen
TERM screen-256color
TERM screen-256color-bce
@ -94,7 +96,6 @@ STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 01;32

View File

@ -1,6 +1,6 @@
# Configuration file for the 256color ls utility
# This file goes in the /etc directory, and must be world readable.
# Synchronized with coreutils 8.1 dircolors
# Synchronized with coreutils 8.5 dircolors
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# In the case that you are not satisfied with supplied colors, please
@ -23,6 +23,7 @@ OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM putty-256color
TERM rxvt-256color
TERM rxvt-unicode256
TERM screen-256color
TERM xterm-256color
TERM gnome-256color

View File

@ -1,5 +1,5 @@
# Configuration file for the color ls utility - modified for gray backgrounds
# Synchronized with coreutils 8.1 dircolors
# Synchronized with coreutils 8.5 dircolors
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
@ -34,7 +34,9 @@ TERM xterm-16color
TERM xterm-88color
TERM xterm-256color
TERM rxvt
TERM rxvt-256color
TERM rxvt-unicode
TERM rxvt-unicode256
TERM xterm-color
TERM color-xterm
TERM vt100

View File

@ -2,7 +2,7 @@
# color-ls initialization
if ( $?USER_LS_COLORS ) then
if ( "$USER_LS_COLORS" != "" ) then
#when USER_LS_COLORS defined do not override user
#when USER_LS_COLORS defined do not override user
#specified LS_COLORS and use them
goto finish
endif
@ -12,14 +12,14 @@ alias ll 'ls -l'
alias l. 'ls -d .*'
set COLORS=/etc/DIR_COLORS
if ($?TERM) then
if ( -e "/etc/DIR_COLORS.$TERM" ) then
if ( -e "/etc/DIR_COLORS.$TERM" ) then
set COLORS="/etc/DIR_COLORS.$TERM"
endif
endif
if ( -e "/etc/DIR_COLORS.256color" ) then
if ( "`tput colors`" == "256" ) then
if ( "`tty -s && tput colors`" == "256" ) then
set COLORS=/etc/DIR_COLORS.256color
endif
endif
endif
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors
@ -30,11 +30,11 @@ endif
if ( ! -e "$COLORS" ) exit
eval `dircolors -c $COLORS`
eval "`dircolors -c $COLORS`"
if ( "$LS_COLORS" == '' ) exit
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
if ( "$color_none" != '' ) then
if ( "$color_none" != '' ) then
unset color_none
exit
endif

View File

@ -18,7 +18,7 @@ if [ -z "$USER_LS_COLORS" ]; then
done
[ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \
[ "x`tput colors 2>/dev/null`" = "x256" ] && \
[ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \
COLORS="/etc/DIR_COLORS.256color"
if [ -z "$COLORS" ]; then
@ -30,7 +30,7 @@ if [ -z "$USER_LS_COLORS" ]; then
# Existence of $COLORS already checked above.
[ -n "$COLORS" ] || return
eval `dircolors --sh "$COLORS" 2>/dev/null`
eval "`dircolors --sh "$COLORS" 2>/dev/null`"
[ -z "$LS_COLORS" ] && return
grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
fi

View File

@ -265,7 +265,7 @@
shell_basename = last_component (shell);
arg0 = xmalloc (strlen (shell_basename) + 2);
arg0[0] = '-';
@@ -360,6 +512,66 @@
@@ -360,6 +512,67 @@
error (0, errno, "%s", shell);
exit (exit_status);
}
@ -303,12 +303,12 @@
+
+ pid = waitpid(-1, &status, WUNTRACED);
+
+ if (WIFSTOPPED(status)) {
+ kill(getpid(), SIGSTOP);
+ if (((pid_t)-1 != pid) && (0 != WIFSTOPPED (status))) {
+ kill(getpid(), WSTOPSIG(status));
+ /* once we get here, we must have resumed */
+ kill(pid, SIGCONT);
+ }
+ } while (WIFSTOPPED(status));
+ } while (0 != WIFSTOPPED(status));
+ }
+
+ if (caught) {
@ -327,7 +327,8 @@
+ fprintf(stderr, " ...killed.\n");
+ exit(-1);
+ }
+ exit (WEXITSTATUS(status));
+ exit ((0 != WIFEXITED (status)) ? WEXITSTATUS (status)
+ : WTERMSIG (status) + 128);
+#endif /* USE_PAM */
}

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 7.6
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -28,6 +28,7 @@ Patch7: coreutils-7.6-ls-derefdanglinginode.patch
Patch8: coreutils-CVE-2009-4135.patch
Patch9: coreutils-7.6-tail-rebase.patch
Patch10: coreutils-mkstemp.patch
Patch11: coreutils-7.6-who-msgstatus.patch
# Our patches
Patch100: coreutils-6.10-configuration.patch
@ -128,6 +129,7 @@ Libraries for coreutils package.
%patch8 -p1 -b .unsafetmp
%patch9 -p1 -b .rebase
%patch10 -p1 -b .mkstemp
%patch11 -p1 -b .whomsg
# Our patches
%patch100 -p1 -b .configure
@ -181,6 +183,7 @@ automake --copy --add-missing
%configure --enable-largefile --with-afs %{?!nopam:--enable-pam} \
--enable-selinux \
--enable-install-program=su,hostname,arch \
--with-tty-group \
DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
# Regenerate manpages
@ -216,15 +219,15 @@ bzip2 -9f ChangeLog
# let be compatible with old fileutils, sh-utils and textutils packages :
mkdir -p $RPM_BUILD_ROOT{/bin,%_bindir,%_sbindir,/sbin}
%{?!nopam:mkdir -p $RPM_BUILD_ROOT%_sysconfdir/pam.d}
for f in arch basename cat chgrp chmod chown cp cut date dd df echo env false link ln ls mkdir mknod mktemp mv nice pwd rm rmdir sleep sort stty sync touch true uname unlink
for f in arch basename cat chgrp chmod chown cp cut date dd df echo env false link ln ls mkdir mknod mktemp mv nice pwd readlink rm rmdir sleep sort stty sync touch true uname unlink
do
mv $RPM_BUILD_ROOT{%_bindir,/bin}/$f
done
# chroot was in /usr/sbin :
mv $RPM_BUILD_ROOT{%_bindir,%_sbindir}/chroot
# {cat,sort,cut} were previously moved from bin to /usr/bin and linked into
for i in env cut; do ln -sf ../../bin/$i $RPM_BUILD_ROOT/usr/bin; done
# {env,cut,readlink} were previously moved from /usr/bin to /bin and linked into
for i in env cut readlink; do ln -sf ../../bin/$i $RPM_BUILD_ROOT/usr/bin; done
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
install -p -c -m644 %SOURCE101 $RPM_BUILD_ROOT%{_sysconfdir}/DIR_COLORS
@ -326,6 +329,7 @@ fi
/bin/mv
/bin/nice
/bin/pwd
/bin/readlink
/bin/rm
/bin/rmdir
/bin/sleep
@ -349,6 +353,19 @@ fi
%{_libdir}/coreutils
%changelog
* Wed Apr 28 2010 Ondrej Vasik <ovasik@redhat.com> - 7.6-11
- doublequote LS_COLORS in colorls.*sh scripts to speedup
shell start(#586029)
- update /etc/DIR_COLORS* files
- move readlink from /usr/bin to bin, keep symlink in
/usr/bin(#580682)
- run tput colors in colorls profile.d scripts only
in the interactive mode(#450424)
- fix exit status of terminated child processes in su with
pam(#559098)
- who doesn't determine user's message status correctly
(#454261)
* Wed Mar 03 2010 Dennis Gilmore <dennis@ausil.us> - 7.6-10
- add patch for mkstemp on sparc64