View | Details | Raw Unified | Return to bug 8268
Collapse All | Expand All

(-)a/debian/templates/koha-conf-site.xml.in (-1 / +1 lines)
Lines 263-269 Link Here
263
 <intrahtdocs>/usr/share/koha/intranet/htdocs/intranet-tmpl</intrahtdocs>
263
 <intrahtdocs>/usr/share/koha/intranet/htdocs/intranet-tmpl</intrahtdocs>
264
 <includes>/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/includes/</includes>
264
 <includes>/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/includes/</includes>
265
 <logdir>/var/log/koha/__KOHASITE__</logdir>
265
 <logdir>/var/log/koha/__KOHASITE__</logdir>
266
 <backupdir>/var/lib/koha/__KOHASITE__</backupdir>
266
 <backupdir>/var/spool/koha/__KOHASITE__</backupdir>
267
 <!-- Enable the two following to allow superlibrarians to download
267
 <!-- Enable the two following to allow superlibrarians to download
268
      database and configuration dumps (respectively) from the Export
268
      database and configuration dumps (respectively) from the Export
269
      tool -->
269
      tool -->
(-)a/misc/cronjobs/backup.sh (-1 / +5 lines)
Lines 13-19 mysqldump --single-transaction -u koha -ppassword koha | gzip -9 > $KOHA_BACKUP Link Here
13
# Makes the compressed dump file property of the kohaadmin user.
13
# Makes the compressed dump file property of the kohaadmin user.
14
# Make sure that you replace kohaadmin with a real user.
14
# Make sure that you replace kohaadmin with a real user.
15
15
16
[ -f $KOHA_BACKUP] && echo "$KOHA_BACKUP was successfully created." | mail kohaadmin -s $KOHA_BACKUP ||
16
if [ -f $KOHA_BACKUP ] ; then
17
echo "$KOHA_BACKUP was successfully created." | mail kohaadmin -s $KOHA_BACKUP
18
else
17
echo "$KOHA_BACKUP was NOT successfully created." | mail kohaadmin -s $KOHA_BACKUP
19
echo "$KOHA_BACKUP was NOT successfully created." | mail kohaadmin -s $KOHA_BACKUP
20
fi
21
18
# Notifies kohaadmin of (un)successful backup creation
22
# Notifies kohaadmin of (un)successful backup creation
19
# EOF
23
# EOF
(-)a/tools/export.pl (-4 / +8 lines)
Lines 30-35 use C4::Branch; # GetBranches Link Here
30
my $query = new CGI;
30
my $query = new CGI;
31
my $op=$query->param("op") || '';
31
my $op=$query->param("op") || '';
32
my $filename=$query->param("filename");
32
my $filename=$query->param("filename");
33
$filename =~ s/(\r|\n)//;
33
my $dbh=C4::Context->dbh;
34
my $dbh=C4::Context->dbh;
34
my $marcflavour = C4::Context->preference("marcflavour");
35
my $marcflavour = C4::Context->preference("marcflavour");
35
36
Lines 178-184 if ($op eq "export") { Link Here
178
            $successful_export = download_backup( { directory => "$backupdir", extension => 'sql', filename => "$filename" } )
179
            $successful_export = download_backup( { directory => "$backupdir", extension => 'sql', filename => "$filename" } )
179
        }
180
        }
180
        unless ( $successful_export ) {
181
        unless ( $successful_export ) {
181
            warn "A suspicious attempt was made to download the db at '$filename' by someone at " . $query->remote_host() . "\n";
182
            my $remotehost = $query->remote_host();
183
            $remotehost =~ s/(\n|\r)//;
184
            warn "A suspicious attempt was made to download the db at '$filename' by someone at " . $remotehost . "\n";
182
        }
185
        }
183
        exit;
186
        exit;
184
    }
187
    }
Lines 188-194 if ($op eq "export") { Link Here
188
            $successful_export = download_backup( { directory => "$backupdir", extension => 'tar', filename => "$filename" } )
191
            $successful_export = download_backup( { directory => "$backupdir", extension => 'tar', filename => "$filename" } )
189
        }
192
        }
190
        unless ( $successful_export ) {
193
        unless ( $successful_export ) {
191
            warn "A suspicious attempt was made to download the configuration at '$filename' by someone at " . $query->remote_host() . "\n";
194
            my $remotehost = $query->remote_host();
195
            $remotehost =~ s/(\n|\r)//;
196
            warn "A suspicious attempt was made to download the configuration at '$filename' by someone at " . $remotehost . "\n";
192
        }
197
        }
193
        exit;
198
        exit;
194
    }
199
    }
Lines 340-346 sub download_backup { Link Here
340
    my $filename  = $args->{filename};
345
    my $filename  = $args->{filename};
341
346
342
    return unless ( $directory && -d $directory );
347
    return unless ( $directory && -d $directory );
343
    return unless ( $filename =~ m/$extension(\.(gz|bz2|xz))?$/ && not $filename =~ m#(^\.\.|/)# );
348
    return unless ( $filename =~ m/$extension(\.(gz|bz2|xz))?$/ && not $filename =~ m#|# );
344
    $filename = "$directory/$filename";
349
    $filename = "$directory/$filename";
345
    return unless ( -f $filename && -o $filename );
350
    return unless ( -f $filename && -o $filename );
346
    return unless ( open(my $dump, '<', $filename) );
351
    return unless ( open(my $dump, '<', $filename) );
347
- 

Return to bug 8268