incrontab changes event name, path etc

Bug #1031238 reported by Alexandr Leutin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
incron (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When I try to edit incrontab file with incrontab command, it replaces special symbols, which represents event path, name etc ($%, $@ etc) by '0'.
It not depends on the used editor (I have tried with nano, vim and mcedit).
For example:

root@s:~# cat incrontab.user | grep echo
/home/user IN_ALL_EVENTS /bin/echo %$ >> /tmp/incron.user
root@s:~# incrontab -uuser incrontab.user
copying table from file 'incrontab.technostockcom'
root@s:~# incrontab -l -uuser | grep echo
/home/user IN_ALL_EVENTS /bin/echo 0 >> /tmp/incron.user
root@s:~#

Revision history for this message
Alexandr Leutin (leutin) wrote :

s ~ $lsb_release -a [13:59:19]0
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
s ~ $uname -a [13:59:21]0
Linux s.micelon.ru 3.1.0-1.2-xen #5 SMP Mon Mar 5 14:10:54 MSK 2012 i686 i686 i386 GNU/Linux
s ~ $dpkg -l incron [13:59:28]0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-======================================-======================================-============================================================================================
ii incron 0.5.9-5 cron-like daemon which handles filesystem events
s ~ $

Revision history for this message
Andreas Altaïr Redmer (altair-ibn-la-ahad) wrote :

This works now fine in version 0.5.10 .

If you want to reproduce it from the original Bug description, you have to take care to use 'echo $%' instead of 'echo %$' .

Changed in incron (Ubuntu):
status: New → Fix Released
Revision history for this message
Tamás Baráth (tamas-barath) wrote :

Actually this is not working fine. I think the problem is in the incron itself, not in the package.
In the actual version the fields _must_ be separated with only space(s), and there must be a mask after the first space.

Easy to reproduce, just try to add one line to the end and check the result:
$ incrontab -e && tail -n 1 /var/spool/incron/whatever

1. /srv/ IN_ACCESS echo "1"
with spaces, this OK

2. #/srv/ IN_ACCESS echo "1"
with spaces and with a hashmark in the first character, seems OK but in the log:
access denied on # - events will be discarded silently

2. # /srv/ IN_ACCESS echo "1"
the last line but add a space after the hashmark, the result will be:
# 0 IN_ACCESS echo "1"

3. try to add the line in point 1, but use tabs as delimiter instead of spaces:
/srv/<tab>IN_ACCESS<tab>echo "1"
The line will simply disappear.

And so on.
So use only space(s) for delimiter, and if you comment out lines do it without space.

$ apt-cache show incron | grep Ver
Version: 0.5.10-1ubuntu1

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.