/[smeserver]/rpms/e-smith-base/sme10/e-smith-base-5.8.0-console_wrapper.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme10/e-smith-base-5.8.0-console_wrapper.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu May 12 17:10:46 2016 UTC (8 years, 5 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-base-5_8_0-71_el7_sme, e-smith-base-5_8_0-67_el7_sme, e-smith-base-5_8_0-64_el7_sme, e-smith-base-5_8_0-69_el7_sme, e-smith-base-5_8_0-70_el7_sme, e-smith-base-5_8_0-60_el7_sme, e-smith-base-5_8_0-65_el7_sme, e-smith-base-5_8_0-26_el7_sme, e-smith-base-5_8_0-39_el7_sme, e-smith-base-5_8_0-83_el7_sme, e-smith-base-5_8_0-96_el7_sme, e-smith-base-5_8_0-95_el7_sme, e-smith-base-5_8_0-34_el7_sme, e-smith-base-5_8_0-80_el7_sme, e-smith-base-5_8_0-85_el7_sme, e-smith-base-5_8_0-50_el7_sme, e-smith-base-5_8_0-22_el7_sme, e-smith-base-5_8_0-81_el7_sme, e-smith-base-5_8_0-82_el7_sme, e-smith-base-5_8_0-88_el7_sme, e-smith-base-5_8_0-41_el7_sme, e-smith-base-5_8_0-38_el7_sme, e-smith-base-5_8_0-17_el7_sme, e-smith-base-5_8_0-54_el7_sme, e-smith-base-5_8_0-99_el7_sme, e-smith-base-5_8_0-94_el7_sme, e-smith-base-5_8_0-15_el7_sme, e-smith-base-5_8_0-98_el7_sme, e-smith-base-5_8_0-97_el7_sme, e-smith-base-5_8_0-92_el7_sme, e-smith-base-5_8_0-28_el7_sme, e-smith-base-5_8_0-29_el7_sme, e-smith-base-5_8_0-75_el7_sme, e-smith-base-5_8_0-78_el7_sme, e-smith-base-5_8_0-37_el7_sme, e-smith-base-5_8_0-90_el7_sme, e-smith-base-5_8_0-35_el7_sme, e-smith-base-5_8_0-93_el7_sme, e-smith-base-5_8_0-23_el7_sme, e-smith-base-5_8_0-19_el7_sme, e-smith-base-5_8_0-55_el7_sme, e-smith-base-5_8_0-61_el7_sme, e-smith-base-5_8_0-52_el7_sme, e-smith-base-5_8_0-46_el7_sme, e-smith-base-5_8_0-62_el7_sme, e-smith-base-5_8_0-74_el7_sme, e-smith-base-5_8_0-77_el7_sme, e-smith-base-5_8_0-36_el7_sme, e-smith-base-5_8_0-63_el7_sme, e-smith-base-5_8_0-73_el7_sme, e-smith-base-5_8_0-76_el7_sme, e-smith-base-5_8_0-79_el7_sme, e-smith-base-5_8_0-30_el7_sme, e-smith-base-5_8_0-91_el7_sme, e-smith-base-5_8_0-58_el7_sme, e-smith-base-5_8_0-32_el7_sme, e-smith-base-5_8_0-86_el7_sme, e-smith-base-5_8_0-47_el7_sme, e-smith-base-5_8_0-31_el7_sme, e-smith-base-5_8_0-18_el7_sme, e-smith-base-5_8_0-59_el7_sme, e-smith-base-5_8_0-87_el7_sme, e-smith-base-5_8_0-53_el7_sme, e-smith-base-5_8_0-21_el7_sme, e-smith-base-5_8_0-44_el7_sme, e-smith-base-5_8_0-43_el7_sme, e-smith-base-5_8_0-40_el7_sme, e-smith-base-5_8_0-49_el7_sme, e-smith-base-5_8_0-48_el7_sme, e-smith-base-5_8_0-33_el7_sme, e-smith-base-5_8_0-66_el7_sme, e-smith-base-5_8_0-27_el7_sme, e-smith-base-5_8_0-68_el7_sme, e-smith-base-5_8_0-45_el7_sme, e-smith-base-5_8_0-20_el7_sme, e-smith-base-5_8_0-16_el7_sme, e-smith-base-5_8_0-42_el7_sme, e-smith-base-5_8_0-72_el7_sme, e-smith-base-5_8_0-84_el7_sme, e-smith-base-5_8_0-89_el7_sme, e-smith-base-5_8_0-51_el7_sme, e-smith-base-5_8_0-24_el7_sme
* Thu May 12 2016 Daniel Berteaud <daniel@firewall-services.com> 5.8.0-15.sme
- Use a C wrapper for the console to replace perl-suid [SME: 9393]

1 diff -Nur e-smith-base-5.8.0/console_wrapper.c e-smith-base-5.8.0_bz9393/console_wrapper.c
2 --- e-smith-base-5.8.0/console_wrapper.c 1970-01-01 01:00:00.000000000 +0100
3 +++ e-smith-base-5.8.0_bz9393/console_wrapper.c 2016-05-12 18:59:28.381581784 +0200
4 @@ -0,0 +1,8 @@
5 +#include <unistd.h>
6 +#define CONSOLE_PATH "/sbin/e-smith/console.pl"
7 +int main(ac, av)
8 +char **av;
9 +{
10 + execv(CONSOLE_PATH, av);
11 + return 0;
12 +}
13 diff -Nur e-smith-base-5.8.0/root/sbin/e-smith/console e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console
14 --- e-smith-base-5.8.0/root/sbin/e-smith/console 2016-02-05 00:14:13.000000000 +0100
15 +++ e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console 1970-01-01 01:00:00.000000000 +0100
16 @@ -1,107 +0,0 @@
17 -#!/usr/bin/perl -wT
18 -
19 -#----------------------------------------------------------------------
20 -# copyright (C) 1999-2006 Mitel Corporation
21 -#
22 -# This program is free software; you can redistribute it and/or modify
23 -# it under the terms of the GNU General Public License as published by
24 -# the Free Software Foundation; either version 2 of the License, or
25 -# (at your option) any later version.
26 -#
27 -# This program is distributed in the hope that it will be useful,
28 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
29 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 -# GNU General Public License for more details.
31 -#
32 -# You should have received a copy of the GNU General Public License
33 -# along with this program; if not, write to the Free Software
34 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 -#----------------------------------------------------------------------
36 -package esmith::console;
37 -
38 -use strict;
39 -
40 -use Locale::gettext;
41 -use esmith::ConfigDB::unsaved;
42 -use esmith::console;
43 -use esmith::console::quitConsole;
44 -
45 -my $console = esmith::console->new();
46 -
47 -my $db = esmith::ConfigDB::unsaved->open;
48 -
49 -my $termType = $db->get_prop('serial-console', 'Terminal') || '';
50 -my $SystemName = $db->get_value('SystemName');
51 -my $DomainName = $db->get_value('DomainName');
52 -
53 -$ENV{TERM} = $termType if($termType);
54 -
55 -system '/bin/sh', '/etc/profile.d/lang.sh';
56 -
57 -my %menu2object = ();
58 -my @args = ();
59 -my @items = ();
60 -
61 -my $menu_dir = '/sbin/e-smith/console-menu-items';
62 -
63 -opendir ITEMS, $menu_dir;
64 -
65 -while (defined (my $item = readdir ITEMS ))
66 -{
67 - next unless -f "$menu_dir/$item";
68 -
69 - if ($item =~ /([\w\.]+)/)
70 - {
71 - $item = $1;
72 - }
73 - else
74 - {
75 - warn "Don't know what to do with $menu_dir/$item\n";
76 - next;
77 - }
78 -
79 - my $obj = require "$menu_dir/$item";
80 -
81 - push @items, $obj;
82 -}
83 -
84 -close ITEMS;
85 -
86 -my $number = 1;
87 -
88 -foreach my $item (sort { $a->order <=> $b->order } @items)
89 -{
90 - next if ($item->order < 0);
91 - push @args, $number . '.', gettext($item->name);
92 - $menu2object{$number++ . '.'} = $item;
93 -}
94 -
95 -my $quit = esmith::console::quitConsole->new;
96 -while (1)
97 -{
98 - #----------------------------------------
99 - # Reload the configuration from file
100 - #----------------------------------------
101 -
102 - $db->reload;
103 -
104 - my $title = gettext('Server console');
105 - $title .= " (${SystemName}.${DomainName}) ";
106 -
107 - $title .= gettext('** unsaved changes **')
108 - if ( $db->get_value('UnsavedChanges') eq 'yes' );
109 -
110 - my ($rc, $choice) = $console->menu_page
111 - (
112 - title => $title,
113 - text =>
114 - gettext('Welcome to the server console!') .
115 - "\n\n" .
116 - gettext('Use the Arrow and Tab keys to make your selection, then press Enter.'),
117 - argsref => \@args,
118 - left => gettext('Exit'),
119 - );
120 -
121 - $choice = ($rc == 0) ? $menu2object{$choice} : $quit;
122 - $choice->doit($console, $db);
123 -}
124 diff -Nur e-smith-base-5.8.0/root/sbin/e-smith/console.pl e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console.pl
125 --- e-smith-base-5.8.0/root/sbin/e-smith/console.pl 1970-01-01 01:00:00.000000000 +0100
126 +++ e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console.pl 2016-02-05 00:14:13.000000000 +0100
127 @@ -0,0 +1,107 @@
128 +#!/usr/bin/perl -wT
129 +
130 +#----------------------------------------------------------------------
131 +# copyright (C) 1999-2006 Mitel Corporation
132 +#
133 +# This program is free software; you can redistribute it and/or modify
134 +# it under the terms of the GNU General Public License as published by
135 +# the Free Software Foundation; either version 2 of the License, or
136 +# (at your option) any later version.
137 +#
138 +# This program is distributed in the hope that it will be useful,
139 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
140 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
141 +# GNU General Public License for more details.
142 +#
143 +# You should have received a copy of the GNU General Public License
144 +# along with this program; if not, write to the Free Software
145 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
146 +#----------------------------------------------------------------------
147 +package esmith::console;
148 +
149 +use strict;
150 +
151 +use Locale::gettext;
152 +use esmith::ConfigDB::unsaved;
153 +use esmith::console;
154 +use esmith::console::quitConsole;
155 +
156 +my $console = esmith::console->new();
157 +
158 +my $db = esmith::ConfigDB::unsaved->open;
159 +
160 +my $termType = $db->get_prop('serial-console', 'Terminal') || '';
161 +my $SystemName = $db->get_value('SystemName');
162 +my $DomainName = $db->get_value('DomainName');
163 +
164 +$ENV{TERM} = $termType if($termType);
165 +
166 +system '/bin/sh', '/etc/profile.d/lang.sh';
167 +
168 +my %menu2object = ();
169 +my @args = ();
170 +my @items = ();
171 +
172 +my $menu_dir = '/sbin/e-smith/console-menu-items';
173 +
174 +opendir ITEMS, $menu_dir;
175 +
176 +while (defined (my $item = readdir ITEMS ))
177 +{
178 + next unless -f "$menu_dir/$item";
179 +
180 + if ($item =~ /([\w\.]+)/)
181 + {
182 + $item = $1;
183 + }
184 + else
185 + {
186 + warn "Don't know what to do with $menu_dir/$item\n";
187 + next;
188 + }
189 +
190 + my $obj = require "$menu_dir/$item";
191 +
192 + push @items, $obj;
193 +}
194 +
195 +close ITEMS;
196 +
197 +my $number = 1;
198 +
199 +foreach my $item (sort { $a->order <=> $b->order } @items)
200 +{
201 + next if ($item->order < 0);
202 + push @args, $number . '.', gettext($item->name);
203 + $menu2object{$number++ . '.'} = $item;
204 +}
205 +
206 +my $quit = esmith::console::quitConsole->new;
207 +while (1)
208 +{
209 + #----------------------------------------
210 + # Reload the configuration from file
211 + #----------------------------------------
212 +
213 + $db->reload;
214 +
215 + my $title = gettext('Server console');
216 + $title .= " (${SystemName}.${DomainName}) ";
217 +
218 + $title .= gettext('** unsaved changes **')
219 + if ( $db->get_value('UnsavedChanges') eq 'yes' );
220 +
221 + my ($rc, $choice) = $console->menu_page
222 + (
223 + title => $title,
224 + text =>
225 + gettext('Welcome to the server console!') .
226 + "\n\n" .
227 + gettext('Use the Arrow and Tab keys to make your selection, then press Enter.'),
228 + argsref => \@args,
229 + left => gettext('Exit'),
230 + );
231 +
232 + $choice = ($rc == 0) ? $menu2object{$choice} : $quit;
233 + $choice->doit($console, $db);
234 +}

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed