提交 f60124cc 编写于 作者: X Xin Zhang 提交者: Shoaib Lari

gppylib: Don't get username from the environment

Sometimes, these are not set. Other times, they can be set incorrectly
by the user, or a malicious actor.
Co-authored-by: NXin Zhang <xzhang@pivotal.io>
Co-authored-by: NDavid Sharp <dsharp@pivotal.io>
上级 81c11099
......@@ -8,6 +8,7 @@ Set of Classes for executing unix commands.
import os
import platform
import psutil
import pwd
import socket
import signal
import uuid
......@@ -74,7 +75,7 @@ def getLocalHostname():
def getUserName():
return os.environ.get('LOGNAME') or os.environ.get('USER')
return pwd.getpwuid(os.getuid()).pw_name
def check_pid_on_remotehost(pid, host):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册