From: Daniel Stenberg Date: Thu, 5 Jun 2025 21:37:59 +0000 (+0200) Subject: tests/servers.pm: add more ways to figure out current user X-Git-Tag: rc-8_15_0-1~121 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f33ec60fbf7a7251aa4475812b2f57b47470bbf2;p=thirdparty%2Fcurl.git tests/servers.pm: add more ways to figure out current user Some CI tests fail due to "Can't start ssh server due to lack of USER name" - add more ways to try to figure it out if no environment variable works: the whoami and id commands. Closes #17544 --- diff --git a/tests/servers.pm b/tests/servers.pm index 29e214de30..9a2c57dcdf 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -209,9 +209,17 @@ sub initserverconfig { $USER = $ENV{USER}; # Linux if (!$USER) { $USER = $ENV{USERNAME}; # Windows - if (!$USER) { - $USER = $ENV{LOGNAME}; # Some Unix (I think) - } + } + if (!$USER) { + $USER = $ENV{LOGNAME}; # Some Unix (I think) + } + if (!$USER) { + $USER = `whoami`; + chomp $USER; + } + if (!$USER) { + $USER = `id -un`; + chomp $USER; } init_serverpidfile_hash(); }