bash no longer sources /etc/bash.bashrc

Hi,

Can anyone tell me how bash is sourcing /etc/bash.bashrc?

I am running suse 11.3 and decided to patch bash because of the shell shock issue. After building bash with the source and patching it, now when open a terminal my login is no longer user@hostname~$, now it is bash4.1~$, also I no longer have my PATH set and no colors in the terminal window. So I’m thinking the /etc/bash.bashrc script isn’t getting source. I look in my home directory and there is no .bashrc and no .bash_profile but default.
I looked at another suse 11.3 machine prior to the bash update and there isn’t a .bashrc or .bash_profile so how are the settings getting set?

thanks,
Dan

You lack the SUSE patches (diff/patch files) from the bash rpm if you just grabbed it from some random location and compiled it, such as;

 
/* System-wide .bashrc file for interactive shells. */
-/* #define SYS_BASHRC "/etc/bash.bashrc" */
+#define SYS_BASHRC "/etc/bash.bashrc"

If you want to make it work, you need to grab the source rpm for 12.3 or 13.1 (with the shellshock patches) and rebuild the RPM for yourself.

Also I don’t think I need to remind you that 11.3 is obsolete and no longer supported in any fashion.

~/.bash_profile 

Does not exists by default in openSUSE at least on my system starting from 10.3

And yes you need to add the openSUSE patches too, if you compile your own bash from source. Well if you miss sourcing /etc/bash.bashrc and some other stuff.

Thanks for the reply.
I grabbed the source from gnu.org:
https://ftp.gnu.org/pub/gnu/bash/

I know suse 11.3 is not supported any more thats why I went the route of downloading the same version of bash (bash 4.1) and then applying the patches from gnu.org.
We have quite a few old suse machines and cannot upgrade to the latest at the moment. I prefer to patch the existing version we are using since newer versions could potentially have unknown effects on existing private software using bash. I appreciate you help on understanding why bash is behaving differently than on other distrubutions.

thanks,
Dan

After you have unpacked the tar ball insde the bash directory, Line 77-78 of config-top.h should be the one you are looking for

77 /* System-wide .bashrc file for interactive shells. */
78 /* #define SYS_BASHRC "/etc/bash.bashrc" */

But that is only one configuration/customization of openSUSE as what Miuku said you should be rebuilding the src rpm.

Grab this (it’s the openSUSE 12.3 patched bash - latest one, same as 13.1)

http://download.opensuse.org/update/12.3/src/bash-4.2-61.15.1.src.rpm

Then try a rpm --rebuild bash-4.2-61.15.1.src.rpm

If not, let me know - I’ve got 11.3 on my VM storage.

Worked, thanks Miuku & jetchisel

Hi

I have tried (after downloading rpm)

rpm --rebuild bash-4.2-61.15.1.src.rpm

but that gives me “–rebuild unknown option”

I am on SuSE 11.3 - how can i secure bash?

Thanks

Hi
Your using the incorrect command;


rpmbuild --rebuild bash-4.2-61.15.1.src.rpm

Run as your user! install the built rpms as root.

My apologies, my post had “rpm” instead or “rpmbuild” as Malcolm pointed out and naturally it’s rpmbuild as I wasn’t able to edit the post after 10 minutes after I noticed my stupid mistake :slight_smile: