legatoproject / manifest

repo manifests for Legato
6 stars 15 forks source link

ManifestInvalidPathError for repo init call #11

Closed rage311 closed 4 years ago

rage311 commented 4 years ago

Seems that repo doesn't like the .. path traversal up the directory tree for <linkfile> src. Below is the full command run and full output, plus repo and system information. Please let me know if I can provide any more information.

$ repo init -u git://github.com/legatoproject/manifest -m legato/releases/19.11.0/legato.xml
Traceback (most recent call last):
  File "/home/mangoh/legato_framework_new_test/.repo/repo/main.py", line 568, in <module>
    _Main(sys.argv[1:])
  File "/home/mangoh/legato_framework_new_test/.repo/repo/main.py", line 542, in _Main
    result = run()
  File "/home/mangoh/legato_framework_new_test/.repo/repo/main.py", line 535, in <lambda>
    run = lambda: repo._Run(name, gopts, argv) or 0
  File "/home/mangoh/legato_framework_new_test/.repo/repo/main.py", line 213, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/subcmds/init.py", line 463, in Execute
    self._LinkManifest(opt.manifest_name)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/subcmds/init.py", line 315, in _LinkManifest
    self.manifest.Link(name)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 184, in Link
    self.Override(name)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 177, in Override
    self._Load()
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 483, in _Load
    self._ParseManifest(nodes)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 591, in _ParseManifest
    project = self._ParseProject(node)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 912, in _ParseProject
    self._ParseLinkFile(project, n)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 1047, in _ParseLinkFile
    self._ValidateFilePaths('linkfile', src, dest)
  File "/home/mangoh/legato_framework_new_test/.repo/repo/manifest_xml.py", line 1028, in _ValidateFilePaths
    '<%s> invalid "src": %s: %s' % (element, src, msg))
error.ManifestInvalidPathError: <linkfile> invalid "src": ../ar7: bad component: ..
$ repo --version
repo version v2.3
       (from https://gerrit.googlesource.com/git-repo)
repo launcher version 2.3
       (from /usr/bin/repo)
       (currently at 2.3)
repo User-Agent git-repo/2.3 (Linux) git/2.17.1 Python/3.6.9
git 2.17.1
git User-Agent git/2.17.1 (Linux) git-repo/2.3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0]

System information:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

$ uname -rm
4.15.0-76-generic x86_64
CoRfr commented 4 years ago

Hey @rage311 , thanks for reporting this issue. We also noticed this and are trying to find a fix for it. Pretty much all our manifests are using ../ar7 for instance, so this is a significant issue.

@jb68 will provide a workaround, but basically repo v1.x is required at the moment.