From 305a1012c75553b3ad9dceac1ac7c2287b40d5d3 Mon Sep 17 00:00:00 2001 From: graf25 Date: Mon, 27 May 2002 21:01:29 +0000 Subject: [PATCH] posix_* functions don't exist on !UNIX platforms. Adding workarounds. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2874 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/file_prefs.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions/file_prefs.php b/functions/file_prefs.php index a4bfeace..082b1bce 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -168,8 +168,11 @@ function checkForPrefs($data_dir, $username, $filename = '') { logout_error( $errString, $errTitle ); exit; } else if (!@copy($default_pref, $filename)) { - $user_data = posix_getpwuid(posix_getuid()); - $uid = $user_data['name']; + $uid = 'httpd'; + if (function_exists('posix_getuid')){ + $user_data = posix_getpwuid(posix_getuid()); + $uid = $user_data['name']; + } $errString = $errTitle . '
' . _("Could not create initial preference file!") . "
\n" . sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) . -- 2.25.1