Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Found a way to secure these scripts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Found a way to secure these scripts
Authored by: Maran on Feb 02, '02 01:48:46PM

If you don't assign or pass along a password at all in these scripts, the OS (10.1.2 anyway) automatically prompts you with a standard password dialogue box to get administrative permission to complete the requested actions.

Here is the modified toggle script:

set pth to "'/System/Library/CoreServices/Classic Startup.app'"
do shell script "ls -l '/system/library/coreservices/classic startup.app'"
if result = "ls: Contents: Permission denied" then
display dialog "Classic is Disabled." with icon stop
buttons ["ENABLE", "Cancel"] default button 2
do shell script "chmod 0754 " & pth
with administrator privileges
else
display dialog "Classic is ENABLED." with icon note
buttons ["Disable", "Cancel"] default button 2
do shell script "chmod 0644 " & pth
with administrator privileges
end if


Here is the modified open classic once script:

global pth
on run
set ps to "enter your password here"
set pth to "'/System/Library/CoreServices/Classic Startup.app'"
do shell script "chmod 0754 " & pth with administrator privileges

tell application "Classic Startup"
activate
end tell
idle
end run
on idle
set xx to "Classic Startup"
tell application "Finder"
set yy to name of process xx
end tell
try
if yy = xx then set p to 1
set zz to 1 as boolean
on error
set zz to 0 as boolean
end try
if not zz then
do shell script "chmod 0644 " & pth with administrator privileges

quit me
end if
return 5
end idle


I'm definitely going to use these. Hope someone else feels more comfortable using them now too.

Maran



[ Reply to This | # ]