36 |
+# |
+# |
37 |
+#)); |
+#)); |
38 |
+ |
+ |
39 |
|
diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/db/configuration/migrate/80cacti smeserver-cacti-1.1.19/root/etc/e-smith/db/configuration/migrate/80cacti |
40 |
|
--- smeserver-cacti-1.1.19.old/root/etc/e-smith/db/configuration/migrate/80cacti 1969-12-31 19:00:00.000000000 -0500 |
41 |
|
+++ smeserver-cacti-1.1.19/root/etc/e-smith/db/configuration/migrate/80cacti 2022-07-26 00:51:52.311000000 -0400 |
42 |
|
@@ -0,0 +1,45 @@ |
43 |
|
+{ |
44 |
|
+ use MIME::Base64 qw(encode_base64); |
45 |
|
+ |
46 |
|
+ my $service; |
47 |
|
+ my $rec; |
48 |
|
+ my $pw; |
49 |
|
+ |
50 |
|
+ # Store the cacti password in the configuration database (if not already there) |
51 |
|
+ $service = 'cacti'; |
52 |
|
+ |
53 |
|
+ $rec = $DB->get($service) || $DB->new_record($service, {type => 'service'}); |
54 |
|
+ |
55 |
|
+ $pw = $rec->prop('DbPassword'); |
56 |
|
+ |
57 |
|
+ |
58 |
|
+ if (! $pw) |
59 |
|
+ { |
60 |
|
+ |
61 |
|
+ if ( open( RANDOM, "/dev/urandom" ) ) |
62 |
|
+ { |
63 |
|
+ my $buf; |
64 |
|
+ # 57 bytes is a full line of Base64 coding, and contains |
65 |
|
+ # 456 bits of randomness - given a perfectly random /dev/random |
66 |
|
+ if ( read( RANDOM, $buf, 57 ) != 57 ) |
67 |
|
+ { |
68 |
|
+ warn("Short read from /dev/random: $!"); |
69 |
|
+ } |
70 |
|
+ else |
71 |
|
+ { |
72 |
|
+ $pw = encode_base64($buf); |
73 |
|
+ chomp $pw; |
74 |
|
+ } |
75 |
|
+ close RANDOM; |
76 |
|
+ } |
77 |
|
+ else |
78 |
|
+ { |
79 |
|
+ warn "Could not open /dev/urandom: $!"; |
80 |
|
+ } |
81 |
|
+ |
82 |
|
+ $rec->set_prop('DbPassword', $pw); |
83 |
|
+ } |
84 |
|
+ |
85 |
|
+ |
86 |
|
+ |
87 |
|
+} |
88 |
diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti |
diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti |
89 |
--- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti 2019-12-11 14:46:28.000000000 -0500 |
--- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti 2019-12-11 14:46:28.000000000 -0500 |
90 |
+++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti 2022-07-26 00:29:43.464000000 -0400 |
+++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti 2022-07-26 00:48:18.028000000 -0400 |
91 |
@@ -3,7 +3,7 @@ |
@@ -1,9 +1,9 @@ |
92 |
|
{ |
93 |
|
- my $db = $cacti{DbName} || 'cacti_sme'; |
94 |
|
+ my $db = $cacti{DbDatabase} || 'cacti_sme'; |
95 |
my $user = $cacti{DbUser} || 'cacti'; |
my $user = $cacti{DbUser} || 'cacti'; |
96 |
my $pass = $cacti{DbPassword} || 'changeme'; |
my $pass = $cacti{DbPassword} || 'changeme'; |
97 |
$OUT .= <<END |
$OUT .= <<END |
100 |
if [ -d /var/lib/mysql/$db ]; then |
if [ -d /var/lib/mysql/$db ]; then |
101 |
exit |
exit |
102 |
fi |
fi |
103 |
@@ -19,4 +19,4 @@ |
@@ -13,10 +13,10 @@ |
104 |
|
use mysql; |
105 |
|
GRANT ALL PRIVILEGES ON $db.* TO $user\@localhost |
106 |
|
IDENTIFIED BY '$pass'; |
107 |
|
- GRANT SELECT ON `mysql`.`time_zone_name` TO '$user'@'localhost'; |
108 |
|
+ GRANT SELECT ON mysql.time_zone_name TO '$user'@'localhost'; |
109 |
|
flush privileges; |
110 |
|
EOF |
111 |
/usr/bin/mysql_tzinfo_to_sql /usr/share/zoneinfo/ 2>/dev/null |/usr/bin/mysql mysql |
/usr/bin/mysql_tzinfo_to_sql /usr/share/zoneinfo/ 2>/dev/null |/usr/bin/mysql mysql |
112 |
/usr/bin/mysql $db < /etc/e-smith/db/configuration/migrate/80cacti_sme.sql |
/usr/bin/mysql $db < /etc/e-smith/db/configuration/migrate/80cacti_sme.sql |
113 |
END |
END |
229 |
+ |
+ |
230 |
+ |
+ |
231 |
+ |
+ |
232 |
|
diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates.metadata/etc/cacti/db.php smeserver-cacti-1.1.19/root/etc/e-smith/templates.metadata/etc/cacti/db.php |
233 |
|
--- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates.metadata/etc/cacti/db.php 2014-06-16 11:53:01.000000000 -0400 |
234 |
|
+++ smeserver-cacti-1.1.19/root/etc/e-smith/templates.metadata/etc/cacti/db.php 2022-07-26 00:44:20.988000000 -0400 |
235 |
|
@@ -1,3 +1,3 @@ |
236 |
|
-UID="cacti" |
237 |
|
+UID="root" |
238 |
|
GID="www" |
239 |
|
PERMS=0640 |