Commit 096eb49
committed
fix(extractor): stronger implementation of fix_extracted_directory.
1. recursive walking
We re-implemented fix_extracted_directory using os.listdir(). We do not
rely on os.walk because we need to fix the permissions recursively in
order to gain visibility into child directories. If we were to use
os.walk() on a directory containing directories on which we don't have
read permissions would mean we would not fix the content of those
directories.
2. handling ENAMETOOLONG
fix_extracted_directory now handles ENAMETOOLONG exception triggered on
symlinks with overly long target names. When that happens, we skip over
the file.
3. handling concurrent deletion
Someone (or something) can delete an object (file, directory, link, ...)
from the extraction directory as we are walking through it. We're also
handling such cases now so we don't raise FileNotFoundError.1 parent 993ecaa commit 096eb49
File tree
9 files changed
+27
-5
lines changed- tests/integration/filesystem/extfs
- __input__
- __output__/f_badsymlinks.img_extract
- lost+found
- unblob
9 files changed
+27
-5
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
94 | 111 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
0 commit comments