[geeklog-cvs] geeklog-1.3/public_html/admin database.php,1.18,1.19
blaine at iowaoutdoors.org
blaine at iowaoutdoors.org
Sun Jul 18 18:48:03 EDT 2004
Update of /var/cvs/geeklog-1.3/public_html/admin
In directory www:/tmp/cvs-serv905/public_html/admin
Modified Files:
database.php
Log Message:
Backup files were being created with permissions of 400 which could be un-readable by site admin in certain hosted environments. Added call to chmod to set the permissions of the created .sql backup file to 644.
Index: database.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/database.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** database.php 29 May 2004 11:42:27 -0000 1.18
--- database.php 18 Jul 2004 22:47:59 -0000 1.19
***************
*** 100,106 ****
$canExec = file_exists ($_DB_mysqldump_path);
}
! if ($canExec) {
! exec($command);
! if (file_exists ($backupfile) && filesize ($backupfile) > 0) {
$timestamp = strftime ($_CONF['daytime']);
$display .= COM_startBlock ($MESSAGE[40] . ' - ' . $timestamp,
--- 100,107 ----
$canExec = file_exists ($_DB_mysqldump_path);
}
! if ($canExec) {
! exec($command);
! if (file_exists ($backupfile) && filesize ($backupfile) > 0) {
! @chmod($backupfile, 0644);
$timestamp = strftime ($_CONF['daytime']);
$display .= COM_startBlock ($MESSAGE[40] . ' - ' . $timestamp,
***************
*** 110,114 ****
. $LANG_DB_BACKUP['backup_successful'] . '<br><br>'
. COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
! } else {
$display .= COM_startBlock ($LANG08[06], '',
COM_getBlockTemplate ('_msg_block', 'header'));
--- 111,115 ----
. $LANG_DB_BACKUP['backup_successful'] . '<br><br>'
. COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
! } else {
$display .= COM_startBlock ($LANG08[06], '',
COM_getBlockTemplate ('_msg_block', 'header'));
***************
*** 116,123 ****
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block',
'footer'));
! COM_errorLog ("Backup Filesize was 0 bytes", 1);
COM_errorLog ("Command used for mysqldump: $command", 1);
}
! } else {
$display .= COM_startBlock ($LANG08[06], '',
COM_getBlockTemplate ('_msg_block', 'header'));
--- 117,124 ----
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block',
'footer'));
! COM_errorLog ("Backup Filesize was 0 bytes", 1);
COM_errorLog ("Command used for mysqldump: $command", 1);
}
! } else {
$display .= COM_startBlock ($LANG08[06], '',
COM_getBlockTemplate ('_msg_block', 'header'));
***************
*** 127,132 ****
COM_errorLog ("Backup Error: Bad path or mysqldump does not exist", 1);
COM_errorLog ("Command used for mysqldump: $command", 1);
! }
! } else {
$display .= COM_startBlock ($MESSAGE[30], '',
COM_getBlockTemplate ('_msg_block', 'header'));
--- 128,133 ----
COM_errorLog ("Backup Error: Bad path or mysqldump does not exist", 1);
COM_errorLog ("Command used for mysqldump: $command", 1);
! }
! } else {
$display .= COM_startBlock ($MESSAGE[30], '',
COM_getBlockTemplate ('_msg_block', 'header'));
***************
*** 134,138 ****
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
COM_errorLog ("Backup directory '" . $_CONF['backup_path'] . "' does not exist or is not a directory", 1);
! }
}
--- 135,139 ----
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
COM_errorLog ("Backup directory '" . $_CONF['backup_path'] . "' does not exist or is not a directory", 1);
! }
}
***************
*** 151,155 ****
clearstatcache();
$backups[] = $file;
! }
}
if (is_array($backups) AND $index > 0) {
--- 152,156 ----
clearstatcache();
$backups[] = $file;
! }
}
if (is_array($backups) AND $index > 0) {
***************
*** 184,188 ****
}
! // Show backup form
$display .= $LANG_DB_BACKUP['db_explanation'];
$display .= '<form name="dobackup" method="POST" action="'
--- 185,189 ----
}
! // Show backup form
$display .= $LANG_DB_BACKUP['db_explanation'];
$display .= '<form name="dobackup" method="POST" action="'
More information about the geeklog-cvs
mailing list