Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugins] sizelimit not applied when add_copy_spec called to a dir #1750

Closed
pmoravec opened this issue Aug 11, 2019 · 1 comment
Closed

[plugins] sizelimit not applied when add_copy_spec called to a dir #1750

pmoravec opened this issue Aug 11, 2019 · 1 comment

Comments

@pmoravec
Copy link
Contributor

Separating this issue from #1678 (comment):

Calling add_copy_spec to a directory, stat is applied to the directory "file" itself. That means, sizelimit is compared against the small size of the directory "file" itself, but not against the directory content.

We shall either replace glob.glob() at https://github.com/sosreport/sos/blob/master/sos/plugins/__init__.py#L1198 by os.walk, or merge parts of add_copy_spec with _do_copy_path (as _do_copy_path does the proper directory/symlink traversal needed to be done before applying the sizelimit).

@pmoravec
Copy link
Contributor Author

pmoravec commented Dec 3, 2019

Will be resolved by #1870.

TurboTurtle added a commit to TurboTurtle/sos that referenced this issue Apr 28, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 5, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 5, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 5, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 6, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 6, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 6, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
TurboTurtle added a commit to TurboTurtle/sos that referenced this issue May 6, 2020
Addresses an issue where size limiting was not being applied to whole
directory specifications, as we would only stat the directory directly
when it was returned from a glob. Now, if the given copyspec is just a
directory path, recurse into it with an explicit '*' match.

Updates the forbidden path check to account for the newly extended files
list to match against the directory-only forbidden specifications. This
may result in more log entries for deep directory structures whose
parent directory/directories is/are forbidden.

Closes: sosreport#1750
Resolves: sosreport#2035

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant