summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-17 16:30:54 +0000
committerDerek Jennings <djennings@mageia.org>2013-08-27 11:32:51 +0100
commit6b4b5e10b41627dd46b447c723769f7c676d0314 (patch)
tree64107cba0c5a5674771921f4de00d55235e0ab7d
parented3dc21167e6e331c1370b96463cc876c917bb0b (diff)
downloaddrakwizard-6b4b5e10b41627dd46b447c723769f7c676d0314.tar
drakwizard-6b4b5e10b41627dd46b447c723769f7c676d0314.tar.gz
drakwizard-6b4b5e10b41627dd46b447c723769f7c676d0314.tar.bz2
drakwizard-6b4b5e10b41627dd46b447c723769f7c676d0314.tar.xz
drakwizard-6b4b5e10b41627dd46b447c723769f7c676d0314.zip
perl_checker cleanups
-rwxr-xr-xsshd_wizard/Sshd.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/sshd_wizard/Sshd.pm b/sshd_wizard/Sshd.pm
index c232bc43..2e5dec32 100755
--- a/sshd_wizard/Sshd.pm
+++ b/sshd_wizard/Sshd.pm
@@ -32,7 +32,6 @@ use Libconf::Glueconf::Networking::Sshd_config;
my $wiz = new MDK::Wizard::Wizcommon;
my $in = interactive->vnew;
my $conf = "/etc/ssh/sshd_config";
-my $DOMAINNAME = chomp_(`dnsdomainname`);
#my $SHORTHOSTNAME = chomp_(`hostname -s`);
# we ask glueconf to give us the structure representing /etc/ssh/sshd_config
@@ -90,7 +89,10 @@ $o->{pages} = {
{ label => N("Port number:"), val => \$o->{var}{Port}, help => N("Specifies the port number that sshd listens on. The default is 22.") },
],
complete => sub {
- if ($o->{var}{Port} !~ /^\d+$/) { $::in->ask_warn(N("Error"), N("Port should be a number")); return 1; }
+ if ($o->{var}{Port} !~ /^\d+$/) {
+ $::in->ask_warn(N("Error"), N("Port should be a number"));
+ return 1;
+ }
},
post => sub {
if ($o->{var}{wiz_type} == 2) {
@@ -147,12 +149,15 @@ $o->{pages} = {
{ label => N("Print last log:"), val => \$o->{var}{PrintLastLog}, list_ref => \@yesorno },
],
complete => sub {
- if ($o->{var}{LoginGraceTime} !~ /^\d+$/ and $o->{var}{LoginGraceTime}) { $::in->ask_warn(N("Error"), N("Login grace time should be a number")); return 1; }
+ if ($o->{var}{LoginGraceTime} !~ /^\d+$/ && $o->{var}{LoginGraceTime}) {
+ $::in->ask_warn(N("Error"), N("Login grace time should be a number"));
+ return 1;
+ }
},
next => 'user_login',
},
user_login => {
- name => N("User Login options") . "\n\n" . N("Strict modes: specifies whether sshd should check file modes and ownership of the user\'s files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable"),
+ name => N("User Login options") . "\n\n" . N("Strict modes: specifies whether sshd should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable"),
pre => sub {
$o->{var}{StrictModes} ||= $sshd->{StrictModes};
$o->{var}{AllowUsers} ||= $sshd->{AllowUsers};
@@ -202,15 +207,17 @@ $o->{pages} = {
};
sub new {
- my ($class, $conf) = @_;
+ my ($class) = @_;
bless $o, $class;
}
sub write_conf_restart_ssh {
$sshd->write_conf($conf);
if (services::is_service_running('sshd')) {
- services::restart('sshd')
- } else { services::start('sshd') }
+ services::restart('sshd');
+ } else {
+ services::start('sshd');
+ }
}
sub global_config {