Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 155545 Details for
Bug 224925
dev-lang/python privilege escalation (libs being loaded from CWD)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
safe-import.py
safe-import.py (text/plain), 588 bytes, created by
Ali Polatel (RETIRED)
on 2008-06-04 21:39:25 UTC
(
hide
)
Description:
safe-import.py
Filename:
MIME Type:
Creator:
Ali Polatel (RETIRED)
Created:
2008-06-04 21:39:25 UTC
Size:
588 bytes
patch
obsolete
>#!/usr/bin/env python ># -*- coding: utf-8 -*- ># vim: set sw=4 ts=4 sts=4 et tw=79 : > >import __builtin__ >import os >import sys >import warnings > >original_import = __builtin__.__import__ >def safe_import(name, globals={}, locals={}, fromlist=[], level=-1): > curdir = os.getcwd() > if curdir in sys.path and sys.path[-1] != curdir: > warnings.warn(". is in sys.path and not at index -1!. This is a security risk", > RuntimeWarning) > sys.path.remove(curdir) > return original_import(name, globals, locals, fromlist, level) > >__builtin__.__import__ = safe_import
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 224925
: 155545