aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/0002-Add-some-ticket-flags-to-the-dialog.patch
blob: 3a3b245cc28cbec841110e85b8839961c4397183 (plain)
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
131
132
133
134
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 29 Sep 2009 13:33:41 +0200
Subject: [PATCH] Add some ticket flags to the dialog

---
 src/krb5-auth-dialog.c  |    9 +++++++++
 src/krb5-auth-tickets.c |   41 ++++++++++++++++++++++++++++++++---------
 src/krb5-auth-tickets.h |    3 +++
 3 files changed, 44 insertions(+), 9 deletions(-)

diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c
index b8f95c2..e831db2 100644
--- a/src/krb5-auth-dialog.c
+++ b/src/krb5-auth-dialog.c
@@ -309,6 +309,8 @@ ka_get_service_tickets (GtkListStore *tickets)
 					 ccache,
 					 &cursor,
 					 &creds)) == 0) {
+		gboolean renewable, proxiable, forwardable;
+
 		if (creds.times.starttime)
 			ka_format_time(creds.times.starttime, start_time,
 				       sizeof(start_time));
@@ -325,6 +327,10 @@ ka_get_service_tickets (GtkListStore *tickets)
 				  "%s <span foreground=\"red\" style=\"italic\">(%s)</span>",
 				  end_time, _("Expired"));
 
+		forwardable = get_cred_forwardable(&creds);
+		renewable = get_cred_renewable(&creds);
+		proxiable = get_cred_proxiable(&creds);
+
 		ret = krb5_unparse_name (kcontext, creds.server, &name);
 		if (!ret) {
 			gtk_list_store_append(tickets, &iter);
@@ -332,6 +338,9 @@ ka_get_service_tickets (GtkListStore *tickets)
 					   PRINCIPAL_COLUMN, name,
 					   START_TIME_COLUMN, start_time,
 					   END_TIME_COLUMN, end_time_markup,
+					   FORWARDABLE_COLUMN, forwardable,
+					   RENEWABLE_COLUMN, renewable,
+					   PROXIABLE_COLUMN, proxiable,
 					   -1);
 			free(name);
 		} else
diff --git a/src/krb5-auth-tickets.c b/src/krb5-auth-tickets.c
index e926324..b00687c 100644
--- a/src/krb5-auth-tickets.c
+++ b/src/krb5-auth-tickets.c
@@ -32,38 +32,61 @@ static GtkWidget    *tickets_dialog;
 GtkWidget*
 ka_tickets_dialog_create(GtkBuilder *xml)
 {
-	GtkCellRenderer *renderer;
+	GtkCellRenderer *text_renderer, *toggle_renderer;
 	GtkTreeViewColumn *column;
 	GtkTreeView *tickets_view;
 
 	tickets = gtk_list_store_new (N_COLUMNS,
 				      G_TYPE_STRING,
 				      G_TYPE_STRING,
-				      G_TYPE_STRING);
+				      G_TYPE_STRING,
+				      G_TYPE_BOOLEAN,
+				      G_TYPE_BOOLEAN,
+				      G_TYPE_BOOLEAN);
 
 	tickets_dialog = GTK_WIDGET (gtk_builder_get_object (xml, "krb5_tickets_dialog"));
 	tickets_view = GTK_TREE_VIEW (gtk_builder_get_object (xml, "krb5_tickets_treeview"));
 	gtk_tree_view_set_model(GTK_TREE_VIEW(tickets_view), GTK_TREE_MODEL(tickets));
 
-	renderer = gtk_cell_renderer_text_new ();
-	column = gtk_tree_view_column_new_with_attributes("Principal",
-							  renderer,
+	text_renderer = gtk_cell_renderer_text_new();
+	toggle_renderer = gtk_cell_renderer_toggle_new();
+
+	column = gtk_tree_view_column_new_with_attributes(_("Principal"),
+							  text_renderer,
 							  "text",
 							  PRINCIPAL_COLUMN,
 							  NULL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
-	column = gtk_tree_view_column_new_with_attributes("Start Time",
-							  renderer,
+	column = gtk_tree_view_column_new_with_attributes(_("Start Time"),
+							  text_renderer,
 							  "text",
 							  START_TIME_COLUMN,
 							  NULL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
-	column = gtk_tree_view_column_new_with_attributes("End Time",
-							  renderer,
+	column = gtk_tree_view_column_new_with_attributes(_("End Time"),
+							  text_renderer,
 							  "markup",
 							  END_TIME_COLUMN,
 							  NULL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
+	column = gtk_tree_view_column_new_with_attributes(_("Fwd"),
+							  toggle_renderer,
+							  "active",
+							  FORWARDABLE_COLUMN,
+							  NULL);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
+	column = gtk_tree_view_column_new_with_attributes(_("Proxy"),
+							  toggle_renderer,
+							  "active",
+							  PROXIABLE_COLUMN,
+							  NULL);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
+	column = gtk_tree_view_column_new_with_attributes(_("Renew"),
+							  toggle_renderer,
+							  "active",
+							  RENEWABLE_COLUMN,
+							  NULL);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
 	return tickets_dialog;
 }
 
diff --git a/src/krb5-auth-tickets.h b/src/krb5-auth-tickets.h
index a5fa869..02d67b3 100644
--- a/src/krb5-auth-tickets.h
+++ b/src/krb5-auth-tickets.h
@@ -25,6 +25,9 @@ enum ticket_columns {
 	PRINCIPAL_COLUMN,
 	START_TIME_COLUMN,
 	END_TIME_COLUMN,
+	FORWARDABLE_COLUMN,
+	RENEWABLE_COLUMN,
+	PROXIABLE_COLUMN,
 	N_COLUMNS
 };
 
-- 
bgstack15