WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: getFlash may have root versus local user permission issue?  (Read 1977 times)

aus9

  • Guest
getFlash may have root versus local user permission issue?
« 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
« Last Edit: April 30, 2010, 03:26:05 AM by aus9 »

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: getFlash may have root versus local user permission issue?
« Reply #1 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.

aus9

  • Guest
Re: getFlash may have root versus local user permission issue?
« Reply #2 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

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: getFlash may have root versus local user permission issue?
« Reply #3 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).