File ingestion assumes symlinks are not broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charmworld |
Fix Released
|
High
|
Unassigned |
Bug Description
When files are ingested for a charm, we assume that following a symlink will work, but it does not work if the symlink is broken.
In the example below, tests.py is a symlink to "../../
Not only should we guard against missing symlinks, we should also ensure they do not traverse outside the charm's directory, since that would be a security violation.
2013-04-25 10:55:06,409 ERROR [charm.
Traceback (most recent call last):
File "/home/
job.
File "/home/
charm_data = self.add_
File "/home/
self.
File "/home/
self.fs, charm_data, charm_data[
File "/home/
subdir=
File "/home/
with open(file_path) as handle:
IOError: [Errno 2] No such file or directory: '/home/
Related branches
- Curtis Hovey (community): Approve (code)
-
Diff: 223 lines (+95/-19)3 files modifiedcharmworld/jobs/ingest.py (+1/-1)
charmworld/models.py (+35/-13)
charmworld/test_models.py (+59/-5)
tags: | added: ingest |
description: | updated |
Changed in charmworld: | |
status: | Triaged → Fix Committed |
Changed in charmworld: | |
status: | Fix Committed → Fix Released |