GNU bug report logs -
#15819
colorls.csh errors out if "noclobber" is set (coreutils 8.21.11, Fedora19)
Previous Next
Reported by: "Ty! Boyack" <ty.boyack <at> colostate.edu>
Date: Wed, 6 Nov 2013 07:22:01 UTC
Severity: normal
Tags: notabug
Done: Bernhard Voelker <mail <at> bernhard-voelker.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#15819: colorls.csh errors out if "noclobber" is set (coreutils 8.21.11, Fedora19)
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 15819 <at> debbugs.gnu.org.
--
15819: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15819
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
tag 15819 notabug
thanks
[added Ondrej]
> On November 6, 2013 at 8:00 AM Ty! Boyack <ty.boyack <at> colostate.edu> 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
The file 'colorls.csh' is not part of the upstream project
but rather an Fedora extension. I'm therefore marking this bug
as 'done'.
It seems this particular issue has been fixed for F20 only:
http://pkgs.fedoraproject.org/cgit/coreutils.git/commit/?id=f0b6f85aff0496c51c8fcb58197a8a132949a4e5
@Ondrej: do you plan to merge this to F19?
Have a nice day,
Berny
[Message part 3 (message/rfc822, inline)]
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!
This bug report was last modified 11 years and 280 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.