Skip to content

Commit

Permalink
Fixed: In case the passphrase is missing, user must not be prompted t…
Browse files Browse the repository at this point in the history
…o enter it (iMSCP::OpenSSL)

Fixed: Missing EOL in SSL certificate containers (iMSCP::OpenSSL)
CS fixes
  • Loading branch information
nuxwin committed Jun 14, 2014
1 parent 478b6f5 commit 5cff46d
Show file tree
Hide file tree
Showing 17 changed files with 217 additions and 213 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Expand Up @@ -11,7 +11,9 @@ DISTROS
ENGINE:
Changed: Dovecot SASL implementation is no longer used in Postfix (Replaced by Cyrus SASL)
Changed: SASL authentication is now made against database directly (Postfix)
Fixed: Quota script must ignore maildir which doesn't exist + small fixes
Fixed: In case the passphrase is missing, user must not be prompted to enter it (iMSCP::OpenSSL)
Fixed: Missing EOL in SSL certificate containers (iMSCP::OpenSSL)
Fixed: Quota script must ignore maildir which doesn't exist

INSTALLER
Fixed: Bind9 cannot start if the resolvconf package is not configured yet (Debian Squeeze)
Expand Down
58 changes: 29 additions & 29 deletions autoinstaller/Common.pm
Expand Up @@ -23,12 +23,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# @category i-MSCP
# @copyright 2010-2014 by i-MSCP | http://i-mscp.net
# @author Daniel Andreca <sci2tech@gmail.com>
# @author Laurent Declercq <l.declercq@nuxwin.com>
# @link http://i-mscp.net i-MSCP Home Site
# @license http://www.gnu.org/licenses/gpl-2.0.html GPL v2
# @category i-MSCP
# @copyright 2010-2014 by i-MSCP | http://i-mscp.net
# @author Daniel Andreca <sci2tech@gmail.com>
# @author Laurent Declercq <l.declercq@nuxwin.com>
# @link http://i-mscp.net i-MSCP Home Site
# @license http://www.gnu.org/licenses/gpl-2.0.html GPL v2

package autoinstaller::Common;

