From 6985ede105216214f547d43aa9fdf01061285a0c Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 25 Jan 2024 16:52:22 +0100 Subject: [PATCH] os-makereport: fix reporting user journalctl when called by mambareport with pkexec instead of sudo --- os-makereport/os-makereport | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/os-makereport/os-makereport b/os-makereport/os-makereport index feaa9c5..c78259e 100755 --- a/os-makereport/os-makereport +++ b/os-makereport/os-makereport @@ -2,15 +2,20 @@ # # GNU/Linux O.S. report generation tool # -# Copyright (c) 2008-2022 by Silvan Calarco +# Copyright (c) 2008-2024 by Silvan Calarco # -MAKEREPORT_VERSION=20220728 +MAKEREPORT_VERSION=20240125 TEMPFILE=`mktemp` . ${ROOT}/etc/sysconfig/machine . ${ROOT}/etc/os-release +if [ "${SUDO_USER}" == "" ]; then + # mambareport uses pkexec instead of sudo + SUDO_USER="\#${PKEXEC_UID}" +fi + [ ! "$SYSTEM_MANUFACTURER" -o "$SYSTEM_MANUFACTURER" = "System manufacturer" ] && { SYSTEM_MANUFACTURER=unknown } @@ -120,7 +125,8 @@ _EOF } echo "${NAME} report generation tool ${MAKEREPORT_VERSION}" -echo "Copyright (c) 2008-2022 by Silvan Calarco " +echo "Copyright (c) 2008-2024 by Silvan Calarco " +echo "Released under the terms of the GNU GPL v3 license" echo [ $UID = 0 ] || {