Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

gksudo in MacOS

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot.
 
Greenhorn
Posts: 19
Mac OS X Objective C Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also from the CLI, you can run "sudo open <insert app.app>"
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic