Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Creating a graphical password prompt for a cmd line only app
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Tue Aug 27, 2013 8:40 am    Post subject: Creating a graphical password prompt for a cmd line only app Reply with quote

Hi,

I have a relatively simple task I need to do but since I'm not very up to speed with GUI programming I'm not sure the best way to go about this.

I have a command line application which when run, will prompt for a password and then fork off into the background.

What I want to do is create a graphical interface to this application which when run will prompt the user for the same password and pass it (securely) to the application.

This is so I can add the application to the XFCE startup manager and have it run at login.

This is very much akin to OpenSSH and the ssh-askpass setup I already have.

Does anyone have any ideas? Python, Tcl/Tk, Gtk?

Thanks!
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Tue Aug 27, 2013 8:46 am    Post subject: Reply with quote

What about shell-script + xdialog? (You might also add support for kdialog...)
Back to top
View user's profile Send private message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Tue Aug 27, 2013 7:58 pm    Post subject: Reply with quote

franzf wrote:
What about shell-script + xdialog? (You might also add support for kdialog...)


Ah this looks promising.

Are there any security concerns with using Xdialog for capturing a password?

Cheers!
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Wed Aug 28, 2013 8:46 am    Post subject: Reply with quote

eponymous wrote:
franzf wrote:
What about shell-script + xdialog? (You might also add support for kdialog...)


Ah this looks promising.

Are there any security concerns with using Xdialog for capturing a password?

Cheers!

I think that should be safe - as long as you make sure your password won't be saved in plaintext to disk.

just a short example:
Code:
pwd=$(Xdialog --stdout --left --title "I need your password" --password --inputbox "Password needed for action XYZ" 0 0)

$pwd now stores your pwd.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum