_mbsetupuser uses /bin/bash
With considerable care I have developed a validation of user login environment. Bash is the most universal shell, and for compatibility with other (BSD/Linux) systems, it has been chosen for the validated environment. This environment consists primarily of tooling exported as functions, and local data paths exported as variables.
There is a very high reliability with any components using this environment because the required functions are tested with a check sum, basically "declare -f {function name} | cksum" is tested to have a particular value, or the env validation fails.
However, it has come to my attention that the bash version shipping with OSX is 3.2.57 from 2007, while a more recent version, eg 5.1.16 from 2020 is standard on the other systems. As a result, diffs like below are mucking up the check sum process:
12c12
< };
---
> }
35c35
< cat 1>&2 <<-EOF
---
> cat 1>&2 <<-EOF
This failure to maintain current versions of platform software creates a full stop in the quality process, with no particularly good work arounds.
These Mac systems do have brew installed, so it's nominal to install current bash that way. However, the brew path is at the end of the PATH env, so the brew binaries don't convolute any OSX operations. There is also an expectation for "/usr/bin/env bash" to get the right shell.
It was with great reluctance that I updated /etc/shells so that I could use brew's bash for my login shell and have consistency with other systems. I'm inclined to simply take away the exec bit from /bin/bash for minimal impact on the installed system, but I see that a (certainly not agile) OSX workflow depends on the /bin/bash login shell, _mbsetupuser. Why not /bin/sh? Why not update bash?
I have created an alternate admin user, which doesn't depend on the brew bash, least I run into problems. How badly will I break my system if I remove the exec bit from /bin/bash? In the course of application development, I start new login shells with a cleared environment, more or less continuously. How can I utilize a version of bash for my login shell that is newer then the 2007 version (15 years old now)? Should I overwrite /bin/bash with a static linked modern version?
If /bin/bash is not supported why is it in /etc/shells? Is _mbsetupuser the only OSX workflow that requires it? If it is supported, why is it such an old version? Maybe it should be moved to /legacy/bin where administrative tasks can find it? What's the best way to get a modern bash in the front of my path, and as my login shell?