Expand Down Expand Up @@ -69,7 +69,7 @@ our @EXPORT = qw(
together in the %main::imscpConfig variable. The old imscp.conf file is tied to the %main::imscpOldConfig variable
and set as readonly.
Return int - 0
Return int 0
=cut

Expand Down Expand Up @@ -115,7 +115,7 @@ sub loadConfig
Trigger pre-required package installation from distro autoinstaller adapter.
Return int - 0 on success, other otherwise
Return int 0 on success, other otherwise
=cut

Expand All @@ -128,7 +128,7 @@ sub installPreRequiredPackages
Check distribution.
Return int - 0 on success, 1 on failure
Return int 0 on success, 1 on failure
=cut

Expand Down Expand Up @@ -202,7 +202,7 @@ Thanks for using i-MSCP.
Trigger pre-build tasks from distro autoinstaller adapter.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand All @@ -215,7 +215,7 @@ sub preBuild
Trigger packages uninstallation from distro autoinstaller adapter.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand All @@ -241,7 +241,7 @@ sub installPackages
Test for i-MSCP requirements.
Return int 0 - On error, a fatal error is raised
Return int 0 on error, a fatal error is raised
=cut

Expand Down Expand Up @@ -269,7 +269,7 @@ sub processDistroLayoutFile()
Process distribution install.xml files.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -314,7 +314,7 @@ sub processDistroInstallFiles
Build i-MSCP daemon
Return int - 0 on success, other on failure.
Return int 0 on success, other on failure.
=cut

Expand Down Expand Up @@ -358,7 +358,7 @@ sub buildImscpDaemon
Install engine files in build directory.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -395,7 +395,7 @@ sub installEngine
Install GUI files in build directory.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut
sub installGui
Expand All @@ -414,7 +414,7 @@ sub installGui
Trigger post-build tasks from distro autoinstaller adapter and save i-MSCP main configuration file.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -464,7 +464,7 @@ sub postBuild
Backup current i-MSCP installation (database and conffiles) if any.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -499,7 +499,7 @@ Do you want to continue?
Save persistent data in build directory.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -602,7 +602,7 @@ sub savePersistentData
Install files from build directory on file system.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -647,7 +647,7 @@ sub installTmp
Delete build directory.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand All @@ -669,7 +669,7 @@ sub removeTmp
Check availability of the given command.
Return int - 0 if the given command is available, 1 othewise
Return int 0 if the given command is available, 1 othewise
=cut

Expand All @@ -695,7 +695,7 @@ sub checkCommandAvailability($)
Process an install.xml file or distribution layout.xml file.
Return int - 0 on success, other on failure ; A fatal error is raised in case a variable cannot be exported
Return int 0 on success, other on failure ; A fatal error is raised in case a variable cannot be exported
=cut

Expand Down Expand Up @@ -806,7 +806,7 @@ sub _expandVars
Process the xml 'folder' node by creating the described directory.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -838,7 +838,7 @@ sub _processFolder
Process a 'copy_config' node from an install.xml file.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -893,7 +893,7 @@ sub _copyConfig
Process the 'copy' node from an install.xml file.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down Expand Up @@ -933,7 +933,7 @@ sub _copy
Create a file.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand All @@ -948,7 +948,7 @@ sub _createFile
Change file/directory owner and/or group recursively.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand All @@ -974,7 +974,7 @@ sub _chownFile
Process chmod_file from an install.xml file.
Return int - 0 on success, other on failure
Return int 0 on success, other on failure
=cut

Expand Down
Expand Up @@ -17,35 +17,70 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# @category i-MSCP
# @copyright 2010-2014 by i-MSCP | http://i-mscp.net
# @author Daniel Andreca <sci2tech@gmail.com>
# @link http://i-mscp.net i-MSCP Home Site
# @license http://www.gnu.org/licenses/gpl-2.0.html GPL v2
# @category i-MSCP
# @copyright 2010-2014 by i-MSCP | http://i-mscp.net
# @author Laurent Declercq <l.declercq@nuxwin.com>
# @link http://i-mscp.net i-MSCP Home Site
# @license http://www.gnu.org/licenses/gpl-2.0.html GPL v2

package Common::SimpleClass;
package Common::Object;

use strict;
use warnings;

=head1 DESCRIPTION
Object base class.
=head1 PUBLIC METHODS
=over 4
=item new([%args])
Constructor
Param hash|hash_ref OPTIONAL hash representing class attributes
Return Common::Object
=cut

sub new
{
my $proto = shift;
my $class = ref $proto || $proto;
my $self = {
'errors' => [],
'args' => {@_} || {}
};

bless($self, $class);
my $class = shift;

my $self = bless { @_ && ref $_[0] eq 'HASH' ? %{$_[0]} : @_ }, $class;

$self->_init();

$self;
}

=back
=head1 PRIVATE METHODS
=over 4
=item _init()
Initialize instance
Return Common::Object
=cut

sub _init
{
$_[0];
}

=back
=head1 AUTHOR
Laurent Declercq <l.declercq@nuxwin.com>
=cut

1;
2 changes: 1 addition & 1 deletion engine/PerlLib/Modules/Abstract.pm
Expand Up @@ -38,7 +38,7 @@ use warnings;
use iMSCP::Debug;
use iMSCP::Servers;
use iMSCP::Addons;
use parent 'Common::SimpleClass';
use parent 'Common::Object';

=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion engine/PerlLib/Modules/NetCard.pm
Expand Up @@ -30,7 +30,7 @@ use warnings;

use iMSCP::Debug;
use iMSCP::Execute;
use parent 'Common::SimpleClass';
use parent 'Common::Object';

sub process
{
Expand Down
12 changes: 6 additions & 6 deletions engine/PerlLib/Modules/Plugin.pm
Expand Up @@ -42,7 +42,7 @@ use iMSCP::HooksManager;
use iMSCP::File;
use version;
use JSON;
use parent 'Common::SimpleClass';
use parent 'Common::Object';

# Map action status to next status
my %actionStatusToNextStatus = (
Expand Down Expand Up @@ -113,7 +113,7 @@ sub process($$)
$rs ? (scalar getMessageByType('error') || 'unknown error') : $actionStatusToNextStatus{$status},
$pluginId
);
my $rdata = $self->{'_db'}->doQuery('dummy', @sql);
my $rdata = $self->{'db'}->doQuery('dummy', @sql);
unless(ref $rdata eq 'HASH') {
error($rdata);
return 1;
Expand Down Expand Up @@ -141,7 +141,7 @@ sub _init
my $self = $_[0];

$self->{'hooksManager'} = iMSCP::HooksManager->getInstance();
$self->{'_db'} = iMSCP::Database->factory();
$self->{'db'} = iMSCP::Database->factory();

$self;
}
Expand All @@ -159,7 +159,7 @@ sub _loadData($$)
{
my ($self, $pluginId) = @_;

my $rdata = $self->{'_db'}->doQuery(
my $rdata = $self->{'db'}->doQuery(
'plugin_id',
'SELECT plugin_id, plugin_name, plugin_info, plugin_status FROM plugin WHERE plugin_id = ?',
$pluginId
Expand Down Expand Up @@ -291,7 +291,7 @@ sub _change($$)
if($info->{'__need_change__'}) {
$info->{'__need_change__'} = JSON::false;

$rs = $self->{'_db'}->doQuery(
$rs = $self->{'db'}->doQuery(
'dummy', 'UPDATE plugin SET plugin_info = ? WHERE plugin_name = ?', encode_json($info), $pluginName
);
unless(ref $rs eq 'HASH') {
Expand Down Expand Up @@ -334,7 +334,7 @@ sub _update($$)
$info->{'version'} = $info->{'__nversion__'};
$info->{'__need_change__'} = JSON::false;

$rs = $self->{'_db'}->doQuery(
$rs = $self->{'db'}->doQuery(
'dummy', 'UPDATE plugin SET plugin_info = ? WHERE plugin_name = ?', encode_json($info), $pluginName
);
unless(ref $rs eq 'HASH') {
Expand Down

0 comments on commit 5cff46d

Please sign in to comment.