From a47d58e4964934378730384fe19d783514ace26c Mon Sep 17 00:00:00 2001 From: Eric Gu <69128383+skybound0@users.noreply.github.com> Date: Thu, 7 May 2026 17:04:38 -0700 Subject: [PATCH 1/2] pass ORIGIN_USER to makemysql-real --- makeservices/makemysql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makeservices/makemysql b/makeservices/makemysql index a1a324e..c965438 100755 --- a/makeservices/makemysql +++ b/makeservices/makemysql @@ -30,7 +30,7 @@ done # makemysql-real will output the new password ONLY on the # last line. The --quiet will also make sure it only output the password... -if ! PASS=$(sudo -u mysql /run/current-system/sw/bin/makemysql-real --quiet) ; then +if ! PASS=$(sudo -u mysql ORIGIN_USER=$USER /run/current-system/sw/bin/makemysql-real --quiet) ; then echo 'makemysql-real did not exit properly.' echo 'Run "sudo -u mysql /run/current-system/sw/bin/makemysql-real" for a more verbose output.' echo 'Additionally, you may contact staff members for help. This script will stop.' From 1ed902553c78c3530a7e8512dd4578c7f890447f Mon Sep 17 00:00:00 2001 From: Eric Gu <69128383+skybound0@users.noreply.github.com> Date: Thu, 7 May 2026 17:06:22 -0700 Subject: [PATCH 2/2] replace user check with variable passed by makemysql --- makeservices/makemysql-real | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/makeservices/makemysql-real b/makeservices/makemysql-real index 038b9b9..69e3bb6 100755 --- a/makeservices/makemysql-real +++ b/makeservices/makemysql-real @@ -18,7 +18,6 @@ is used to parse the config file, so the format is basically the Windows INI format. """ import os -import pwd import random import string import sys @@ -80,10 +79,10 @@ def main(): # Without this quiet below will be local variable global quiet try: - username = pwd.getpwuid(os.getuid()).pw_name + username = os.environ.get('ORIGIN_USER') if not username: - raise RuntimeError('Unable to read pwd.getpwuid(os.getuid()).pw_name.') + raise RuntimeError('Unable to read ORIGIN_USER.') # Read config file. mysql_host, mysql_root_pw = read_config()