help-bash
[Top][All Lists]
Advanced

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

Avoid sourcing bashrc when connected to sockets


From: Andrew Gregory
Subject: Avoid sourcing bashrc when connected to sockets
Date: Sun, 13 Feb 2022 11:55:55 -0800

The pacman package manager runs install scripts by forking and invoking a
compile-time configured shell by calling "<shell> -c '. <path-to-script>;
<operation> <args>'", e.g. "bash -c '. /tmp/.INSTALL; pre_install pacman'".  A
while back we switched from using pipes to sockets to communicate with the fork
in order to avoid SIGPIPE problems.  Unfortunately, this makes bash think it's
being run under rsh/ssh and it now reads ~/.bashrc, which can break scripts.
Can the rsh/ssh check be modified to ignore this case?  Or, if it can't (which
I assume is the case), what can we do to avoid this behavior in a way least
likely to cause problems when pacman is compiled with a shell other than bash?

Thanks,
apg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]