Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Macschrauber

macrumors 68040
Original poster
Dec 27, 2015
3,105
1,565
Germany
Hello folks,

if I do for example

Code:
do shell script "ls" password "1234" with administrator privileges

Big Sur ignores the password, of course it is correct and if I type it in the following dialog box the shell script will be executed.

In Mojave it works as expected.

I know it's a security glitch to store the password inside a script. I just do it for faster debugging.


SomeOne knows how to bypass this Big Sur thing ?
 
found a workaround via echo'in the password to sudo -S:

Code:
global my_password
set my_password to "1234"

do_shell_script_sudo("ls")


------------------------------------------

on do_shell_script_sudo(the_text)
      
    if my_password is not "" then
        return do shell script "echo " & my_password & " | sudo -S " & the_text
    else
        return do shell script the_text with administrator privileges
    end if  
   
end do_shell_script_sudo
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.