fix user detection on freebsd always returning root
This commit is contained in:
parent
4356085a43
commit
208f866fc4
1 changed files with 2 additions and 1 deletions
|
@ -25,6 +25,7 @@ import os
|
|||
import io
|
||||
import re
|
||||
import sys
|
||||
import pwd
|
||||
import json
|
||||
import getpass
|
||||
import platform
|
||||
|
@ -312,7 +313,7 @@ ALLOWED_IN_OUTPUT_DIR = {
|
|||
|
||||
DYNAMIC_CONFIG_SCHEMA: ConfigDefaultDict = {
|
||||
'TERM_WIDTH': {'default': lambda c: lambda: shutil.get_terminal_size((100, 10)).columns},
|
||||
'USER': {'default': lambda c: getpass.getuser() or os.getlogin()},
|
||||
'USER': {'default': lambda c: pwd.getpwuid(os.geteuid()).pw_name or getpass.getuser() or os.getlogin()},
|
||||
'ANSI': {'default': lambda c: DEFAULT_CLI_COLORS if c['USE_COLOR'] else {k: '' for k in DEFAULT_CLI_COLORS.keys()}},
|
||||
|
||||
'PACKAGE_DIR': {'default': lambda c: Path(__file__).resolve().parent},
|
||||
|
|
Loading…
Reference in a new issue