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
|
--- src/kadmin/testing/util/tcl_kadm5.c.orig 2013-11-22 16:22:36.690361910 +0700
+++ src/kadmin/testing/util/tcl_kadm5.c 2013-11-22 16:44:15.022203082 +0700
@@ -801,7 +801,7 @@
return retcode;
}
if (argc != num_keysalts) {
- sprintf(interp->result, "%d keysalts specified, "
+ sprintf(Tcl_GetErrorLine(interp), "%d keysalts specified, "
"but num_keysalts is %d", argc, num_keysalts);
retcode = TCL_ERROR;
goto finished;
@@ -814,7 +814,7 @@
goto finished;
}
if (argc1 != 2) {
- sprintf(interp->result, "wrong # fields in keysalt "
+ sprintf(Tcl_GetErrorLine(interp), "wrong # fields in keysalt "
"(%d should be 2)", argc1);
retcode = TCL_ERROR;
goto finished;
@@ -856,7 +856,7 @@
*key_data = NULL;
if (list == NULL) {
if (n_key_data != 0) {
- sprintf(interp->result, "0 key_datas specified, "
+ sprintf(Tcl_GetErrorLine(interp), "0 key_datas specified, "
"but n_key_data is %d", n_key_data);
retcode = TCL_ERROR;
goto finished;
@@ -868,14 +868,14 @@
return retcode;
}
if (argc != n_key_data) {
- sprintf(interp->result, "%d key_datas specified, "
+ sprintf(Tcl_GetErrorLine(interp), "%d key_datas specified, "
"but n_key_data is %d", argc, n_key_data);
retcode = TCL_ERROR;
goto finished;
}
if (argc != 0) {
- sprintf(interp->result, "cannot parse key_data yet");
+ sprintf(Tcl_GetErrorLine(interp), "cannot parse key_data yet");
retcode = TCL_ERROR;
goto finished;
}
@@ -896,7 +896,7 @@
*tlp = NULL;
if (list == NULL) {
if (n_tl_data != 0) {
- sprintf(interp->result, "0 tl_datas specified, "
+ sprintf(Tcl_GetErrorLine(interp), "0 tl_datas specified, "
"but n_tl_data is %d", n_tl_data);
retcode = TCL_ERROR;
goto finished;
@@ -908,7 +908,7 @@
return retcode;
}
if (argc != n_tl_data) {
- sprintf(interp->result, "%d tl_datas specified, "
+ sprintf(Tcl_GetErrorLine(interp), "%d tl_datas specified, "
"but n_tl_data is %d", argc, n_tl_data);
retcode = TCL_ERROR;
goto finished;
@@ -929,7 +929,7 @@
goto finished;
}
if (argc1 != 3) {
- sprintf(interp->result, "wrong # fields in tl_data "
+ sprintf(Tcl_GetErrorLine(interp), "wrong # fields in tl_data "
"(%d should be 3)", argc1);
retcode = TCL_ERROR;
goto finished;
@@ -949,7 +949,7 @@
}
tl->tl_data_length = tmp;
if (tl->tl_data_length != strlen(argv1[2])) {
- sprintf(interp->result, "specified length %d does not "
+ sprintf(Tcl_GetErrorLine(interp), "specified length %d does not "
"match length %lu of string \"%s\"", tmp,
(unsigned long) strlen(argv1[2]), argv1[2]);
retcode = TCL_ERROR;
@@ -962,7 +962,7 @@
tl = tl->tl_data_next;
}
if (tl != NULL) {
- sprintf(interp->result, "tl is not NULL!");
+ sprintf(Tcl_GetErrorLine(interp), "tl is not NULL!");
retcode = TCL_ERROR;
goto finished;
}
@@ -992,7 +992,7 @@
}
if (argc != 20) {
- sprintf(interp->result,
+ sprintf(Tcl_GetErrorLine(interp),
"wrong # args in config params structure (%d should be 20)",
argc);
retcode = TCL_ERROR;
@@ -1129,7 +1129,7 @@
}
if (argc != 12 && argc != 20) {
- sprintf(interp->result,
+ sprintf(Tcl_GetErrorLine(interp),
"wrong # args in principal structure (%d should be 12 or 20)",
argc);
retcode = TCL_ERROR;
@@ -1391,7 +1391,7 @@
}
if (argc != 7 && argc != 10) {
- sprintf(interp->result, "wrong # args in policy structure (%d should be 7 or 10)",
+ sprintf(Tcl_GetErrorLine(interp), "wrong # args in policy structure (%d should be 7 or 10)",
argc);
retcode = TCL_ERROR;
goto finished;
--- src/kadmin/testing/util/tcl_kadm5.h.orig 2013-11-22 16:33:21.532338510 +0700
+++ src/kadmin/testing/util/tcl_kadm5.h 2013-11-22 16:33:35.462212999 +0700
@@ -1,3 +1,12 @@
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
void Tcl_kadm5_init(Tcl_Interp *interp);
+
+/*
+ * Beginning with 8.6, interp->errorLine isn't public visible anymore
+ * (TIP 330)
+*/
+
+#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
+# define Tcl_GetErrorLine(interp) (interp)->errorLine
+#endif
\ No newline at end of file
|