Tue Nov 7 08:08:20 PST 2006
- Previous message: [Slony1-commit] By cbbrowne: Add sh-based config scripts to 1.2 branch
- Next message: [Slony1-commit] By cbbrowne: Replace "print SLONIK" (which had a /tmp file security
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Replace "print SLONIK" (which had a /tmp file security exploit) with
"$slonik .= ..."
Tags:
----
REL_1_2_STABLE
Modified Files:
--------------
slony1-engine/tools/altperl:
slonik_init_cluster.pl (r1.1.4.3 -> r1.1.4.4)
-------------- next part --------------
Index: slonik_init_cluster.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slonik_init_cluster.pl,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -Ltools/altperl/slonik_init_cluster.pl -Ltools/altperl/slonik_init_cluster.pl -u -w -r1.1.4.3 -r1.1.4.4
--- tools/altperl/slonik_init_cluster.pl
+++ tools/altperl/slonik_init_cluster.pl
@@ -30,29 +30,26 @@
require '@@PGLIBDIR@@/slon-tools.pm';
require $CONFIG_FILE;
-my $FILE="/tmp/init-cluster.$$";
-
# INIT CLUSTER
-open(SLONIK, ">", $FILE);
-print SLONIK "\n# INIT CLUSTER\n";
-print SLONIK genheader();
+$slonik .= "\n# INIT CLUSTER\n";
+$slonik .= genheader();
my ($dbname, $dbhost) = ($DBNAME[$MASTERNODE], $HOST[$MASTERNODE]);
-print SLONIK " init cluster (id = $MASTERNODE, comment = 'Node $MASTERNODE - $dbname\@$dbhost');\n";
+$slonik .= " init cluster (id = $MASTERNODE, comment = 'Node $MASTERNODE - $dbname\@$dbhost');\n";
# STORE NODE
-print SLONIK "\n# STORE NODE\n";
+$slonik .= "\n# STORE NODE\n";
foreach my $node (@NODES) {
if ($node != $MASTERNODE) { # skip the master node; it's already initialized!
my ($dbname, $dbhost) = ($DBNAME[$node], $HOST[$node]);
- print SLONIK " store node (id = $node, event node = $MASTERNODE, comment = 'Node $node - $dbname\@$dbhost');\n";
+ $slonik .= " store node (id = $node, event node = $MASTERNODE, comment = 'Node $node - $dbname\@$dbhost');\n";
}
}
-print SLONIK " echo 'Set up replication nodes';\n";
+$slonik .= " echo 'Set up replication nodes';\n";
# STORE PATH
-print SLONIK "\n# STORE PATH\n";
+$slonik .= "\n# STORE PATH\n";
-print SLONIK " echo 'Next: configure paths for each node/origin';\n";
+$slonik .= " echo 'Next: configure paths for each node/origin';\n";
foreach my $nodea (@NODES) {
my $dsna = $DSN[$nodea];
foreach my $nodeb (@NODES) {
@@ -72,7 +69,6 @@
}
}
-print SLONIK " echo 'Replication nodes prepared';\n";
-print SLONIK " echo 'Please start a slon replication daemon for each node';\n";
-close SLONIK;
-run_slonik_script($FILE);
+$slonik .= " echo 'Replication nodes prepared';\n";
+$slonik .= " echo 'Please start a slon replication daemon for each node';\n";
+run_slonik_script($slonik, 'INIT CLUSTER');
- Previous message: [Slony1-commit] By cbbrowne: Add sh-based config scripts to 1.2 branch
- Next message: [Slony1-commit] By cbbrowne: Replace "print SLONIK" (which had a /tmp file security
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list