mirror of
https://github.com/curl/curl.git
synced 2026-05-03 08:07:51 +03:00
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
This commit is contained in:
parent
d16a020a87
commit
f33ec60fbf
1 changed files with 11 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue