Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
ece39394
Commit
ece39394
authored
May 11, 2021
by
IKEDA Soji
Browse files
Use encode_filesystem_safe() instead of escape_chars() for user certificates
parent
b098e9e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Message.pm
View file @
ece39394
...
...
@@ -1114,9 +1114,9 @@ sub smime_encrypt {
my
$certfile
;
my
$entity
;
my $base =
$Conf::Conf{'ssl_cert_dir'}
. '/'
.
Sympa::Tools::Text::e
scape_chars
($email);
my
$base
=
sprintf
'
%s/%s
',
$
Conf::
Conf
{'
ssl_cert_dir
'}
,
Sympa::Tools::Text::
e
ncode_filesystem_safe
(
$email
);
if
(
-
f
$base
.
'
@enc
')
{
$certfile
=
$base
.
'
@enc
';
}
else
{
...
...
@@ -1350,8 +1350,8 @@ sub check_smime_signature {
# or a pair of single-purpose. save them, as email@addr if combined,
# or as email@addr@sign / email@addr@enc for split certs.
foreach
my
$c
(
keys
%certs
)
{
my $filename =
"
$Conf::Conf{ssl_cert_dir}
/"
.
Sympa::Tools::Text::e
scape_chars
(lc
(
$sender)
)
;
my
$filename
=
sprintf
'
%s/%s
',
$
Conf::
Conf
{
ssl_cert_dir
}
,
Sympa::Tools::Text::
e
ncode_filesystem_safe
(
lc
$sender
);
if
(
$c
ne
'
both
')
{
unlink
$filename
;
# just in case there's an old cert left...
$filename
.=
"
\@
$c
";
...
...
src/lib/Sympa/Upgrade.pm
View file @
ece39394
...
...
@@ -2122,6 +2122,7 @@ sub upgrade {
}
if
(
lower_version
(
$previous_version
,
'
6.2.63b.1
'))
{
$log
->
syslog
('
notice
',
'
Moving bounce information and so on...
');
_process_all_files
(
'
config
',
sub
{
...
...
@@ -2161,6 +2162,25 @@ sub upgrade {
}
}
);
my
$dh
;
if
(
opendir
$dh
,
$
Conf::
Conf
{'
ssl_cert_dir
'})
{
foreach
my
$old
(
readdir
$dh
)
{
next
if
0
==
index
$old
,
'
.
';
my
(
$escaped_email
,
$ext
)
=
(
$old
=~
/\A(.+)(?:(\@\w+)?)\z/
);
my
$new
=
Sympa::Tools::Text::
encode_filesystem_safe
(
_unescape_chars
(
$escaped_email
))
.
(
$ext
//
'');
next
if
$old
eq
$new
;
rename
sprintf
('
%s/%s
',
$
Conf::
Conf
{'
ssl_cert_dir
'},
$old
),
sprintf
('
%s/%s
',
$
Conf::
Conf
{'
ssl_cert_dir
'},
$new
);
}
}
$log
->
syslog
('
notice
',
'
...Done.
');
}
return
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment