Mageia Bugzilla – Attachment 4214 Details for
Bug 10810
msec notifications are untranslatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch to fix the bug
localize_notifications.patch (text/plain), 3.09 KB, created by
Yuri Chornoivan
on 2013-07-21 07:35:08 CEST
(
hide
)
Description:
Patch to fix the bug
Filename:
MIME Type:
Creator:
Yuri Chornoivan
Created:
2013-07-21 07:35:08 CEST
Size:
3.09 KB
patch
obsolete
>Index: cron-sh/security.sh >=================================================================== >--- cron-sh/security.sh (revision 8636) >+++ cron-sh/security.sh (working copy) >@@ -4,17 +4,21 @@ > # which should be named NN_script_name.sh, where NN represents > # the order in which they should be executed > >+export TEXTDOMAINDIR=/usr/share/locale >+export TEXTDOMAIN=msec >+. gettext.sh >+ > if [[ -f /etc/security/msec/security.conf ]]; then > # load settings from base level > BASE_LEVEL=$(sed -n 's/BASE_LEVEL=//p' /etc/security/msec/security.conf) > if [[ ! -f /etc/security/msec/level.$BASE_LEVEL ]]; then >- echo "Error: base level $BASE_LEVEL not found" >+ eval_gettext "Error: base level \$BASE_LEVEL not found"; echo > exit 1 > fi > . /etc/security/msec/level.$BASE_LEVEL > . /etc/security/msec/security.conf > else >- echo "/etc/security/msec/security.conf don't exist." >+ eval_gettext "/etc/security/msec/security.conf don't exist."; echo > exit 1 > fi > >@@ -85,7 +89,7 @@ > test -x $script && . $script > ret=$? > if [ $ret -ne 0 ]; then >- echo "MSEC: audit script $script failed" >+ eval_gettext "MSEC: audit script \$script failed"; echo > fi > done > >@@ -120,7 +124,7 @@ > cat ${MSEC_TMP} > ${MAIL_LOG_TODAY} > > Maillog "[msec] *** Security Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${MSEC_TMP}" >- Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Detailed results are available in ${MAIL_LOG_TODAY}" >+ Notifylog "`eval_gettext \"MSEC has performed Security Check on \\\${REPORT_HOSTNAME} on \\\${REPORT_DATE}. Detailed results are available in \\\${MAIL_LOG_TODAY}\"`" > fi > > # diff check >@@ -131,7 +135,7 @@ > echo "$DIFF_PREFIX *** Diff Check, ${REPORT_DATE} ***" >> ${SECURITY_LOG} > cat ${DIFF} | sed -e "s/^/$DIFF_PREFIX/g" >> ${SECURITY_LOG} > >- Notifylog "MSEC has performed Diff Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Changes in system security were detected and are available in ${SECURITY_LOG}." >+ Notifylog "`eval_gettext \"MSEC has performed Diff Check on \\\${REPORT_HOSTNAME} on \\\${REPORT_DATE}. Changes in system security were detected and are available in \\\${SECURITY_LOG}.\"`" > fi > > Maillog "[msec] *** Diff Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${DIFF}" >Index: po/Makefile >=================================================================== >--- po/Makefile (revision 8636) >+++ po/Makefile (working copy) >@@ -11,6 +11,7 @@ > ../src/msec/plugins/pam.py ../src/msec/plugins/network.py \ > ../src/msec/plugins/msec.py ../src/msec/plugins/sectool.py \ > ../src/msec/plugins/sudo.py ../src/msec/plugins/log.py >+SHELL_FILES =../cron-sh/security.sh > # C-like files to search translatable strings in > #CFILES = > >@@ -42,7 +43,8 @@ > make -C ../src/msec help > > $(PGOAL).pot: $(PL_FILES) >- ./pygettext.py -o $(PGOAL).pot $(PL_FILES) >+ ./pygettext.py -k eval_gettext -o $(PGOAL).pot $(PL_FILES) >+ xgettext -L Shell --strict -c -n --omit-header --output - $(SHELL_FILES) >> $(PGOAL).pot > > update_n_merge: $(PGOAL).pot merge >
Index: cron-sh/security.sh =================================================================== --- cron-sh/security.sh (revision 8636) +++ cron-sh/security.sh (working copy) @@ -4,17 +4,21 @@ # which should be named NN_script_name.sh, where NN represents # the order in which they should be executed +export TEXTDOMAINDIR=/usr/share/locale +export TEXTDOMAIN=msec +. gettext.sh + if [[ -f /etc/security/msec/security.conf ]]; then # load settings from base level BASE_LEVEL=$(sed -n 's/BASE_LEVEL=//p' /etc/security/msec/security.conf) if [[ ! -f /etc/security/msec/level.$BASE_LEVEL ]]; then - echo "Error: base level $BASE_LEVEL not found" + eval_gettext "Error: base level \$BASE_LEVEL not found"; echo exit 1 fi . /etc/security/msec/level.$BASE_LEVEL . /etc/security/msec/security.conf else - echo "/etc/security/msec/security.conf don't exist." + eval_gettext "/etc/security/msec/security.conf don't exist."; echo exit 1 fi @@ -85,7 +89,7 @@ test -x $script && . $script ret=$? if [ $ret -ne 0 ]; then - echo "MSEC: audit script $script failed" + eval_gettext "MSEC: audit script \$script failed"; echo fi done @@ -120,7 +124,7 @@ cat ${MSEC_TMP} > ${MAIL_LOG_TODAY} Maillog "[msec] *** Security Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${MSEC_TMP}" - Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Detailed results are available in ${MAIL_LOG_TODAY}" + Notifylog "`eval_gettext \"MSEC has performed Security Check on \\\${REPORT_HOSTNAME} on \\\${REPORT_DATE}. Detailed results are available in \\\${MAIL_LOG_TODAY}\"`" fi # diff check @@ -131,7 +135,7 @@ echo "$DIFF_PREFIX *** Diff Check, ${REPORT_DATE} ***" >> ${SECURITY_LOG} cat ${DIFF} | sed -e "s/^/$DIFF_PREFIX/g" >> ${SECURITY_LOG} - Notifylog "MSEC has performed Diff Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Changes in system security were detected and are available in ${SECURITY_LOG}." + Notifylog "`eval_gettext \"MSEC has performed Diff Check on \\\${REPORT_HOSTNAME} on \\\${REPORT_DATE}. Changes in system security were detected and are available in \\\${SECURITY_LOG}.\"`" fi Maillog "[msec] *** Diff Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${DIFF}" Index: po/Makefile =================================================================== --- po/Makefile (revision 8636) +++ po/Makefile (working copy) @@ -11,6 +11,7 @@ ../src/msec/plugins/pam.py ../src/msec/plugins/network.py \ ../src/msec/plugins/msec.py ../src/msec/plugins/sectool.py \ ../src/msec/plugins/sudo.py ../src/msec/plugins/log.py +SHELL_FILES =../cron-sh/security.sh # C-like files to search translatable strings in #CFILES = @@ -42,7 +43,8 @@ make -C ../src/msec help $(PGOAL).pot: $(PL_FILES) - ./pygettext.py -o $(PGOAL).pot $(PL_FILES) + ./pygettext.py -k eval_gettext -o $(PGOAL).pot $(PL_FILES) + xgettext -L Shell --strict -c -n --omit-header --output - $(SHELL_FILES) >> $(PGOAL).pot update_n_merge: $(PGOAL).pot merge
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10810
: 4214