diff options
author | Mystery Man <unknown@mandriva.org> | 2001-08-07 17:40:36 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2001-08-07 17:40:36 +0000 |
commit | 068d599562888a36a50e5bbdeb8b70f83fa7c287 (patch) | |
tree | 18f5eed8353b3af647412875d438b55ef8c07670 /mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c | |
parent | be838931607e1ab14c8c699e20dd807b55579f7b (diff) | |
download | drakx-backup-do-not-use-topic/v_webmin_0_87.tar drakx-backup-do-not-use-topic/v_webmin_0_87.tar.gz drakx-backup-do-not-use-topic/v_webmin_0_87.tar.bz2 drakx-backup-do-not-use-topic/v_webmin_0_87.tar.xz drakx-backup-do-not-use-topic/v_webmin_0_87.zip |
This commit was manufactured by cvs2svn to create branchtopic/v_webmin_0_87
'v_webmin_0_87'.
Diffstat (limited to 'mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c')
-rw-r--r-- | mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c b/mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c deleted file mode 100644 index 48ca04202..000000000 --- a/mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c +++ /dev/null @@ -1,92 +0,0 @@ -#include <glib.h> -#include <gdk/gdk.h> -#include <gtk/gtkwindow.h> -#include <gtk/gtkmain.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkentry.h> -#include <gtk/gtksignal.h> - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <syslog.h> - -int outfd; -int err; - -static void okpressed(void *widget, void *clientdata) -{ - GtkWidget *answer=clientdata; - gchar *pass; - int passlen; - ssize_t wrote; - (void)widget; - - pass=gtk_entry_get_text(GTK_ENTRY(answer)); - - passlen=strlen(pass); - if(!passlen) - return; - - if((wrote=write(outfd, pass, passlen))!=passlen) { - if(wrote<0) - syslog(LOG_ERR, "write error on outpipe: %m"); - else - syslog(LOG_ERR, "short write on outpipe"); - err=1; - } - gtk_main_quit(); -} - -int main(int argc, char **argv) -{ - GtkWidget *mainwindow, *vbox, *question, *answer, *ok; - char buf[1024]; - gtk_init(&argc, &argv); - - openlog(argv[0], LOG_PID, LOG_DAEMON); - if(argc!=4) { - syslog(LOG_WARNING, "Usage error"); - return 1; - } - outfd=atoi(argv[3]); - mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(mainwindow), "pppgetpass"); - gtk_signal_connect(GTK_OBJECT(mainwindow), "destroy", - GTK_SIGNAL_FUNC(gtk_main_quit), 0); - - vbox=gtk_vbox_new(FALSE, 5); - gtk_container_add(GTK_CONTAINER(mainwindow), vbox); - gtk_widget_show(vbox); - - if(argv[1][0] && argv[2][0]) - snprintf(buf, sizeof buf, "Password for PPP client %s on server %s: ", argv[1], argv[2]); - else if(argv[1][0] && !argv[2][0]) - snprintf(buf, sizeof buf, "Password for PPP client %s: ", argv[1]); - else if(!argv[1][0] && argv[2][0]) - snprintf(buf, sizeof buf, "Password for PPP on server %s: ", argv[2]); - else - snprintf(buf, sizeof buf, "Enter PPP password: "); - question=gtk_label_new(buf); - gtk_box_pack_start(GTK_BOX(vbox), question, FALSE, TRUE, 0); - gtk_widget_show(question); - - answer=gtk_entry_new(); - gtk_entry_set_visibility(GTK_ENTRY(answer), 0); - gtk_box_pack_start(GTK_BOX(vbox), answer, FALSE, TRUE, 0); - gtk_widget_show(answer); - - ok=gtk_button_new_with_label("OK"); - gtk_box_pack_start(GTK_BOX(vbox), ok, FALSE, TRUE, 0); - gtk_signal_connect(GTK_OBJECT(ok), "clicked", - GTK_SIGNAL_FUNC(okpressed), answer); - gtk_widget_show(ok); - - gtk_widget_show(mainwindow); - gtk_main(); - - return err; -} |