Ticket #588 (closed Bug report: fixed)

Opened 8 years ago

Last modified 7 years ago

install script can't be accessed on windows

Reported by: Paul Owned by: gbastien
Priority: high Milestone: Not yet assigned to a Milestone
Component: Auth server, Install script Version:
Keywords: Cc:

Description (last modified by benoitg) (diff)

unable to create administrator

previous ticket 384 did not solve my problem:

Warning: fopen(/tmp/dog_cookie.txt): failed to open stream: No such file or directory in C:\wwwroot\wifidog-auth\wifidog\install.php on line 67 Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\wwwroot\wifidog-auth\wifidog\install.php on line 68 Warning: fclose() expects parameter 1 to be resource, boolean given in C:\wwwroot\wifidog-auth\wifidog\install.php on line 69 Warning: fopen(/tmp/dog_cookie.txt): failed to open stream: No such file or directory in C:\wwwroot\wifidog-auth\wifidog\install.php on line 73 Warning: filesize(): stat failed for /tmp/dog_cookie.txt in C:\wwwroot\wifidog-auth\wifidog\install.php on line 74 Warning: fread() expects parameter 1 to be resource, boolean given in C:\wwwroot\wifidog-auth\wifidog\install.php on line 74 Warning: fclose() expects parameter 1 to be resource, boolean given in C:\wwwroot\wifidog-auth\wifidog\install.php on line 75

is the error on top of the page when trying to create an administrator during the install..

have tried reinstalling etc but still cant get it to work..

any ideas?

Change History

Changed 8 years ago by benoitg

  • description modified (diff)
  • summary changed from unable to create administrator to install script can't be accessed on windows

Humm, the security mechanism we use for originally accessing the install script may not work on windows. We should probably use the tempnam() function to create the cookie.

Changed 8 years ago by Robin Jones

or something like:

$password_file = "";

if (stristr(php_os, 'WIN')) {  // Windows
    $password_file = getenv('TEMP') . DIRECTORY_SEPARATOR . "WiFiDog_cookie.txt";
} else {  // Other
$password_file = '/tmp/dog_cookie.txt';
// or maybe: getenv('TMP') . DIRECTORY_SEPARATOR . "WiFiDog_cookie.txt";
}

Changed 8 years ago by Robin Jones

Also, to aid security, the file should be deleted once finished with.

Changed 7 years ago by gbastien

or function sys_get_temp_dir() to get the temp directory of the machine. It works for both Windows and Linux server as far as I know and we can still use the friendly name dog_cookie.txt

Changed 7 years ago by gbastien

  • owner set to gbastien
  • status changed from new to assigned

Changed 7 years ago by gbastien

  • status changed from assigned to closed
  • resolution set to fixed

Quick fix using sys_get_temp_dir() function. Works only for php version >= 5.2.1 though

Note: See TracTickets for help on using tickets.