-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
xsu.h
130 lines (122 loc) · 5.26 KB
/
xsu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* * C o p y r i g h t *(also read COPYING)* * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2001 <Philip Van Hoof> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <gtk/gtk.h>
#include "pseudo.h"
#include "setup-locale.h"
#define EXIT_ERROR 1
#define EXIT_CORRECT 0
#define VERSION "0.2.3setup"
#define AUTHOR "freax"
#define NAME "Login Prompt"
#define SET_DISPL_ENV "DISPLAY=%s; export DISPLAY;"
#define SU_PWD_OUT "Password:"
#define SU_PWD_LEN 9
#define SU_DELAY 30000
/* These are set global because more then one function modifies them,
yes I do know that there are better ways (pass them as reference to
the functions that need them). This application is way to small at
this moment to care about such issues :). */
GtkWidget *gtk_window_table;
GtkWidget *gtk_text_label;
GtkWidget *gtk_combo_one;
GtkWidget *gtk_cancel_button;
GtkWidget *gtk_separator_one;
GtkWidget *gtk_ok_button;
GtkWidget *gtk_keys_pixmap;
GtkWidget *gtk_command_textbox;
GtkWidget *gtk_password_label;
GtkWidget *gtk_commandtxt_label;
GtkWidget *gtk_sshhostname_textbox;
GtkWidget *gtk_txtuser_label;
GtkWidget *gtk_xsu_window;
GtkWidget *gtk_hbox;
GtkWidget *gtk_utilbox;
/* 0.0.4 *
gtk_user_textbox and gtk_password_textbox are switched
in the GUI (The names could confuse you).
*/
GtkWidget *gtk_user_textbox;
GtkWidget *gtk_password_textbox;
GtkTooltips *tooltips;
gchar *arg_message, *arg_title, *displ_host, *su_command = NULL;
gboolean message_in=FALSE,
title_in=FALSE,
set_display_env=FALSE;
/* The functions */
static gint exec_su_failed (gpointer user_data);
/* The default keys-icon (gtk_keys_pixmap) */
static char * keys_xpm[] = {
"48 48 7 1",
" c None",
". c black",
"X c #6f6f6f",
"o c #fff770",
"O c #6f675f",
"+ c #9f872f",
"@ c #ffd77f",
" ..... ",
" ......... ",
" ... ... ",
" .. .. ",
" ... .. ",
" .. .. ",
" .. ... ",
" .. .. ",
" .. .. ",
" .. .. ",
" .. ... ",
" .. ...... ",
" ... ....XX...... ",
" ....oo.XX....XXO. ",
" ........oo.XX....XXXXX. ",
" ..o.+++..oo.XXX...oXXXXX. ",
" .ooo.+++.oo.XXXXooooXXXXXX. ",
" .ooo.+++.ooo.XXXXXooXXXXXXX. ",
" .ooo.+++.ooo.XXXXXXXXXXXXXXX. ",
" .ooo.+++.ooo.XXXXXXXXXXXXXXX. ",
" .ooo.+++.oooo.XXXXXXXXXXXXXX. ",
" .ooo.+++.oooo.XXXXXXXXXXXXX. ",
" .oo.+++.ooooo.XXXXXXXXXXXX. ",
" .oo.+++.ooooo.XXXXXXXXXXXX. ",
" .oooo.+++.ooooo.XXXXXXXXXX. ",
" .ooooo..+++..oooo..XXXXXXXX. ",
" .ooooo..+++++.ooooo...XXXXX. ",
" .oooo.@..+++++.ooooooo..XXXX. ",
" .oooo.@@..++++....oooooo.XXXX. ",
" .ooo.@@@.++++. .ooooo.XXXX. ",
" .oo.@@@@.++++. .oooo. .XXXX. ",
" .ooo.@@@@.++++. .ooo. .XXX. ",
" .ooo.@@@@.++++. .ooo. .XXXX. ",
" .ooo.@@@@@.+++. .oooo. .XXX. ",
" .ooo.@@@@@.+++. .ooo. .XXXX.. ",
" .oooo.@@@@..+++. .oooo. .XXXXX. ",
" .oooo.@@@@. .++. .ooo. .XXXX. ",
" .ooooo.@@@. .+++. .ooo. .XXXX. ",
" .ooooo...@. .+++. .ooo. .XXX. ",
" .ooooo. .. .++. ..ooo. .XX. ",
" .ooooo. .++. .ooo. .. ",
" .oooo. .++. .oooo. ",
" .oooo. .+++. .ooo. ",
" .ooo. .+++. .ooo. ",
" ... .++. ... ",
" .++. ",
" .++. ",
" .. "
};