diff --git a/src/oebuild/app/main.py b/src/oebuild/app/main.py index c9b0364a5d3278d742bbe92ad82cd4d26525f837..4a5f941d79f10146fefb338793f36d3b3c76487b 100644 --- a/src/oebuild/app/main.py +++ b/src/oebuild/app/main.py @@ -13,7 +13,7 @@ import os import sys import pathlib from collections import OrderedDict -import getpass +import pwd import oebuild.util as oebuild_util import oebuild.const as oebuild_const @@ -168,7 +168,7 @@ def check_user(): ''' check execute user must in normal user ''' - if getpass.getuser() == "root": + if pwd.getpwuid(os.getuid())[0] == "root": logger.error("can not use oebuild in root") return False return True