generated crontab does not work in Japanese locale

Bug #943713 reported by Nobuto Murata
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ClamTk
Fix Released
Undecided
Unassigned
clamtk (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

In Japanese locale, `date +'%b' contains a blank space, which breaks "--log" option for clamscan in crontab.

==========
$ crontab -l
0 1 * * * /usr/bin/clamscan --exclude-dir=.thunderbird --exclude-dir=.mozilla-thunderbird --exclude-dir=.evolution --exclude-dir=Mail --exclude-dir=kmail --detect-pua -i -r /home/ubuntu --exclude-dir=/home/ubuntu/.clamtk/viruses --log=$HOME/.clamtk/history/$(date +\%b-\%d-\%Y).log 2>/dev/null # clamtk-scan
==========

==========
$ locale | grep LC_TIME
LC_TIME="ja_JP.UTF-8"

$ /usr/bin/clamscan --exclude-dir=.thunderbird --exclude-dir=.mozilla-thunderbird --exclude-dir=.evolution --exclude-dir=Mail --exclude-dir=kmail --detect-pua -i -r /home/ubuntu --exclude-dir=/home/ubuntu/.clamtk/viruses --log=$HOME/.clamtk/history/$(date +\%b-\%d-\%Y).log
ERROR: Problem with internal logger.
ERROR: Can't open /home/ubuntu/.clamtk/history/ in append mode (check permissions!).
==========

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: clamtk 4.36-1
ProcVersionSignature: Ubuntu 3.2.0-17.27-generic-pae 3.2.6
Uname: Linux 3.2.0-17-generic-pae i686
ApportVersion: 1.93-0ubuntu2
Architecture: i386
CasperVersion: 1.304
Date: Thu Mar 1 00:38:46 2012
LiveMediaBuild: Ubuntu 12.04 LTS "Precise Pangolin" - Beta i386 (20120228.1)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=ja_JP.UTF-8
 SHELL=/bin/bash
SourcePackage: clamtk
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Nobuto Murata (nobuto) wrote :
Nobuto Murata (nobuto)
Changed in clamtk:
assignee: nobody → Nobuto MURATA (nobuto)
status: New → In Progress
Revision history for this message
Nobuto Murata (nobuto) wrote :

Attached patch adds a quotation for "--log" option, this will fix the issue.

==========
$ crontab -l
0 1 * * * /usr/bin/clamscan --exclude-dir=.thunderbird --exclude-dir=.mozilla-thunderbird --exclude-dir=.evolution --exclude-dir=Mail --exclude-dir=kmail --detect-pua -i -r /home/ubuntu --exclude-dir=/home/ubuntu/.clamtk/viruses --log="$HOME/.clamtk/history/$(date +\%b-\%d-\%Y).log" 2>/dev/null # clamtk-scan
==========

==========
$ /usr/bin/clamscan --exclude-dir=.thunderbird --exclude-dir=.mozilla-thunderbird --exclude-dir=.evolution --exclude-dir=Mail --exclude-dir=kmail --detect-pua -i -r /home/ubuntu --exclude-dir=/home/ubuntu/.clamtk/viruses --log="$HOME/.clamtk/history/$(date +\%b-\%d-\%Y).log"
----------- SCAN SUMMARY -----------
Known viruses: 1153191
Engine version: 0.97.3
Scanned directories: 107
Scanned files: 119
Infected files: 0
Data scanned: 13.89 MB
Data read: 42.04 MB (ratio 0.33:1)
Time: 4.400 sec (0 m 4 s)
==========

Changed in clamtk:
assignee: Nobuto MURATA (nobuto) → nobody
status: In Progress → New
Changed in clamtk (Ubuntu):
assignee: nobody → Nobuto MURATA (nobuto)
status: New → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "clamtk-4.37.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Nobuto Murata (nobuto) wrote :

Attached patch or how about using `date +%F`(e.g. 2012-03-01). It's a locale-independent value.

Revision history for this message
Nobuto Murata (nobuto) wrote :

debdiff for Ubuntu precise 4.36-1.

Changed in clamtk (Ubuntu):
assignee: Nobuto MURATA (nobuto) → nobody
status: In Progress → New
Revision history for this message
Dave M (dave-nerd) wrote :

Nobuto,

Thank you for reporting this. I'll test the quotes method in a variety of locales to ensure there are no issues. Assuming all goes well, we'll include this in version 4.38 and have it out shortly.

Dave M

Revision history for this message
Dave M (dave-nerd) wrote :

Nobuto,

Please test this version:

http://clamtk.sf.net/test/clamtk-4.38.tar.gz

From a terminal window, type:
tar xf clamtk-4.38.tar.gz
cd clamtk-4.38
perl clamtk

It's set to run from the current directory - won't install anything.

Thanks,
Dave M

Changed in clamtk (Ubuntu):
assignee: nobody → Fabrice Coutadeur (fabricesp)
status: New → In Progress
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Uploaded to Precise: thank you very much for your work!

Just remember to run update-maintainer when submitting a debdiff to update the maintainer to Ubuntu devel (to be honest, I would forget too it debuild wouldn't give me an error :-) ).

thanks again,
Fabrice

Changed in clamtk (Ubuntu):
assignee: Fabrice Coutadeur (fabricesp) → nobody
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package clamtk - 4.36-1ubuntu1

---------------
clamtk (4.36-1ubuntu1) precise; urgency=low

  * debian/patches/01_add-quotation.patch: added
    - add quotation to date string because translated string may
      include blank spaces(e.g Japanese), LP: #943713
 -- Nobuto MURATA <email address hidden> Thu, 01 Mar 2012 13:49:29 +0900

Changed in clamtk (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Nobuto Murata (nobuto) wrote :

@Dave M

I tried clamtk 4.38 below and it seems to work fine. Thanks!
http://clamtk.sf.net/test/clamtk-4.38.tar.gz

Revision history for this message
Nobuto Murata (nobuto) wrote :

This issue was fixed in Upstream clamtk 4.38.

Here is the information from CHANGES file.
----------

4.38 - Mar 22 2012
------------------
 * New icon for use (Launchpad #637940).
   Thanks, Skyler!
 * Fix for crontab (Launchpad #943713). Thanks, Nobuto!
   Note that you may have to delete and re-add
   your scheduled scan if this problem affected you.
 * Improvement for scanning from commandline
   (Debian #659968, Launchpad #937084). Thanks, Michael!
 * Improve program name in AboutDialog.
 * Updated Uyghur (ug) language file. Thanks, Sahran!
 * Updated Hebrew (he) language file. Thanks, Yaron!
 * Updated Chinese traditional (zh_TW) language file. Thanks, Pin-hsien Li!
 * Updated French (fr) language file. Thanks, Nicolas!
 * Updated English (en_GB) language file. Thanks, Vibhav!
 * Updated Galician (gl) language file. Thanks, Marcos Lans
 - Ciberirmandade!
 * Updated Asturian (ast) language file. Thanks, Xuacu!
 * Updated Spanish (es) language file. Thanks, Fitoschido!
 * Updated Russian (ru) language file. Thanks, Oleg!
 * Updated Italian (it) language file. Thanks, Valter!
 * Updated Malay (ms) language file. Thanks, abuyop!
 * Updated German (de) language file. Thanks, Daniel!
 * Updated Korean (ko) language file. Thanks, MinSik!
 * Updated Ukrainian (uk) language file. Thanks, Yuri!
 * Updated Czech (cs) language file. Thanks, Martin, Martin, and Zbyněk!
 * Updated Polish (pl) language file. Thanks, Łukasz!
 * Updated Greek (el_GR) language file. Thanks, Sterios, and George!
 * Updated Dutch (nl) language file. Thanks, Rob!
 * Updated Slovak (sk_SK) language file. Thanks, Tomáš!
 * Updated Basque (eu) language file. Thanks, Asier!
 * Updated Bulgarian (bg) language file. Thanks, Damian!
 * Updated Finnish (fi) language file. Thanks, Jiri!
 * Updated Bosnian (bs) language file. Thanks, Kenan!

Changed in clamtk:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.