usb-creator does not work when $HOME is on NFS

Bug #295172 reported by Magnus Runesson
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: usb-creator

$HOME is NFS-mounted and the clients root-user has no right on the NFS-server.

usb-creator tries to write .usb-creator.log in users home directory but are not alloewd to write to users home. usb-creator crashes.

$ usb-creator
  File "/usr/bin/usb-creator", line 40, in <module>
    f = GtkFrontend()
  File "/usr/lib/python2.5/site-packages/usbcreator/gtk_frontend.py", line 52, in __init__
    self.backend = Backend(self)
  File "/usr/lib/python2.5/site-packages/usbcreator/backend.py", line 87, in __init__
    self.logger = Logger()
  File "/usr/lib/python2.5/site-packages/usbcreator/backend.py", line 33, in __init__
    self.fp = open(log_file, 'a')
IOError: [Errno 13] Permission denied: '/home/magru/.usb-creator.log'
Exception exceptions.AttributeError: "Logger instance has no attribute 'fp'" in <bound method Logger.__del__ of <usbcreator.backend.Logger instance at 0x1f80710>> ignored

$ usb-creator --version
0.1.8

~$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10

$ apt-cache policy usb-creator
usb-creator:
  Installed: 0.1.10
  Candidate: 0.1.10
  Version table:
 *** 0.1.10 0
        500 http://archive.ubuntu.com intrepid/main Packages
        100 /var/lib/dpkg/status

Workaround
=========
$ sudo -s
# export SUDO_USER=root
# usb-creator

Revision history for this message
Martti Kuparinen (mk1970) wrote :

I confirm this, my NFS client is Ubuntu 9.04...

Revision history for this message
Victor Costan (costan) wrote :

A possible fix is to write the log file to /var/log/usb-creator.log instead of ~/.usb_creator.log if the user is root.

The fix is easy, in usbcreator/backend.py:28-29
replace with: log_file = '/var/log/usb-creator.log'

I've attached the modified file. I couldn't figure out how to generate a patch quickly. The Code tab in launchpad let me download a .tar.gz, so you're getting a modified file. Sorry for the inconvenience.

Revision history for this message
kaleissin (kaleissin) wrote :

I have the same problem.

Another "workaround" is to make the file (.usb-creator.log) manually, then make it writeable for all... so: needs to be fixed.

Revision history for this message
Evan (ev) wrote :

This is fixed in 0.2.7 (released in Karmic). usb-creator is run as a regular users and tries to write its log to ~/.usbcreator.log. If it fails to do so, it writes to stdout.

Changed in usb-creator (Ubuntu):
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.