Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] [sympa-commits] sympa[11077] trunk/src/lib/Sympa/Message.pm: [dev] pass required values as parameters, insted of accessing configuration directly

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: IKEDA Soji <address@concealed>
  • To: Guillaume Rousse <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-developpers] [sympa-commits] sympa[11077] trunk/src/lib/Sympa/Message.pm: [dev] pass required values as parameters, insted of accessing configuration directly
  • Date: Wed, 25 Jun 2014 16:18:19 +0900

Guillaume,

STOP.

--- Soji

On Wed, 25 Jun 2014 08:48:25 +0200 (CEST)
address@concealed wrote:

> sympa[11077] trunk/src/lib/Sympa/Message.pm: [dev] pass required values as
> parameters, insted of accessing configuration directly
> Revision 11077 Author rousse Date 2014-06-25 08:48:25 +0200 (mer. 25 juin
> 2014)
> Log Message[dev] pass required values as parameters, insted of accessing
> configuration directly
> Modified Paths
> trunk/src/lib/Sympa/Message.pm
> Diff
> Modified: trunk/src/lib/Sympa/Message.pm (11076 => 11077)
> --- trunk/src/lib/Sympa/Message.pm 2014-06-25 06:41:54 UTC (rev 11076)
> +++ trunk/src/lib/Sympa/Message.pm 2014-06-25 06:48:25 UTC (rev 11077)
> @@ -1222,19 +1222,38 @@
> return (join("\n\n", @bodysection)); # convert it back as string
> }
>
> -=item $message->encrypt($email)
> +=item $message->encrypt(%parameter)
>
> Encrypts this message for the given recipient, using S/MIME format.
>
> +Parameters:
> +
> +=over
> +
> +=item * I<email>: FIXME
> +
> +=item * I<openssl>: path to openssl binary
> +
> +=item * I<ssl_cert_dir>: path to Sympa certificate/keys directory.
> +
> +=item * I<tmpdir>: path to Sympa temporary directory
> +
> +=back
> +
> =cut
>
> sub encrypt {
> - my ($self, $email) = @_;
> + my ($self, %params) = @_;
> $main::logger->do_log(Sympa::Logger::DEBUG2, '(%s, %s, %s)', @_);
>
> + my $tmpdir = $params{tmpdir};
> + my $openssl = $params{openssl};
> + my $ssl_cert_dir = $params{ssl_cert_dir};
> + my $email = $params{email};
> +
> my $usercert;
>
> - my $base = Sympa::Site->ssl_cert_dir . '/' .
> Sympa::Tools::escape_chars($email);
> + my $base = $ssl_cert_dir . '/' . Sympa::Tools::escape_chars($email);
> if (-f "$base\@enc") {
> $usercert = "$base\@enc";
> } else {
> @@ -1248,11 +1267,11 @@
> return undef;
> }
>
> - my $temporary_file = Sympa::Site->tmpdir . "/" . $email . "." . $PID;
> + my $temporary_file = $tmpdir . "/" . $email . "." . $PID;
>
> ## encrypt the incoming message parse it.
> my $cmd = sprintf '%s smime -encrypt -out %s -des3 %s',
> - Sympa::Site->openssl, $temporary_file, $usercert;
> + $openssl, $temporary_file, $usercert;
> $main::logger->do_log(Sympa::Logger::DEBUG3, '%s', $cmd);
> if (!open(MSGDUMP, "| $cmd")) {
> $main::logger->do_log(Sympa::Logger::INFO,


--
--
株式会社 コンバージョン セキュリティ&OSSソリューション部 池田荘児
〒231-0004 神奈川県横浜市中区元浜町3-21-2 ヘリオス関内ビル7F
e-mail address@concealed TEL 045-640-3550
http://www.conversion.co.jp/


  • Re: [sympa-developpers] [sympa-commits] sympa[11077] trunk/src/lib/Sympa/Message.pm: [dev] pass required values as parameters, insted of accessing configuration directly, IKEDA Soji, 06/25/2014

Archive powered by MHonArc 2.6.19+.

Top of Page