-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-143511: Document sys.remote_exec permissions requirements #143575
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
91c984c
d1256a4
c96d1aa
9f6d131
fe77ba9
6687123
9d3be80
9290444
17d72e6
a92496d
eacadb1
92fc961
809133b
fd20f01
269d9ff
21f8da8
f47c3d6
5e9f8d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1996,6 +1996,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only | |
| and minor version as the local process. If either the local or remote | ||
| interpreter is pre-release (alpha, beta, or release candidate) then the | ||
| local and remote interpreters must be the same exact version. | ||
| The temporary script file is created with restrictive permissions (typically | ||
| ``0o600``). The target process must be able to read this file. | ||
|
|
||
| .. audit-event:: sys.remote_exec pid script_path | ||
|
|
||
|
|
@@ -2013,10 +2015,22 @@ always available. Unless explicitly noted otherwise, all variables are read-only | |
| This event is raised in the remote process, not the one | ||
| that called :func:`sys.remote_exec`. | ||
|
|
||
| Callers should adjust permissions before calling, for example:: | ||
|
|
||
| import os | ||
| import tempfile | ||
| import sys | ||
|
|
||
| with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f: | ||
| f.write("print('Hello from remote!')") | ||
| f.flush() | ||
| os.chmod(f.name, 0o644) # Readable by group/other | ||
| sys.remote_exec(pid, f.name) | ||
| os.unlink(f.name) # Cleanup | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be put before the audit event descriptions.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @picnixz Have implemented that yes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did so
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are almost there: Please move all your content above the |
||
|
|
||
| .. availability:: Unix, Windows. | ||
| .. versionadded:: 3.14 | ||
|
|
||
|
|
||
| .. function:: _enablelegacywindowsfsencoding() | ||
|
|
||
| Changes the :term:`filesystem encoding and error handler` to 'mbcs' and | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.