You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent this, we must guard those two calls by Plugin._is_skipped_path(absdest) condition.
How to implement it in a gentle way? Options:
Archive's methods add_file, check_path and _make_leading_paths to have extra argument list of skip paths, and the class will duplicate ``Plugin._is_skipped_path` method - I dont like passing potentially long lists, neither code duplication
Archive's methods to pass just Plugin reference as an optional argument, and if present, Plugin._is_skipped_path(absdest) is called as the guard. But I don't like having references to plugins in Archive.
#3767 is incomplete in the following use case (artificial but simple to understand):
/lib/alsa/init/info
where/lib
is a symlink to/usr/lib
sos report --skip-files=/usr/*
Then, the
/lib/alsa/init/info
files hould not be collected since whole/usr
should be skipped. BUT the directory and symlink to it is created within https://github.com/sosreport/sos/blob/main/sos/archive.py#L254-L256 / https://github.com/sosreport/sos/blob/main/sos/archive.py#L258-L260 .To prevent this, we must guard those two calls by
Plugin._is_skipped_path(absdest)
condition.How to implement it in a gentle way? Options:
Archive
's methodsadd_file
,check_path
and_make_leading_paths
to have extra argument list of skip paths, and the class will duplicate ``Plugin._is_skipped_path` method - I dont like passing potentially long lists, neither code duplicationArchive
's methods to pass justPlugin
reference as an optional argument, and if present,Plugin._is_skipped_path(absdest)
is called as the guard. But I don't like having references to plugins inArchive
.Archive
(https://github.com/sosreport/sos/blob/main/sos/report/plugins/__init__.py#L1532) is evaluated against_is_skipped_path
, and ifTrue
, then..? remove the file/directory/..?Some other / better idea, how to prevent creating symlinks to forbidden path this way?
The text was updated successfully, but these errors were encountered: