Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gksudo in MacOS

 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am searching for "gksudo" 's replacement in Mac.... I am developing a application that requires sudo pesmissions. I would like to display a pop-up to ask for sudo password. I have googled it and got to know about "cocoasudo". But cocoasudo needs to be installed.
Is there any inbuilt utility in Mac to achieve this.



Regards,
akash
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My knowledge of OS-X is fairly limited but assuming it is not too dissimilar to Linux then a 'man sudo' should reveal that there is an an environment variable SUDO_ASKPASS which can be set to define a program to run to ask for the password when sudo -A is used. It may be that a different environment variable is used on OS-X but looking at the man page should help.

On Linux I have a Java Swing program that I can use but there are definite limitations. The main limitation I have found is that the password program cannot have any command line arguments so
is not allowed and one must wrap the 'java -jar mysudo.jar' up in a script. If I find a way to avoid this limitation I will post it but don't hold your breath; I don't think it is possible (security restrictions?).
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know, but might this help...?

Apple Developer - Mac Authorization Services
 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
 
Adam Koblentz
Greenhorn
Posts: 19
Java Mac OS X Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also from the CLI, you can run "sudo open <insert app.app>"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic