[pve-devel] r5397 - in pve-cluster/trunk/data: . perl

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jan 19 13:35:23 CET 2011


Author: dietmar
Date: 2011-01-19 13:35:23 +0100 (Wed, 19 Jan 2011)
New Revision: 5397

Modified:
   pve-cluster/trunk/data/ChangeLog
   pve-cluster/trunk/data/perl/Cluster.pm
   pve-cluster/trunk/data/perl/test1.pl
Log:


Modified: pve-cluster/trunk/data/ChangeLog
===================================================================
--- pve-cluster/trunk/data/ChangeLog	2011-01-19 10:50:18 UTC (rev 5396)
+++ pve-cluster/trunk/data/ChangeLog	2011-01-19 12:35:23 UTC (rev 5397)
@@ -1,3 +1,7 @@
+2011-01-19  root  <root at maui.maurer-it.com>
+
+	* perl/Cluster.pm (log_msg): fixes for taint mode (untaint $0)
+
 2010-11-17  Proxmox Support Team  <support at proxmox.com>
 
 	* src/cpg.c (dcdb_main_loop): use CPG_DISPATCH_ONE instead of

Modified: pve-cluster/trunk/data/perl/Cluster.pm
===================================================================
--- pve-cluster/trunk/data/perl/Cluster.pm	2011-01-19 10:50:18 UTC (rev 5396)
+++ pve-cluster/trunk/data/perl/Cluster.pm	2011-01-19 12:35:23 UTC (rev 5397)
@@ -468,9 +468,12 @@
 sub log_msg {
    my ($priority, $ident, $msg) = @_;
 
-   my $tag = $0;
+   die "need numeric log priority" if $priority !~ /^\d+$/;
 
-   $tag =~ s|^.*/||;
+   my $tag = "clusterlog";
+   if ($0 =~ m|^(.*/)?(.+)$|) { # untaint
+       $tag = $2;
+   }
 
    $msg = "empty message" if !$msg;
 

Modified: pve-cluster/trunk/data/perl/test1.pl
===================================================================
--- pve-cluster/trunk/data/perl/test1.pl	2011-01-19 10:50:18 UTC (rev 5396)
+++ pve-cluster/trunk/data/perl/test1.pl	2011-01-19 12:35:23 UTC (rev 5397)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -w -T
 
 use strict;
 
@@ -7,8 +7,10 @@
 use Data::Dumper;
 
 my $nodename = PVE::INotify::nodename();
-#PVE::Cluster::log_msg(1, "ident2", "msg1 öäü");
-#print PVE::Cluster::get_cluster_log(undef, 0);
+PVE::Cluster::log_msg(1, "ident2", "msg1 öäü");
+print PVE::Cluster::get_cluster_log(undef, 0);
+exit 0;
+
 #print PVE::Cluster::get_system_log(undef, 0);
 
 PVE::Cluster::cfs_update();



More information about the pve-devel mailing list