Skip to content

Commit

Permalink
bnc#757132 - Puzzle-String in ldap-server module
Browse files Browse the repository at this point in the history
  • Loading branch information
varkoly committed Feb 28, 2013
1 parent 71218a7 commit 4c04b56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/LdapDatabase.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@
{
map<string, string> err = LdapServer::ReadError();
boolean res = Popup::AnyQuestion(Label::WarningMsg(),
_("The Base Object: \"") + db["suffix"]:"" +
_("\" can not be auto created by YaST.\n") +
sformat(_("The Base Object: \"%1\" can not be auto created by YaST.\n"), db["suffix"]:"") +
err["msg"]:"",
Label::OKButton(), Label::CancelButton(), `focus);
if ( res == false ) {
Expand Down
21 changes: 10 additions & 11 deletions src/LdapServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ sub WriteTlsConfig
{
$self->SetError(_("Can not set a filesystem ACL on the private key."),
"setfacl -m u:ldap:r ".$tls->{'certKeyFile'}." failed.\n".
"Do you have filesystem acl support disabled?" );
_("Do you have filesystem acl support disabled?") );
return 0;
}
}
Expand Down Expand Up @@ -2555,7 +2555,7 @@ sub CheckSuffixAutoCreate
if(!defined $attr[0] || !defined $val)
{
y2error("Error while extracting RDN values");
$self->SetError( _("Invalid LDAP DN: \""). $suffix. _("\", cannot extract RDN values"));
$self->SetError( sprintf(_("Invalid LDAP DN: \"%s\", cannot extract RDN values"),$suffix), "");
return -1;
}
if( (lc($attr[0]) eq "ou") || ( lc($attr[0]) eq "o") || ( lc($attr[0]) eq "l") ||
Expand All @@ -2582,12 +2582,12 @@ sub CheckDatabase
y2milestone("CheckDatabase");
my $suffix_object = X500::DN->ParseRFC2253($db->{'suffix'});
if(! defined $suffix_object) {
$self->SetError( _("Base DN") ." \"". $db->{'suffix'} ."\" ". _("is not a valid LDAP DN."), "");
$self->SetError( sprintf(_("Base DN \"%s\" is not a valid LDAP DN."),$db->{'suffix'}), "");
return 0;
}
elsif ( $suffix_object->hasMultivaluedRDNs() )
{
$self->SetError( _("Base DN") ." \"". $db->{'suffix'} ."\" ". _("has multivalued RDNs (not supported by YaST)."), "");
$self->SetError( sprintf(_("Base DN \"%s\" has multivalued RDNs (not supported by YaST)."),$db->{'suffix'}), "");
return 0;
}

Expand All @@ -2596,13 +2596,12 @@ sub CheckDatabase
{
my $object = X500::DN->ParseRFC2253($db->{'rootdn'});
if(! defined $object) {
$self->SetError(_("Root DN"). " \"". $db->{'rootdn'} ."\" ". _("is not a valid LDAP DN."), "");
$self->SetError( sprintf(_("Root DN \"%s\" is not a valid LDAP DN."),$db->{'rootdn'}), "");
return 0;
}
elsif ( $object->hasMultivaluedRDNs() )
{
$self->SetError(_("Root DN"). " \"". $db->{'rootdn'} ."\" ".
_("has multivalued RDNs (not supported by YaST)."), "");
$self->SetError( sprintf(_("Root DN \"%s\" has multivalued RDNs (not supported by YaST)."),$db->{'rootdn'}), "");
return 0;
}

Expand Down Expand Up @@ -3403,7 +3402,7 @@ sub VerifyTlsSetup
y2milestone("TlsConfig ". Data::Dumper->Dump([$tls]) );
if ( SCR->Read(".target.size", $tls->{"caCertFile"}) <= 0)
{
$self->SetError( _("CA Certificate File: \"") . $tls->{"caCertFile"}. _("\" does not exist."), "");
$self->SetError( sprintf(_("CA Certificate File: \"%s\" does not exist."),$tls->{"caCertFile"}), "");
return 0;
}
else
Expand All @@ -3414,20 +3413,20 @@ sub VerifyTlsSetup
if ( $rc->{'exit'} != 0 )
{
$self->SetError( _("Error while trying to verify the server certificate of the provider server.\n").
_("Please make sure that \"".$tls->{"caCertFile"}."\" contains the correct\nCA file to verify the remote Server Certificate."),
sprintf(_("Please make sure that \"%s\" contains the correct\nCA file to verify the remote Server Certificate."),$tls->{"caCertFile"}),
$rc->{'stderr'} );
return 0;
}
}

if ( SCR->Read(".target.size", $tls->{"certFile"}) <= 0)
{
$self->SetError( _("Certificate File: \""). $tls->{"certFile"}. _(\" does not exist."), "" );
$self->SetError( sprintf(_("Certificate File: \"%s\" does not exist."),$tls->{"certFile"}), "" );
return 0;
}
if ( SCR->Read(".target.size", $tls->{"certKeyFile"}) <= 0)
{
$self->SetError( _("Certificate Key File: \""). $tls->{"certKeyFile"} . _("\" does not exist."), "");
$self->SetError( sprintf(_("Certificate Key File: \"%s\" does not exist."),$tls->{"certKeyFile"}), "" );
return 0;
}
return 1;
Expand Down

0 comments on commit 4c04b56

Please sign in to comment.