[X-Unix] App launched by my crontab runs as root if Login Window!

Eric F Crist ecrist at secure-computing.net
Sat Jun 4 22:01:33 PDT 2005


On Jun 4, 2005, at 11:50 PM, Jerry Krinock wrote:
>
> I did some more experiments and found that if I put in my crontab this
> command (#1):
>
> /Applications/MyApp.app/Contents/MacOS/MyApp
>
> it still launches behind the Login Window (in Tiger, not Panther),  
> but now
> the user is the "expected" user, i.e., me, i.e., the user whose  
> crontab the
> command is in.  I can detect this situation (currentUser notEquals
> consoleUser) and deal with it by running my app facelessly.
>
> But if, as I said in my original post, I put in my crontab this  
> command
> (#2):
>
> /usr/bin/open "/Applications/MyApp.app"
>
> it launches in the login window, but the user is root.  Arghhhh!!
>
> Here is my explanation.  From "man open", I see that "open" is an  
> invention
> of NextStep.  Further,
>
> "The open command opens a file (or a directory or URL), just as if  
> you had
> double-clicked the file's icon."
>
> But they don't say who "you" is.  My theory is that "you" is not  
> the owner
> of the parent process, but whoever is currently at the console,  
> because
> that's the only person who can "doubleclick" on anything.  But,  
> when the
> Login Window is showing, root is at the console.  BANG!!
>
> Jerry


I am running 10.4.1 and cannot reproduce your results.  What is  
'different' about your Mac's configuration?

_______________________________________________________
Eric F Crist                  "I am so smart, S.M.R.T!"
Secure Computing Networks              -Homer J Simpson



More information about the X-Unix mailing list