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

Merge Develop into Release #3459

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
rules:
- id: use-ftp-tls
pattern: ftplib.FTP(...)
patterns:
- pattern: ftplib.FTP(...)
# With stdlib libdefs, Semgrep knows that `ftplib.FTP_TLS` is a subclass of
# `ftplib.FTP`, and therefore the pattern `ftplib.FTP` matches when we
# encounter `ftplib.FTP_TLS` too.
#
# Therefore, we explicitly exclude `FTP_TLS`.
#
# Currently libdefs are only available with the interfile engine, and since
# this rule does not have `interfile: true` we only run the interfile engine
# over it in tests. However, it's preferable to future-proof this rule
# rather than exclude it from our interfile test suite.
- pattern-not: ftplib.FTP_TLS(...)
fix-regex:
regex: FTP(.*)\)
replacement: FTP_TLS\1, context=ssl.create_default_context())
Expand Down
Loading