diff -u slbackup-php-0.3/debian/changelog slbackup-php-0.3/debian/changelog --- slbackup-php-0.3/debian/changelog +++ slbackup-php-0.3/debian/changelog @@ -1,3 +1,18 @@ +slbackup-php (0.3-2.2+squeeze1) stable; urgency=low + + * Non-maintainer upload. + * Enable quilt patch system. Bump Standards-Version from 3.7.3 to 3.9.2. + * Patch src/index.php. Fixes reappearing login page on every click + (closes: #655832). + * Patch src/index.php and templates/restore.tpl. Allows restore + of files with blanks in their name. Closes: #565181. + Patch provided by Cyril ETCHEVERRIA -> thanks! + * Patch templates/status.tpl. For last failed backup really show the + timestamp of the last failed backup and not erroneously the timestamp + of the last successful backup. + + -- Mike Gabriel Sat, 21 Jan 2012 23:08:18 +0100 + slbackup-php (0.3-2.2) unstable; urgency=low * Non-maintainer upload. only in patch2: unchanged: --- slbackup-php-0.3.orig/templates/status.tpl +++ slbackup-php-0.3/templates/status.tpl @@ -29,7 +29,7 @@ {if $values.ok > $values.failed } {t 1=$values.ok|date_format:"%c"}OK at %1{/t} {elseif $values.failed <> ''} - {t 1=$values.ok|date_format:"%c"}Failed at %1{/t} + {t 1=$values.failed|date_format:"%c"}Failed at %1{/t} {elseif $values.started == ''} {t}Client never backed up{/t} {/if} only in patch2: unchanged: --- slbackup-php-0.3.orig/templates/restore.tpl +++ slbackup-php-0.3/templates/restore.tpl @@ -42,13 +42,13 @@ [   ] {/if} {if $dir.type == "file"} - {$dir.name} + {$dir.name} {elseif $dir.type == "delfile"} - {$dir.name}(deleted) + {$dir.name}(deleted) {elseif $dir.type == deldir} - {$dir.name} ({t}Deleted{/t}) + {$dir.name} ({t}Deleted{/t}) {else} - {$dir.name} + {$dir.name} {/if}
{/foreach} @@ -59,13 +59,13 @@ [   ] {/if} {if $version.type == "parent"} - {$version.name} + {$version.name} {elseif $version.type == "currentfile"} - current + current {elseif $version.type == "diff.gz"} - {$version.ts} + {$version.ts} {elseif $version.type == "snapshot.gz"} - {$version.ts} + {$version.ts} {else} unknown snapshot type $version.type {/if} only in patch2: unchanged: --- slbackup-php-0.3.orig/src/index.php +++ slbackup-php-0.3/src/index.php @@ -71,7 +71,7 @@ function removesnapshots ($passwd, $clientdir, $snapshot) { global $backuphost, $backupuser, $ssh_options, $ssh_askpass ; - $cmd = sprintf ("ssh %s %s@%s 'rdiff-backup --force --remove-older-than %s %s'", + $cmd = sprintf ("ssh %s %s@%s 'rdiff-backup --force --remove-older-than %s \"%s\"'", $ssh_options, $backupuser, $backuphost, $snapshot, $clientdir) ; @@ -98,7 +98,7 @@ function listsnapshots ($passwd, $clientdir) { global $backuphost, $backupuser, $ssh_options, $ssh_askpass ; - $cmd = sprintf ("ssh %s %s@%s 'find %s/rdiff-backup-data -maxdepth 1 -name \"increments.*\" -printf %s'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s/rdiff-backup-data\" -maxdepth 1 -name \"increments.*\" -printf %s'", $ssh_options, $backupuser, $backuphost, $clientdir, '"%P\n"') ; @@ -126,7 +126,7 @@ function fetchfile ($passwd, $clientdir, $location, $file) { global $backuphost, $backupuser, $ssh_options, $ssh_askpass ; - $cmd = sprintf ("ssh %s %s@%s 'cat %s%s/%s'", + $cmd = sprintf ("ssh %s %s@%s 'cat \"%s%s/%s\"'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $file ) ; @@ -169,7 +169,7 @@ } else unset ($tempfile) ; if (empty($tempfile)) return ; - $cmd = sprintf ("ssh %s %s@%s 'rdiff-backup --force %s/rdiff-backup-data/increments%s/%s %s'", + $cmd = sprintf ("ssh %s %s@%s 'rdiff-backup --force \"%s/rdiff-backup-data/increments%s/%s %s\"'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $file, $tempfile ) ; @@ -180,7 +180,7 @@ fclose ($pipes[1]) ; proc_close ($proc) ; } - $cmd = sprintf ("ssh %s %s@%s 'cat %s && rm %s'", + $cmd = sprintf ("ssh %s %s@%s 'cat \"%s\" && rm \"%s\"'", $ssh_options, $backupuser, $backuphost, $tempfile, $tempfile) ; $proc = proc_open ($cmd, $desc, $pipes, '/tmp', $env) ; @@ -213,7 +213,7 @@ $env = array ('SSH_ASKPASS' => $ssh_askpass, 'DISPLAY' => ':nowhere') ; - $cmd = sprintf ("ssh %s %s@%s 'find %s%s/%s -maxdepth 1 -mindepth 1 -type f -name %s'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s%s/%s\" -maxdepth 1 -mindepth 1 -type f -name \"%s\"'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $parent, $base ) ; $proc = proc_open ($cmd, $desc, $pipes, '/tmp', $env) ; @@ -230,7 +230,7 @@ proc_close ($proc) ; } $baselen= strlen ($base) ; - $cmd = sprintf ("ssh %s %s@%s 'find %s/rdiff-backup-data/increments%s/%s -maxdepth 1 -mindepth 1 -type f -name \"%s*.gz\"'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s/rdiff-backup-data/increments%s/%s\" -maxdepth 1 -mindepth 1 -type f -name \"%s*.gz\"'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $parent, $base ) ; @@ -283,7 +283,7 @@ $env = array ('SSH_ASKPASS' => $ssh_askpass, 'DISPLAY' => ':nowhere') ; - $cmd = sprintf ("ssh %s %s@%s 'find %s%s/%s -maxdepth 1 -mindepth 1 -type d'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s%s/%s\" -maxdepth 1 -mindepth 1 -type d'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $sub ) ; $proc = proc_open ($cmd, $desc, $pipes, '/tmp', $env) ; @@ -299,7 +299,7 @@ fclose ($pipes[1]) ; proc_close ($proc) ; } - $cmd = sprintf ("ssh %s %s@%s 'find %s/rdiff-backup-data/increments%s/%s -maxdepth 1 -mindepth 1 -type d'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s/rdiff-backup-data/increments%s/%s\" -maxdepth 1 -mindepth 1 -type d'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $sub ) ; $proc = proc_open ($cmd, $desc, $pipes, '/tmp', $env) ; @@ -322,7 +322,7 @@ fclose ($pipes[1]) ; proc_close ($proc) ; } - $cmd = sprintf ("ssh %s %s@%s 'find %s%s/%s -maxdepth 1 -mindepth 1 -type f'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s%s/%s\" -maxdepth 1 -mindepth 1 -type f'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $sub ) ; @@ -339,7 +339,7 @@ fclose ($pipes[1]) ; proc_close ($proc) ; } - $cmd = sprintf ("ssh %s %s@%s 'find %s/rdiff-backup-data/increments%s/%s -maxdepth 1 -mindepth 1 -type f -name \"*.snapshot.gz\"'", + $cmd = sprintf ("ssh %s %s@%s 'find \"%s/rdiff-backup-data/increments%s/%s\" -maxdepth 1 -mindepth 1 -type f -name \"*.snapshot.gz\"'", $ssh_options, $backupuser, $backuphost, $clientdir, $location, $sub ) ; $proc = proc_open ($cmd, $desc, $pipes, '/tmp', $env) ; @@ -570,21 +570,33 @@ loadConfig () ; require('/usr/share/php/smarty/libs/Smarty.class.php') ; session_start() ; -$authenticated = ($_COOKIE['Authenticated'] == "True") ; loadLocale () ; ob_start (); $smarty = new Smarty(); $smarty->template_dir = $smarty_templ ; $smarty->compile_dir = $smarty_compile ; +unset ($_COOKIE['smarty_templ']); +unset ($_COOKIE['smarty_compile']); # fetch script to use whith passing the ssh-password $ssh_askpass = sprintf ("%s/script/mypass.sh", dirname (dirname ($_SERVER["SCRIPT_FILENAME"]))); +$arguments = $_REQUEST; + +# merge _COOKIE and _REQUEST +$allowed_cookie_keys = array('nonhttps', 'xorstring', 'PHPSESSID', 'locale',); +foreach ($_COOKIE as $key => $value) { + if ((! array_key_exists($key, $arguments)) && (in_array($key, $allowed_cookie_keys))) { + if (is_string($key) && is_string($value)) { + $arguments[$key] = $value; + } + } +} # Fetch arguments passed as the script is executed -foreach ($_REQUEST as $key => $value) { +foreach ($arguments as $key => $value) { switch ($key) { case "smarty_templ": case "smarty_compile": @@ -597,7 +609,7 @@ break ; case "xorstring": if (empty($passwd)) - $xorstring = $value ; + $xorstring = base64_decode($value) ; else break ; if (empty ($value)) break ; @@ -640,6 +652,8 @@ } } +unset ($arguments); + if ($submit == "logout") { unset ($passwd) ; unset ($xorstring) ; @@ -666,7 +680,7 @@ $xorstring = xorstring ($encrypt, $passwd) ; } -setcookie ('xorstring', $xorstring) ; +setcookie ('xorstring', base64_encode($xorstring)) ; $scheduler = readcron ($passwd) ;