Summary
Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Wed 2/3/10 13:04
Recent Commits
>
--git a/pts-core/functions/pts-functions_config.php b/pts-core/functions/pts-functions_config.php
index 3fd8097..1bca016 100644
--- a/pts-core/functions/pts-functions_config.php
+++ b/pts-core/functions/pts-functions_config.php
@@ -56,13 +56,14 @@ function pts_find_home($path)
{
if(strpos($path, '~') !== FALSE)
{
- $whoami = trim(shell_exec("whoami"));
+ /* $whoami = trim(shell_exec("whoami"));
if($whoami == "root")
$home_path = "/root";
else
- $home_path = "/home/$whoami";
+ $home_path = "/home/$whoami"; */
+ $home_path = pts_posix_userhome();
$path = str_replace('~', $home_path, $path);
}
return $path;
@@ -72,7 +73,7 @@ function pts_current_user()
$pts_user = pts_read_user_config("PhoronixTestSuite/GlobalDatabase/UserName", "Default User");
if($pts_user == "Default User")
- $pts_user = trim(shell_exec("whoami"));
+ $pts_user = pts_posix_username();
return $pts_user;
}
diff --git a/pts-core/functions/pts-functions_linux.php b/pts-core/functions/pts-functions_linux.php
index fc6a7f9..676b1e5 100644
--- a/pts-core/functions/pts-functions_linux.php
+++ b/pts-core/functions/pts-functions_linux.php
@@ -5,6 +5,16 @@
// SYSTEM RELATED
//
+function pts_posix_username()
+{
+ $userinfo = posix_getpwuid(posix_getuid());
+ return $userinfo["name"];
+}
+function pts_posix_userhome()
+{
+ $userinfo = posix_getpwuid(posix_getuid());
+ return $userinfo["dir"] . '/';
+}
function cpu_core_count()
{
if(is_file("/proc/cpuinfo"))
<
Copyright © 2010 by Phoronix Media