Tiny Core Linux

Tiny Core Extensions => TCE Bugs => Topic started by: aus9 on April 30, 2010, 02:57:32 AM

Title: getFlash may have root versus local user permission issue?
Post by: aus9 on April 30, 2010, 02:57:32 AM
Hi

Mods feel free to move if not a bug please.

getFlash.tcz installs /usr/local/bin/getflash10.sh owner root but permissions are rwx rwx rwx


Top of script is
----------------------
if [ "$USER" == "root" ]; then
   echo "You do not need to run as root.  Exiting."
   exit 1
fi
--------------------------------------------------

1) Assuming I was NOT to be root.....I tried it as root and it did not exit.

2) I am newbie at scripts but when I made above script change to below....it killed me as a non-root user

----------------
if [ "$(whoami)" != "root" ];then
   echo "you need to be root"
   exit 0
fi
------------------------

So if its meant to exit for root users, current script did not exit for me.
Or
If its meant to exit for non-root users, current script did not exit for me.

regards

gordy
Title: Re: getFlash may have root versus local user permission issue?
Post by: ^thehatsrule^ on April 30, 2010, 02:04:47 PM
As it says, it is supposed to exit if invoked with root privileges.

In the default environment, that snippet should work as described.
Title: Re: getFlash may have root versus local user permission issue?
Post by: aus9 on April 30, 2010, 07:31:46 PM
hi

Thanks for the explain.


Can anyone now download and test it please to verify if you run as root....it does not exit when it should.

thanks
Title: Re: getFlash may have root versus local user permission issue?
Post by: maro on April 30, 2010, 08:15:26 PM
@aus9: I can't confirm your concern. I believe it's doing what it is supposed to do:
Code: [Select]
tc@box:~$ sudo getflash10.sh ; echo $?
You do not need to run as root.  Exiting.
1
(Tested on a "plain" TC 2.10 system).