[GNC] Yes, don't use shell as root [was: Re: "No quotes retrieved. Finance::Quote isn't installed properly.", but it is (macOS)]

Jim DeLaHunt list+gnucash at jdlh.com
Wed Jul 10 01:37:37 EDT 2019


On 2019-07-09 20:13, John Ralls wrote:

>> On Jul 9, 2019, at 6:22 PM, Jim DeLaHunt <list+gnucash at jdlh.com> wrote:
>>
>> ....
>> % /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-check
>> %
>> ....
> Normally "%" implies that the shell belongs to root. Don't do that. Always run as a regular user (the prompt will normally be "$") and use sudo to escalate *only* the commands that require it--usually because they're touching system directories like /Library/Perl/5.18/site-packages. E.g. You need to escalate to install or update Finance::Quote, but not to run it.

John,

I appreciate your concern, and I completely agree that shells should not 
run as root normally.

However, as far as I can tell, this prompt is just the result of my 
shell (zsh) having a different convention. My $PS1 (which has codes to 
generate the prompt contents) is:

% echo $PS1
%m%#
%

The ZSH docs on Prompt Expansion, Shell State 
<http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Shell-state> 
say that %# yields "A ‘#’ if the shell is running with privileges, a ‘%’ 
if not. Equivalent to ‘%(!.#.%%)’." So, for zsh, my "%" prompt means 
"not root".

My user account is an administrator on this mac. I found out a while ago 
that I was forever having to log in to the administrator to get apps 
installed and use "sudo" and the like. However, I believe that 
"administrator status on account" does not mean "shell belongs to root". 
I still have to run "% sudo" to cause serious damage.

Thanks as always for your care and diligence.
      —Jim DeLaHunt, Vancouver, Canada

-- 
     --Jim DeLaHunt, jdlh at jdlh.com     http://blog.jdlh.com/ (http://jdlh.com/)
       multilingual websites consultant



More information about the gnucash-user mailing list