zero file called 0 created in $HOME each time Ubuntu DVD is inserted

Bug #1400357 reported by zebul666 on 2014-12-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Medium
Brian Murray

Bug Description

I noticed that weird file called 0 (zero), and empty, in my home directory.
I deleted it and it came back !

then i used auditd to find out what process was creating such a file, so I used
auditctl -w /home/zebul666/0 -p wa -k home-zero-file

and to make it permanent I added the line "-w /home/zebul666/0 -p wa -k home-zero-file" in /etc/audit/rules.d/audit.rules

and wait.

and I had a hit with ausearch -k home-zeo-file showed me

time->Sat Nov 22 23:42:41 2014
type=PROCTITLE msg=audit(1416696161.454:19183): proctitle=2F62696E2F7368002D65002F70726F632F73656C662F66642F39
type=PATH msg=audit(1416696161.454:19183): item=1 name="0" inode=11535138 dev=fc:01 mode=0100664 ouid=1000 ogid=1000 rdev=00:00 nametype=CREATE
type=PATH msg=audit(1416696161.454:19183): item=0 name="/home/zebul666" inode=11534337 dev=fc:01 mode=040700 ouid=1000 ogid=1000 rdev=00:00 nametype=PARENT
type=CWD msg=audit(1416696161.454:19183): cwd="/home/zebul666"
type=SYSCALL msg=audit(1416696161.454:19183): arch=c000003e syscall=2 success=yes exit=3 a0=7f0c68b8ab08 a1=241 a2=1b6 a3=0 items=2 ppid=22150 pid=28635 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=4294967295 comm="sh" exe="/bin/dash" key="home-zero-file"

the process with pid 28635 was gone but more interestingly I noticed that the PPID 22150 is the one for upstart !

so it's a script launched by upstart
and I noticed in my /var/log/syslog at the approx. same time

Nov 22 23:42:30 callisto udisksd[3502]: Mounted /dev/sr0 at /media/zebul666/Ubuntu 14.10 amd64 on behalf of uid 1000

I don't know which script is run by upstart at dvd insertion but there is a bug in it that creates a empty zero file in home when you insert a ubuntu DVD

running ubuntu 14.10 amd64

Related branches

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1400357/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Brian Murray (brian-murray) wrote :

It's probably caused by this file /usr/share/upstart/sessions/update-notifier-cds.conf.

affects: ubuntu → update-notifier (Ubuntu)
Brian Murray (brian-murray) wrote :

Or more explicitly some called by that.

zebul666 (zebul666) wrote :

line 20 of /usr/share/upstart/sessions/update-notifier-cds.conf is
    if [ $CDTYPE > 0 ]

I don't know much about dash but for bash I would have written
    if [ $CDTYPE -gt 0 ]

also in dash man page:
[...]
s1 > s2 True if string s1 comes after s2 based on the ASCII value of their characters.
[...]
n1 -gt n2 True if the integer n1 is algebraically greater than the integer n2.

as CDTYPE is an integer it's the second form.

I tried changing ">" to "-gt" in the file /usr/share/upstart/sessions/update-notifier-cds.conf and
it fixed it ! no zero file anymore !

zebul666 (zebul666) wrote :

I don't if it's a bug in dash but even with string, whatever I try the syntax if [ s1 > s2 ] always gives a s2 file written on filesystem.

zebul666 (zebul666) wrote :

it's not a bug in dash, it should be used with quote like

if [ s1 ">" s2 ] ....

so in our example:

if [ $CDTYPE ">" 0 ]
will work too

Steve Langasek (vorlon) wrote :

The right fix is to use the -gt operator, not >.

It may be a bug on the part of dash to interpret this as shell redirection in between '[' and ']', but I'm not sure of that, and in any case the right operator is -gt.

Brian, could you fix this?

Changed in update-notifier (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: New → Triaged
Changed in update-notifier (Ubuntu):
importance: Undecided → Medium
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.158

---------------
update-notifier (3.158) vivid; urgency=medium

  * debian/update-notifier-cds.conf: use the correct comparison operator for
    checking the type of CD. (LP: #1400357)
 -- Brian Murray <email address hidden> Wed, 10 Dec 2014 12:41:49 -0800

Changed in update-notifier (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers