#563 DSCreate.pm: Error messages cannot be used in the if expression since they could be localized.
Closed: Fixed None Opened 7 years ago by nhosoi.

if (($semanage_err =~ /defined in policy, cannot be deleted/) || ($semanage_err =~ /is not defined/)) {

The "defined in policy, cannot be deleted" as well as "is not defined" may not match if the system locale is not English...

For instance,

echo $LANG


Warning: Port 10389 not removed from selinux policy correctly. Error: /usr/sbin/semanage: ポート tcp/10389 は定義されていません
<== this is the Japanese translation of "port tcp/10389 is not defined".

A doc issue...?

Bug description: Error messages from the command line interface
could be localized based upon the users' configuration. But the
script expects English sentence.

Fix description: Set the C locale '$ENV{LANG} = "C"' before running
the command line if the message from the command is examined in
the expression.

Reviewed by Mark (Thank you!!)

Pushed to master: commit 0219577

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.3.1

3 years ago

Login to comment on this ticket.