Elevating User Rights of Livecode on Linux

Mark Wieder ahsoftware at sonic.net
Wed Jul 3 12:41:11 EDT 2019


On 7/3/19 8:28 AM, Dalton Calford via use-livecode wrote:
> I am looking to read/write odbc settings from within livecode, but due to
> user rights, I want to allow for sudoer style rights elevation.
> 
> Is there a way to present the user with a dialog asking for password from
> within livecode?

sudo -S is your friend. Try something like this:

on mouseUp pMouseButton
    local tCommands
    local tPassword

    put "apt update" into tCommands
    ask password "type your sudo password"
    put it into tPassword
    get shell("echo" && tPassword && "| sudo -S" && tCommands)
    put it into field 1
end mouseUp

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the Use-livecode mailing list