Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion makeservices/makemysql
Original file line number Diff line number Diff line change
Expand Up @@ -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 ORIGINAL_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.'
Expand Down
4 changes: 2 additions & 2 deletions makeservices/makemysql-real
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,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('ORIGINAL_USER')

if not username:
raise RuntimeError('Unable to read pwd.getpwuid(os.getuid()).pw_name.')
raise RuntimeError('Unable to read ORIGINAL_USER.')

# Read config file.
mysql_host, mysql_root_pw = read_config()
Expand Down