forked from cPanelSSP/SSP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.98_4.99.patch
296 lines (281 loc) · 9.27 KB
/
4.98_4.99.patch
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
--- ssp.orig 2013-11-14 12:57:40.000000000 -0600
+++ ssp 2013-12-03 09:55:48.513000066 -0600
@@ -28,7 +28,7 @@
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin';
-my $version = '4.98';
+my $version = '4.99';
$| = 1;
$Term::ANSIColor::AUTORESET = 1;
@@ -215,7 +215,6 @@
check_for_PERL5LIB_env_var();
check_for_cdorked();
check_for_disabled_services();
-check_for_broken_list_util();
check_for_cpbackup_exclude_everything();
check_for_usr_local_include_jpeglib_h();
check_for_bw_module_and_more_than_1024_vhosts();
@@ -232,6 +231,12 @@
check_for_invalid_HOMEDIR();
check_for_unsupported_options_in_phpini(); # case 75397
check_for_suphp_but_no_fileprotect();
+check_for_assp_hates_appconfig_cron();
+check_for_missing_var_cpanel_dynamicui_ftp();
+check_if_backup_dir_is_nfs();
+check_if_hostname_missing_from_localdomains();
+check_for_eximstats_newline();
+check_for_nfs();
# [3RDP]
check_for_assp();
@@ -246,6 +251,7 @@
check_for_1h();
check_for_webmin();
check_for_symantec();
+check_for_newrelic();
check_for_libkeyutils_malware();
@@ -494,6 +500,7 @@
sub print_tip {
my @tips = (
+ '[FB 78617] (By design) sysup always installs bind',
'[FB 75793] (By design) Proxy subdomains are not created for addon domains',
'[FB 73369] Can\'t log into SquirrelMail, but Horde and Roundcube work? Check if webmail pass contains "odd" characters',
'[FB 72801] (By design) File Manager creates new files with 0600 perms, even when saving an existing file as a new one',
@@ -539,6 +546,9 @@
'cPanel >> Error Log only searches "recent" logs in Apache\'s error_log . Showing as blank? Maybe there are no recent errors',
'Horde showing "server configuration did not allow file to be uploaded"? Check disk/inode usage on /tmp',
'IMAP/webmail showing no email? The cPanel account may have been over its quota. Try renaming dovecot-uidlist, send account an email (see ticket 4314723)',
+ 'ClamAV not scanning emails? Check if /var/clamd is missing. This will be reflected in Exim\'s logs as well',
+ 'Use custom_vhost_template_ap(1|2) in userdata files to make changes for an individual vhost',
+ 'File Manager upload size limits can be adjusted at WHM >> Tweak Settings >> Max HTTP submission size',
);
my $num = int rand scalar @tips;
@@ -883,7 +893,7 @@
for my $line (@tiers) {
if ( $line =~ m{ \A (.*) : (\d+\.\d+\.\d+\.\d+) \z }xms ) {
( $tier, $available_tier_version ) = ( $1, $2 );
- if ( $tier eq $local_tier_name ) {
+ if ( $tier =~ /^${local_tier_name}$/i ) {
$match = 1;
last;
}
@@ -1093,7 +1103,7 @@
}
}
else {
- my $warning = 'Apache is not up (failed: http://localhost/whm-server-status). ';
+ my $warning = 'Is Apache up/slow to respond? (failed: http://localhost/whm-server-status). ';
if ( $os eq 'linux' ) {
my @lsof_80 = split /\n/, run( 'lsof', '-n', '-i', 'tcp:80' );
@@ -1928,6 +1938,9 @@
'/var/cpanel/features' => '755',
'/var/cpanel/locale' => '755',
'/var/cpanel/resellers' => '644',
+ '/var/lib' => '755',
+ '/var/lib/mysql' => '751',
+ '/var/lib/mysql/mysql.sock' => '777',
'/var/tmp' => '1777',
'/usr/local/cpanel/php/cpanel.php' => '644',
'/usr/local/cpanel/base/3rdparty/roundcube/plugins/cpanellogin/cpanellogin.php' => '644',
@@ -4661,14 +4674,6 @@
print_warning($disabled);
}
-sub check_for_broken_list_util {
- system('/usr/bin/perl', '-MList::Util', '-e', '1');
- if ($?) {
- print_warn('List::Util: ');
- print_warning('seems broken. To fix, run this: /scripts/autorepair scalarutil');
- }
-}
-
sub check_for_cloudlinux_not_licensed_through_cpanel {
return if ( $is_cloudlinux == 0 );
@@ -5117,6 +5122,162 @@
}
}
+sub check_for_assp_hates_appconfig_cron {
+ return if !-f '/var/spool/cron/root';
+
+ my $has_bad_assp_cron = 0;
+
+ open my $cron_fh, '<', '/var/spool/cron/root';
+ while (<$cron_fh> ) {
+ if ( m{ /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/ex_localdomains.php }xms ) {
+ $has_bad_assp_cron = 1;
+ last;
+ }
+ }
+ close $cron_fh;
+
+ if ( $has_bad_assp_cron == 1 ) {
+ print_warn('ASSP: ');
+ print_warning('this software uses a cron job which breaks cPanel\'s AppConfig. See 4394109, 4392691. Complain to vendor (grscripts.com)');
+ }
+}
+
+sub check_for_missing_var_cpanel_dynamicui_ftp {
+ if ( !-e '/etc/ftpddisable' and !-e '/etc/ftpserverdisable' and !-e '/var/cpanel/dynamicui/ftp' ) {
+ print_warn('FTP: ');
+ print_warning('touchfile /v/c/dynamicui/ftp appears to be missing. FTP options may not appear in cPanel. See FB 83193');
+ }
+}
+
+sub check_if_backup_dir_is_nfs {
+ my $old_backups_dir;
+ my $new_backups_dir;
+ my $cpbackup_conf;
+ my $config;
+ my $old_backups_dir_nfs = 0;
+ my $new_backups_dir_nfs = 0;
+
+ if ( -e '/etc/cpbackup.conf' ) {
+ open my $file_fh, '<', '/etc/cpbackup.conf';
+ while (<$file_fh>) {
+ local $/;
+ $cpbackup_conf = <$file_fh>;
+ }
+ close $file_fh;
+ }
+
+ if ( -e '/var/cpanel/backups/config' ) {
+ open my $file_fh, '<', '/var/cpanel/backups/config';
+ while (<$file_fh>) {
+ local $/;
+ $config = <$file_fh>;
+ }
+ close $file_fh;
+ }
+
+ if ( $cpbackup_conf and $cpbackup_conf =~ /BACKUPENABLE yes/ and $cpbackup_conf =~ /BACKUPDIR (.*)/ ) {
+ $old_backups_dir = $1;
+ }
+
+ if ( $config and $config =~ /BACKUPENABLE: 'yes'/ and $config =~ /BACKUPDIR: (.*)/ ) {
+ $new_backups_dir = $1;
+ }
+
+ my @mount;
+
+ open my $mount_fh, '-|', '/bin/mount' or return;
+ while (<$mount_fh>) {
+ chomp;
+ push @mount, $_;
+ }
+ close $mount_fh;
+
+ for my $mount (@mount) {
+ if ($old_backups_dir) {
+ if ( $mount =~ /$old_backups_dir type nfs / ) {
+ $old_backups_dir_nfs = 1;
+ }
+ }
+ if ($new_backups_dir) {
+ if ( $mount =~ /$new_backups_dir type nfs / ) {
+ $new_backups_dir_nfs = 1;
+ }
+ }
+ }
+
+ if ( $old_backups_dir_nfs == 1 ) {
+ print_warn('Backups: ');
+ print_warning("$old_backups_dir is NFS (used by old backup system)");
+ }
+ if ( $new_backups_dir_nfs == 1 ) {
+ print_warn('Backup: ');
+ print_warning("$new_backups_dir is NFS (used by new backup system)");
+ }
+}
+
+sub check_if_hostname_missing_from_localdomains {
+ my $hostname_check = 0;
+
+ open my $localdomains_fh, '<', '/etc/localdomains';
+ while (<$localdomains_fh>) {
+ if ( /^${hostname}$/ ) {
+ $hostname_check = 1;
+ last;
+ }
+ }
+ close $localdomains_fh;
+
+ if ( $hostname_check == 0 ) {
+ print_warn('Hostname: ');
+ print_warning('not found in /etc/localdomains. This can cause "lowest numbered MX record points to local host"');
+ }
+}
+
+sub check_for_eximstats_newline {
+ my $eximstatspass = '/var/cpanel/eximstatspass';
+ my $has_newline = 0;
+
+ if ( !-e $eximstatspass ) {
+ print_warn("$eximstatspass: ");
+ print_warning('missing!');
+ }
+ else {
+ if ( open my $eximstatspass_fh, '<', $eximstatspass ) {
+ while (<$eximstatspass_fh>) {
+ if (/\n/) {
+ $has_newline = 1;
+ last;
+ }
+ }
+ close $eximstatspass_fh;
+ }
+ }
+
+ if ( $has_newline == 1 ) {
+ print_warn("$eximstatspass: ");
+ print_warning('contains a newline. Breaks Mail Delivery Reports / eximstats');
+ }
+
+}
+
+sub check_for_nfs {
+ my $has_nfs = 0;
+
+ open my $mount_fh, '-|', '/bin/mount' or return;
+ while (<$mount_fh>) {
+ if ( m{ type[ \t]nfs }xms ) {
+ $has_nfs = 1;
+ last;
+ }
+ }
+ close $mount_fh;
+
+ if ( $has_nfs == 1 ) {
+ print_warn('NFS: ');
+ print_warning('filesystem(s) with NFS detected. This can cause cPanel to load slow (see ticket 4380977, FB 79549)');
+ }
+}
+
##############################
# END [WARN] CHECKS
##############################
@@ -5345,6 +5506,23 @@
}
}
+sub check_for_newrelic {
+ my $has_newrelic = 0;
+
+ for my $process (@process_list) {
+ if ( $process =~ /newrelic-daemon/ ) {
+ $has_newrelic = 1;
+ last;
+ }
+ }
+
+ if ( $has_newrelic == 1 ) {
+ print_3rdp('newrelic-daemon: ');
+ print_3rdp2('found in process list. Caused server stability issues in 4396009');
+ }
+
+}
+
##############################
# END [3RDP] CHECKS
##############################
@@ -5393,6 +5571,7 @@
return if !-x '/usr/bin/lsattr';
my @path_dirs = split( m{:}, $ENV{'PATH'} );
+ push @path_dirs, '/usr/local/apache/conf/httpd.conf';
foreach my $file ( grep ( m/^-[-]*(?:a|i)/, split( /\n/, run( 'lsattr', @path_dirs ) ) ) ) {
print_warn('Immutable file: ');