[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#288616: use of ">" in tetex postinst errors for sites using bash noclobber



On Fri, Jan 07, 2005 at 10:52:21PM -0500, George Georgalis wrote:
>On Wed, Jan 05, 2005 at 11:25:24AM +0100, Hilmar Preusse wrote:
>>On 04.01.05 George Georgalis (george@galis.org) wrote:
>>
>>Hi,
>>
>>> The use of the noclobber bash option is akin to aliasing "-i" with
>>> the rm, cp and mv commands. It will stop a redirect to a file if
>>> that file already exists. I don't see anything in the debian policy
>>> that says root should not use this option in ~/.bashrc.
>>> 
>>This is #275140, which was closed by the submitter. Please have a
>>look at that one and tell us, if that suffice you.
>>
>
>This problem came up on an upgrade before (forget package and didn't
>file bug, but maybe because I found that one). I think a fix should be
>part of qa policy. Discovering the actual problem was not easy (we tend
>to forget we have noclobber in .bashrc). The use of ">>" or ">|" for
>writing new temp files is arbitrary, but I think the former is easier to
>read, and would be a good policy for concatenating to tmp files.
>
>Testing for noclobber would be a pain, and there are probably lots of
>other options that could break things.  Maybe the best solution is for
>apt-get to invoke scripts with "bash --rcfile /etc/bash.bashrc -c ..."
>or "bash --norc -c ..." If people using are making site changes that
>apt needs, I would expect the changes to go in /etc/bash.bashrc not
>/root/.bashrc, it's not clear to me why apt-get is using a login shell
>anyway.


Sorry, sleepy I guess didn't notice responses to the first message in 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=275140

I don't agree with all the points in message dated.
Date: Sat, 9 Oct 2004 20:39:17 -0500

eg debian doesn't set BASH_ENV by default, and I don't use it, which
kinda breaks most of what he's saying, and sidetracked the issue.

And per the last couple of messages (up to Date: Sat, 9 Oct 2004
23:42:05 -0500); I stand by my last post, apt-get should use
non-interactive and/or --norc invocation. The setting of noclobber is
an option for interactive shells (when put in ~/.bashrc). Programs like
apt-get should not inherit user environment and croak on something as
benign as the equivalent to "alias rm='rm -i'"

Regards,
// George


-- 
George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george@galis.org



Reply to: