After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653156 - Be more robust processing files in installroot
Be more robust processing files in installroot
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal critical
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
: 654315 (view as bug list)
Depends on: 654062
Blocks: 647231
 
 
Reported: 2011-06-22 09:22 UTC by Craig Keogh
Modified: 2011-07-12 18:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
install: Be more robust against modules installing files outside of prefix (2.96 KB, patch)
2011-07-06 02:30 UTC, Colin Walters
needs-work Details | Review

Description Craig Keogh 2011-06-22 09:22:57 UTC
Running 'jhbuild tinderbox -a'

Traceback (most recent call last):
  • File "/home/oxyde/.local/bin/jhbuild", line 31 in <module>
    jhbuild.main.main(sys.argv[1:])
  • File "/home/oxyde/gnome/jhbuild/jhbuild/main.py", line 147 in main
    rc = jhbuild.commands.run(command, config, args, help=lambda: print_help(parser))
  • File "/home/oxyde/gnome/jhbuild/jhbuild/commands/__init__.py", line 123 in run
    return cmd.execute(config, args, help)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/commands/__init__.py", line 52 in execute
    return self.run(config, options, args, help)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/commands/tinderbox.py", line 89 in run
    return build.build()
  • File "/home/oxyde/gnome/jhbuild/jhbuild/frontends/buildscript.py", line 146 in build
    error, altphases = module.run_phase(self, phase)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 230 in run_phase
    method(buildscript)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/autotools.py", line 276 in do_install
    self.process_install(buildscript, self.get_revision())
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 206 in process_install
    self._process_install_files(destdir, destdir, buildscript.config.prefix)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 196 in _process_install_files
    self._process_install_files(installroot, src_path, prefix)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 196 in _process_install_files
    self._process_install_files(installroot, src_path, prefix)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 196 in _process_install_files
    self._process_install_files(installroot, src_path, prefix)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 196 in _process_install_files
    self._process_install_files(installroot, src_path, prefix)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 199 in _process_install_files
    os.rename(src_path, dest_path)
OSError: [Errno 13] Permission denied

Comment 1 Frederic Peters 2011-06-22 11:48:18 UTC
Adding Colin to CC.
Comment 2 Colin Walters 2011-06-22 13:14:42 UTC
Can you get a module name and/or filename?
Comment 3 Craig Keogh 2011-07-01 11:21:48 UTC
tinderbox built successfully and installed successfully hamster-applet. Then jhbuild stops. The traceback was displayed at the console. jhbuild list tells me gssdp would have been next.
Comment 4 Colin Walters 2011-07-01 13:06:26 UTC
Try searching in your install tree for files owned by root (or another uid)?  Or perhaps ones with the ext3 immutable bit?  

Failing that, just add a print "%r %r" % (src_path, dst_path) before the call?
Comment 5 Craig Keogh 2011-07-02 02:36:36 UTC
src_path	unicode: /opt/gnome/_jhbuild/root-hamster-applet/usr/share/gnome-control-center/keybindings/90-hamster-applet.xml	
dest_path	unicode: /usr/share/gnome-control-center/keybindings/90-hamster-applet.xml
Comment 6 Craig Keogh 2011-07-05 23:51:17 UTC
Two issues here.
1. hamster-applet is installing stuff outside --prefix. hamster-applet's bug and not JHBuild's bug.
2. JHBuild dies if a module incorrectly installs stuff in system directories (/usr, /etc)

This bug is about issue 2. JHBuild should not die.
Comment 7 Colin Walters 2011-07-06 02:30:05 UTC
Created attachment 191381 [details] [review]
install: Be more robust against modules installing files outside of prefix

It turns out hamster-applet incorrectly ignores the prefix when using
DESTDIR for one file.  We shouldn't blow up when this happens; fix it
by *only* processing files in the destdir root which match prefix.

If this does happen, warn about it, and save the tree with a -broken
suffix.
Comment 8 Craig Keogh 2011-07-08 11:18:18 UTC
Review of attachment 191381 [details] [review]:

The patch doesn't apply to master. In master _process_install_files doesn't return anything. Which branch? I'm missing something?
Comment 9 Colin Walters 2011-07-10 19:05:59 UTC
(In reply to comment #8)
> Review of attachment 191381 [details] [review]:
> 
> The patch doesn't apply to master. In master _process_install_files doesn't
> return anything. Which branch? I'm missing something?

This bug depends on bug 654062.  Sorry - too many parallel branches and work going on in parallel.
Comment 10 Colin Walters 2011-07-10 19:18:59 UTC
*** Bug 654315 has been marked as a duplicate of this bug. ***
Comment 11 Colin Walters 2011-07-11 17:51:37 UTC
Going to go ahead and push this...many people hitting this (and other) issues.  Feel free to let me know if anyone sees any issues after pushing.