path to builder joined using + in pbuilder-dist

Bug #398974 reported by Rylie Pavlik
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-dev-tools (Ubuntu)
Fix Released
Medium
Stefano Rivera

Bug Description

Binary package hint: ubuntu-dev-tools

On line 257 on the jaunty current version, there is this line:
return self.auth + ' /usr/sbin/' + self.builder + ' ' + ' '.join(arguments)

which should be
return self.auth + ' ' + os.path.join('/usr/sbin/', self.builder) + ' ' + ' '.join(arguments)
or even better,

from commands import getoutput
return self.auth + ' ' + getoutput('which ' + self.builder) + ' ' + ' '.join(arguments)

since earlier (in __init__) the whole path is searched for the builder. (Mind you, the python code does "which" manually, replacing that is covered in Bug #398972

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Is this possibly the reason pbuilder-dist does not work for me at all in karmic?

$ pbuilder-dist hardy create
Error: Could not find "pbuilder".
$ pbuilder
Command 'pbuilder' is available in '/usr/sbin/pbuilder'
The command could not be located because '/usr/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative priviledges associated with your user account.
pbuilder: command not found

Revision history for this message
Michael Bienia (geser) wrote :

@Rolf: Do you have the package "pbuilder" installed? It's listed in recommends for ubuntu-dev-tools.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

@Michael: Yes. I thought that was clear from command-not-found suggesting adjustments to PATH and not installation of the package. Maybe I should have be more explicit.

Revision history for this message
Iain Lane (laney) wrote :

I've just come across this, although the code seems to have evolved a bit since this report was filed. There is no reason for /usr/sbin to be in the path of the user. It is wrong for pbuilder-dist to search for the builder using the user's PATH settings as it is going to be launched under sudo anyway.

Why does this check need to exist? The relevant lines are 80-86:

        for file in os.environ['PATH'].split(':'):
            if os.path.exists(os.path.join(file, builder)):
                builder = ''
                break
        if builder:
            print 'Error: Could not find "%s".' % builder
            sys.exit(1)

Changed in ubuntu-dev-tools (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in ubuntu-dev-tools (Ubuntu):
assignee: nobody → Stefano Rivera (stefanor)
status: Triaged → In Progress
Benjamin Drung (bdrung)
Changed in ubuntu-dev-tools (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-dev-tools - 0.107

---------------
ubuntu-dev-tools (0.107) experimental; urgency=low

  [ Stefano Rivera ]
  * edit-patch: Detect quilt patch-system in 3.0 (quilt) packages without any
    patches yet.
  * wrap-and-sort:
    - Correct typo in options --wrap-allways -> --wrap-always
    - Sort debian/install as well as debian/*.install
    - Add one-space-indentation option: --short-indent
    - Remove null-entry from trailing comma in sorted lists
    - Add configurable debian directory location
    - Sort Architecture (LP: #681131)
    - Add --sort-binary-packages and --keep-first (LP: #681119)
  * grab-merge, syncpackage: Export DEB_VENDOR=Ubuntu when unpacking source
    packages. 3.0 (quilt) has optional per-vendor patch series.
  * pbuilder-dist:
    - Refactor to use subprocess.popen instead of os.system (LP: #398974)
    - Catch OSErrors when creating directories (LP: #671067)
    - Set HOME so pbuilder reads .pbuilderrc
    - Add bidirectional workarounds for LP: #599695 (pbuilder uses the host
      apt keyring). Complain if the target's keyring isn't installed.
  * Use dpkg-vendor in ubuntutools.misc.system_distribution(), cache result.

  [ Benjamin Drung ]
  * wrap-and-sort: Remove duplicate items from sorted lists.
  * syncpackage: Fix error message for failed downloads.
  * sponsor-patch: Support building with sbuild (LP: #681242).

  [ Daniel Holbach ]
  * submittodebian: rephrase boilerplate text to be more polite, add reminder
    to explain the patch sufficiently and add necessary information.

  [ Colin Watson ]
  * submittodebian: Encourage sending multiple independent pieces of the
    Ubuntu patch in separate bug reports.
 -- Benjamin Drung <email address hidden> Fri, 03 Dec 2010 00:14:25 +0100

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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