Subject: Re: bug#15819: colorls.csh errors out if "noclobber" is set (coreutils 8.21.11, Fedora19)

From: Ondrej Vasik <[email-masked]>
Date: Wed, 06 Nov 2013 14:23:30 +0100

Hi -Ty!,

colors.csh/sh scripts are Fedora specific. I'll make this redirect
change in Fedora Rawhide. Thanks for report! Closing this upstream bug
report.

tags 15819 + notabug
close 15819

Greetings,
         Ondrej

On Wed, 2013-11-06 at 00:00 -0700, Ty! Boyack wrote:
> Behavior:
> 
> The setup script /etc/profile.d/colorls.csh works fine in a stock F19
> installation, but if a local admin adds a default shell setting of
> "noclobber" in a profile setting that runs before this script (as we do)
> then the script will error out with an error of:
> 
> /tmp/.colorlsXXX: File exists.
> 
> Cause:
> 
> The script creates that temporary file with mktemp, but on the first
> write it uses only a single redirect (>), which fails when noclobber is set.
> 
> Since the file is already created, I think we can safely use an append
> redirect (>>) in all cases where that file is written to, which works
> regardless of the state of the noclobber settting.
> 
> Patch:
> 
> 35c35
> < if ( "$INCLUDE" != '' ) cat "$INCLUDE" > $TMP
> ---
> > if ( "$INCLUDE" != '' ) cat "$INCLUDE" >> $TMP
> 
> Disclaimer:
> 
> I know this is not against the latest source, but I did not see anything
> in the bug lists regarding this.  My apologies if this has already been
> looked at and fixed or dismissed.
> 
> Cheers to all,
> 
> -Ty!
> 
> 
> 
>