• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

gksudo in MacOS  RSS feed

 
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
 
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?).
 
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.
 
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>"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!