From 6feaf702513a2ecf22ba028b55ae2de2f305dde6 Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Feb 18 2008 14:37:04 +0000 Subject: use default security context in install(#319231) + some colorls sh/csh optimalizations(#433189, #433190) --- diff --git a/coreutils-colorls.csh b/coreutils-colorls.csh index caabb61..1bf1e9b 100755 --- a/coreutils-colorls.csh +++ b/coreutils-colorls.csh @@ -40,6 +40,6 @@ endif unset color_none finish: -alias ll 'ls -l --color=tty' -alias l. 'ls -d .* --color=tty' -alias ls 'ls --color=tty' +alias ll 'ls -l --color=auto' +alias l. 'ls -d .* --color=auto' +alias ls 'ls --color=auto' diff --git a/coreutils-colorls.sh b/coreutils-colorls.sh index 0319fbd..1b3f0bb 100755 --- a/coreutils-colorls.sh +++ b/coreutils-colorls.sh @@ -1,25 +1,40 @@ # color-ls initialization + +#do not override user LS_COLORS, but use them. if [ -z "$LS_COLORS" ]; then - #do not override user LS_COLORS, so perform only for zero sized LS_COLORS + alias ll='ls -l' 2>/dev/null alias l.='ls -d .*' 2>/dev/null - COLORS=/etc/DIR_COLORS - [ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM" - [ -e "/etc/DIR_COLORS.256color" ] && \ - [ "`tput colors 2>/dev/null`" == "256" ] && \ - COLORS="/etc/DIR_COLORS.256color" - [ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors" - [ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors" - [ -e "$HOME/.dircolors.$TERM" ] && COLORS="$HOME/.dircolors.$TERM" - [ -e "$HOME/.dir_colors.$TERM" ] && COLORS="$HOME/.dir_colors.$TERM" - [ -e "$COLORS" ] || return + + # Skip the rest for noninteractive shells. + [ -z "$PS1" ] && return + + COLORS= + + for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \ + "$HOME/.dir_colors" "$HOME/.dircolors"; do + [ -e "$colors" ] && COLORS="$colors" && break + done + + [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \ + [ "`tput colors 2>/dev/null`" == "256" ] && \ + COLORS="/etc/DIR_COLORS.256color" + + if [ -z "$COLORS" ]; then + for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do + [ -e "$colors" ] && COLORS="$colors" && break + done + fi + + # Existence of $COLORS already checked above. + [ -n "$COLORS" ] || return eval `dircolors --sh "$COLORS" 2>/dev/null` [ -z "$LS_COLORS" ] && return egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return fi -alias ll='ls -l --color=tty' 2>/dev/null -alias l.='ls -d .* --color=tty' 2>/dev/null -alias ls='ls --color=tty' 2>/dev/null +alias ll='ls -l --color=auto' 2>/dev/null +alias l.='ls -d .* --color=auto' 2>/dev/null +alias ls='ls --color=auto' 2>/dev/null diff --git a/coreutils-selinux.patch b/coreutils-selinux.patch index 2a945c5..d77f6de 100644 --- a/coreutils-selinux.patch +++ b/coreutils-selinux.patch @@ -489,6 +489,37 @@ diff -urp coreutils-6.10-orig/src/install.c coreutils-6.10/src/install.c x->recursive = false; x->sparse_mode = SPARSE_AUTO; x->symbolic_link = false; +@@ -199,7 +199,6 @@ cp_option_init (struct cp_options *x) + x->src_info = NULL; + } + +-#ifdef ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT + /* Modify file context to match the specified policy. + If an error occurs the file will remain with the default directory + context. */ +@@ -266,13 +265,6 @@ setdefaultfilecon (char const *file) + freecon (scontext); + return; + } +-#else +-static void +-setdefaultfilecon (char const *file) +-{ +- (void) file; +-} +-#endif + + /* FILE is the last operand of this command. Return true if FILE is a + directory. But report an error there is a problem accessing FILE, +@@ -346,7 +338,7 @@ main (int argc, char **argv) + we'll actually use backup_suffix_string. */ + backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); + +- while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvS:Z:", long_options, ++ while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pPt:TvS:Z:", long_options, + NULL)) != -1) + { + switch (optc) @@ -408,6 +409,7 @@ main (int argc, char **argv) no_target_directory = true; break; diff --git a/coreutils.spec b/coreutils.spec index ab07aaf..f3ab975 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: The GNU core utilities: a set of tools commonly used in shell scripts Name: coreutils Version: 6.10 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -291,6 +291,12 @@ fi /sbin/runuser %changelog +* Mon Feb 18 2008 Ondrej Vasik - 6.10-8 +- use default security context in install - broken by + coreutils-6.10 update(#319231) +- some sh/csh scripts optimalizations(by ville.skytta@iki.fi, + - #433189, #433190) + * Mon Feb 11 2008 Ondrej Vasik - 6.10-7 - keep old csh/sh usermodified colorls shell scripts but use the new ones(#432154)