Author: fapeeler
Date: Mon Aug 10 14:55:19 2009
New Revision: 802817
URL: http://svn.apache.org/viewvc?rev=802817&view=rev
Log:
VCL-187
Replaced cmdline perl calls to use sed.
Had issue with interupting single quotes
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=802817&r1=802816&r2=802817&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Mon
Aug 10 14:55:19 2009
@@ -211,7 +211,7 @@
}
#Clear user from external_sshd_config
- my $clear_extsshd = "perl -pi -e 's/^AllowUsers .*\n//'
/etc/ssh/external_sshd_config";
+ my $clear_extsshd = "sed -ie \"/^AllowUsers .*/d\"
/etc/ssh/external_sshd_config";
if (run_ssh_command($computer_node_name, $identity, $clear_extsshd,
"root")) {
notify($ERRORS{'DEBUG'}, 0, "cleared AllowUsers directive from
external_sshd_config");
}
@@ -223,7 +223,7 @@
if ($imagemeta_rootaccess) {
#clear user from sudoers file
- my $clear_cmd = "perl -pi -e 's/^$user_name .*\n//'
/etc/sudoers";
+ my $clear_cmd = "sed -ie \"/^$user_name .*/d\" /etc/sudoers";
if (run_ssh_command($computer_node_name, $image_identity,
$clear_cmd, "root")) {
notify($ERRORS{'DEBUG'}, 0, "cleared $user_name from
/etc/sudoers");
}
@@ -281,7 +281,7 @@
if ($imagemeta_rootaccess) {
# Add to sudoers file
#clear user from sudoers file
- my $clear_cmd = "perl -pi -e 's/^$user_name .*\n//'
/etc/sudoers";
+ my $clear_cmd = "sed -ie \"/^$user_name .*/d\" /etc/sudoers";
if (run_ssh_command($computer_node_name, $image_identity,
$clear_cmd, "root")) {
notify($ERRORS{'DEBUG'}, 0, "cleared $user_name from
/etc/sudoers");
}
@@ -314,7 +314,7 @@
notify($ERRORS{'OK'}, 0, "In grant_access routine
$user,$computer_node_name");
my @sshcmd;
- my $clear_extsshd = "perl -pi -e 's/^AllowUsers .*\n//'
/etc/ssh/external_sshd_config";
+ my $clear_extsshd = "sed -ie \"/^AllowUsers .*/d\"
/etc/ssh/external_sshd_config";
if (run_ssh_command($computer_node_name, $identity, $clear_extsshd,
"root")) {
notify($ERRORS{'DEBUG'}, 0, "cleared AllowUsers directive from
external_sshd_config");
}