summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2008-07-24 15:55:10 +0200
committerReinhard Tartler <siretart@tauware.de>2008-07-24 15:55:10 +0200
commit0a8bacbd28bb16083fa249aa167420a59e197530 (patch)
treefb52784c6fc8804f1e8c374f5be667b3a6aae4a2
parent2d787f014e787e789fe63c4056aa14e767f576e2 (diff)
remove more generated files
-rwxr-xr-xbin/bbackupd/bbackupd-config640
-rwxr-xr-xbin/bbackupquery/makedocumentation.pl114
-rwxr-xr-xbin/bbstored/bbstored-certs358
-rwxr-xr-xbin/bbstored/bbstored-config284
-rw-r--r--lib/common/BoxConfig.h476
-rwxr-xr-xlib/common/BoxPortsAndFiles.h79
-rwxr-xr-xlib/common/makeexception.pl316
-rwxr-xr-xlib/raidfile/raidfile-config139
-rwxr-xr-xlib/server/makeprotocol.pl1087
-rwxr-xr-xtest/backupstorefix/testfiles/testbackupstorefix.pl252
-rwxr-xr-xtest/bbackupd/testfiles/extcheck1.pl90
-rwxr-xr-xtest/bbackupd/testfiles/extcheck2.pl86
-rwxr-xr-xtest/bbackupd/testfiles/notifyscript.pl54
-rwxr-xr-xtest/bbackupd/testfiles/syncallowscript.pl72
14 files changed, 0 insertions, 4047 deletions
diff --git a/bin/bbackupd/bbackupd-config b/bin/bbackupd/bbackupd-config
deleted file mode 100755
index 37847d7e..00000000
--- a/bin/bbackupd/bbackupd-config
+++ /dev/null
@@ -1,640 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-# should be running as root
-if($> != 0)
-{
- printf "\nWARNING: this should be run as root\n\n"
-}
-
-sub error_print_usage
-{
- print <<__E;
-
-Setup bbackupd config utility.
-
-Bad command line parameters.
-Usage:
- bbackupd-config config-dir backup-mode account-num server-hostname
- working-dir [backup directories]
-
-Parameters:
- config-dir is usually /etc/box
- backup-mode is lazy or snapshot:
- lazy mode runs continously, uploading files over a specified age
- snapshot mode uploads a snapshot of the filesystem when instructed
- explicitly, using bbackupctl sync
- account-num (hexdecimal) and server-hostname
- are supplied by the server administrator
- working-dir is usually /var/run
- backup directories is list of directories to back up
-
-__E
- print "=========\nERROR:\n",$_[0],"\n\n" if $_[0] ne '';
- exit(1);
-}
-
-# check and get command line parameters
-if($#ARGV < 4)
-{
- error_print_usage();
-}
-
-# check for OPENSSL_CONF environment var being set
-if(exists $ENV{'OPENSSL_CONF'})
-{
- print <<__E;
-
----------------------------------------
-
-WARNING:
- You have the OPENSSL_CONF environment variable set.
- Use of non-standard openssl configs may cause problems.
-
----------------------------------------
-
-__E
-}
-
-# default locations
-my $default_config_location = '/etc/box/bbackupd.conf';
-
-# command line parameters
-my ($config_dir,$backup_mode,$account_num,$server,$working_dir,@tobackup) = @ARGV;
-
-# check backup mode is valid
-if($backup_mode ne 'lazy' && $backup_mode ne 'snapshot')
-{
- error_print_usage("ERROR: backup mode must be 'lazy' or 'snapshot'");
-}
-
-# check server exists
-{
- my @r = gethostbyname($server);
- if($#r < 0)
- {
- error_print_usage("Backup server specified as '$server', but it could not found.\n(A test DNS lookup failed -- check arguments)");
- }
-}
-
-if($working_dir !~ m~\A/~)
-{
- error_print_usage("Working directory $working_dir is not specified as an absolute path");
-}
-
-# ssl stuff
-my $private_key = "$config_dir/bbackupd/$account_num-key.pem";
-my $certificate_request = "$config_dir/bbackupd/$account_num-csr.pem";
-my $certificate = "$config_dir/bbackupd/$account_num-cert.pem";
-my $ca_root_cert = "$config_dir/bbackupd/serverCA.pem";
-
-# encryption keys
-my $enc_key_file = "$config_dir/bbackupd/$account_num-FileEncKeys.raw";
-
-# other files
-my $config_file = "$config_dir/bbackupd.conf";
-my $notify_script = "$config_dir/bbackupd/NotifySysadmin.sh";
-
-# check that the directories are allowable
-for(@tobackup)
-{
- if($_ eq '/')
- {
- die "It is not recommended that you backup the root directory of your disc";
- }
- if($_ !~ m/\A\//)
- {
- die "Directory $_ is not specified as an absolute path";
- }
- if(!-d $_)
- {
- die "$_ is not a directory";
- }
-}
-
-# summarise configuration
-
-print <<__E;
-
-Setup bbackupd config utility.
-
-Configuration:
- Writing configuration file: $config_file
- Account: $account_num
- Server hostname: $server
- Directories to back up:
-__E
-print ' ',$_,"\n" for(@tobackup);
-print <<__E;
-
-Note: If other file systems are mounted inside these directories, then
-they will NOT be backed up. You will have to create separate locations for
-any mounted filesystems inside your backup locations.
-
-__E
-
-# create directories
-if(!-d $config_dir)
-{
- printf "Creating $config_dir...\n";
- mkdir $config_dir,0755 or die "Can't create $config_dir";
-}
-
-if(!-d "$config_dir/bbackupd")
-{
- printf "Creating $config_dir/bbackupd\n";
- mkdir "$config_dir/bbackupd",0700 or die "Can't create $config_dir/bbackupd";
-}
-
-if(!-d "$working_dir")
-{
- printf "Creating $working_dir\n";
- if(!mkdir($working_dir,0700))
- {
- die "Couldn't create $working_dir -- create this manually and try again\n";
- }
-}
-
-# generate the private key for the server
-if(!-f $private_key)
-{
- print "Generating private key...\n";
- if(system("openssl genrsa -out $private_key 2048") != 0)
- {
- die "Couldn't generate private key."
- }
-}
-
-# generate a certificate request
-if(!-f $certificate_request)
-{
- die "Couldn't run openssl for CSR generation" unless
- open(CSR,"|openssl req -new -key $private_key -sha1 -out $certificate_request");
- print CSR <<__E;
-.
-.
-.
-.
-.
-BACKUP-$account_num
-.
-.
-.
-
-__E
- close CSR;
- print "\n\n";
- die "Certificate request wasn't created.\n" unless -f $certificate_request
-}
-
-# generate the key material for the file
-if(!-f $enc_key_file)
-{
- print "Generating keys for file backup\n";
- if(system("openssl rand -out $enc_key_file 1024") != 0)
- {
- die "Couldn't generate file backup keys."
- }
-}
-
-# write the notify when store full script
-print "Writing notify script $notify_script\n";
-open NOTIFY,">$notify_script" or die "Can't open for writing";
-
-my $hostname = `hostname`; chomp $hostname;
-my $current_username = `whoami`; chomp $current_username;
-my $sendmail = `whereis sendmail`; chomp $sendmail;
-$sendmail =~ s/\n.\Z//s;
-# for Linux style whereis
-$sendmail = $1 if $sendmail =~ /^sendmail:\s+([\S]+)/;
-# last ditch guess
-$sendmail = 'sendmail' if $sendmail !~ m/\S/;
-
-print NOTIFY <<__EOS;
-#!/bin/sh
-
-# This script is run whenever bbackupd changes state or encounters a
-# problem which requires the system administrator to assist:
-#
-# 1) The store is full, and no more data can be uploaded.
-# 2) Some files or directories were not readable.
-# 3) A backup run starts or finishes.
-#
-# The default script emails the system administrator, except for backups
-# starting and stopping, where it does nothing.
-
-SUBJECT="BACKUP PROBLEM on host $hostname"
-SENDTO="$current_username"
-
-if [ "\$1" = "" ]; then
- echo "Usage: $0 <store-full|read-error|backup-error|backup-start|backup-finish>" >&2
- exit 2
-elif [ "\$1" = store-full ]; then
- $sendmail \$SENDTO <<EOM
-Subject: \$SUBJECT (store full)
-To: \$SENDTO
-
-
-The store account for $hostname is full.
-
-=============================
-FILES ARE NOT BEING BACKED UP
-=============================
-
-Please adjust the limits on account $account_num on server $server.
-
-EOM
-elif [ "\$1" = read-error ]; then
-$sendmail \$SENDTO <<EOM
-Subject: \$SUBJECT (read errors)
-To: \$SENDTO
-
-
-Errors occured reading some files or directories for backup on $hostname.
-
-===================================
-THESE FILES ARE NOT BEING BACKED UP
-===================================
-
-Check the logs on $hostname for the files and directories which caused
-these errors, and take appropriate action.
-
-Other files are being backed up.
-
-EOM
-elif [ "\$1" = backup-start -o "\$1" = backup-finish ]; then
- # do nothing by default
- true
-else
-$sendmail \$SENDTO <<EOM
-Subject: \$SUBJECT (unknown)
-To: \$SENDTO
-
-
-The backup daemon on $hostname reported an unknown error (\$1).
-
-==========================
-FILES MAY NOT BE BACKED UP
-==========================
-
-Please check the logs on $hostname.
-
-EOM
-fi
-__EOS
-
-close NOTIFY;
-chmod 0700,$notify_script or die "Can't chmod $notify_script";
-
-
-# write the configuration file
-print "Writing configuration file $config_file\n";
-open CONFIG,">$config_file" or die "Can't open config file for writing";
-print CONFIG <<__E;
-
-StoreHostname = $server
-AccountNumber = 0x$account_num
-KeysFile = $enc_key_file
-
-CertificateFile = $certificate
-PrivateKeyFile = $private_key
-TrustedCAsFile = $ca_root_cert
-
-DataDirectory = $working_dir
-
-
-# This script is run whenever bbackupd changes state or encounters a
-# problem which requires the system administrator to assist:
-#
-# 1) The store is full, and no more data can be uploaded.
-# 2) Some files or directories were not readable.
-# 3) A backup run starts or finishes.
-#
-# The default script emails the system administrator, except for backups
-# starting and stopping, where it does nothing.
-
-NotifyScript = $notify_script
-
-__E
-
-if($backup_mode eq 'lazy')
-{
- # lazy mode configuration
- print CONFIG <<__E;
-
-# The number of seconds between backup runs under normal conditions. To avoid
-# cycles of load on the server, this time is randomly adjusted by a small
-# percentage as the daemon runs.
-
-UpdateStoreInterval = 3600
-
-
-# The minimum age of a file, in seconds, that will be uploaded. Avoids
-# repeated uploads of a file which is constantly being modified.
-
-MinimumFileAge = 21600
-
-
-# If a file is modified repeated, it won't be uploaded immediately in case
-# it's modified again, due to the MinimumFileAge specified above. However, it
-# should be uploaded eventually even if it is being modified repeatedly. This
-# is how long we should wait, in seconds, after first noticing a change.
-# (86400 seconds = 1 day)
-
-MaxUploadWait = 86400
-
-# If the connection is idle for some time (e.g. over 10 minutes or 600
-# seconds, not sure exactly how long) then the server will give up and
-# disconnect the client, resulting in Connection Protocol_Timeout errors
-# on the server and TLSReadFailed or TLSWriteFailed errors on the client.
-# Also, some firewalls and NAT gateways will kill idle connections after
-# similar lengths of time.
-#
-# This can happen for example when most files are backed up already and
-# don't need to be sent to the store again, while scanning a large
-# directory, or while calculating diffs of a large file. To avoid this,
-# KeepAliveTime specifies that special keep-alive messages should be sent
-# when the connection is otherwise idle for a certain length of time,
-# specified here in seconds.
-#
-# The default is that these messages are never sent, equivalent to setting
-# this option to zero, but we recommend that all users enable this.
-
-KeepAliveTime = 120
-
-__E
-}
-else
-{
- # snapshot configuration
- print CONFIG <<__E;
-
-# This configuration file is written for snapshot mode.
-# You will need to run bbackupctl to instruct the daemon to upload files.
-
-AutomaticBackup = no
-UpdateStoreInterval = 0
-MinimumFileAge = 0
-MaxUploadWait = 0
-
-__E
-}
-
-print CONFIG <<__E;
-
-# Files above this size (in bytes) are tracked, and if they are renamed they will simply be
-# renamed on the server, rather than being uploaded again. (64k - 1)
-
-FileTrackingSizeThreshold = 65535
-
-
-# The daemon does "changes only" uploads for files above this size (in bytes).
-# Files less than it are uploaded whole without this extra processing.
-
-DiffingUploadSizeThreshold = 8192
-
-
-# The limit on how much time is spent diffing files, in seconds. Most files
-# shouldn't take very long, but if you have really big files you can use this
-# to limit the time spent diffing them.
-#
-# * Reduce if you are having problems with processor usage.
-#
-# * Increase if you have large files, and think the upload of changes is too
-# large and you want bbackupd to spend more time searching for unchanged
-# blocks.
-
-MaximumDiffingTime = 120
-
-
-# Uncomment this line to see exactly what the daemon is going when it's connected to the server.
-
-# ExtendedLogging = yes
-
-
-# This specifies a program or script script which is run just before each
-# sync, and ideally the full path to the interpreter. It will be run as the
-# same user bbackupd is running as, usually root.
-#
-# The script must output (print) either "now" or a number to STDOUT (and a
-# terminating newline, no quotes).
-#
-# If the result was "now", then the sync will happen. If it's a number, then
-# no backup will happen for that number of seconds (bbackupd will pause) and
-# then the script will be run again.
-#
-# Use this to temporarily stop bbackupd from syncronising or connecting to the
-# store. For example, you could use this on a laptop to only backup when on a
-# specific network, or when it has a working Internet connection.
-
-# SyncAllowScript = /path/to/intepreter/or/exe script-name parameters etc
-
-
-# Where the command socket is created in the filesystem.
-
-CommandSocket = $working_dir/bbackupd.sock
-
-# Uncomment the StoreObjectInfoFile to enable the experimental archiving
-# of the daemon's state (including client store marker and configuration)
-# between backup runs. This saves time and increases efficiency when
-# bbackupd is frequently stopped and started, since it removes the need
-# to rescan all directories on the remote server. However, it is new and
-# not yet heavily tested, so use with caution.
-
-# StoreObjectInfoFile = $working_dir/bbackupd.state
-
-Server
-{
- PidFile = $working_dir/bbackupd.pid
-}
-
-
-# BackupLocations specifies which locations on disc should be backed up. Each
-# directory is in the format
-#
-# name
-# {
-# Path = /path/of/directory
-# (optional exclude directives)
-# }
-#
-# 'name' is derived from the Path by the config script, but should merely be
-# unique.
-#
-# The exclude directives are of the form
-#
-# [Exclude|AlwaysInclude][File|Dir][|sRegex] = regex or full pathname
-#
-# (The regex suffix is shown as 'sRegex' to make File or Dir plural)
-#
-# For example:
-#
-# ExcludeDir = /home/guest-user
-# ExcludeFilesRegex = \.(mp3|MP3)\$
-# AlwaysIncludeFile = /home/username/veryimportant.mp3
-#
-# This excludes the directory /home/guest-user from the backup along with all mp3
-# files, except one MP3 file in particular.
-#
-# In general, Exclude excludes a file or directory, unless the directory is
-# explicitly mentioned in a AlwaysInclude directive. However, Box Backup
-# does NOT scan inside excluded directories and will never back up an
-# AlwaysIncluded file or directory inside an excluded directory or any
-# subdirectory thereof.
-#
-# To back up a directory inside an excluded directory, use a configuration
-# like this, to ensure that each directory in the path to the important
-# files is included, but none of their contents will be backed up except
-# the directories further down that path to the important one.
-#
-# ExcludeDirsRegex = ^/home/user/bigfiles/
-# ExcludeFilesRegex = ^/home/user/bigfiles/
-# AlwaysIncludeDir = /home/user/bigfiles/path
-# AlwaysIncludeDir = /home/user/bigfiles/path/to
-# AlwaysIncludeDir = /home/user/bigfiles/path/important
-# AlwaysIncludeDir = /home/user/bigfiles/path/important/files
-# AlwaysIncludeDirsRegex = ^/home/user/bigfiles/path/important/files/
-# AlwaysIncludeFilesRegex = ^/home/user/bigfiles/path/important/files/
-#
-# If a directive ends in Regex, then it is a regular expression rather than a
-# explicit full pathname. See
-#
-# man 7 re_format
-#
-# for the regex syntax on your platform.
-
-BackupLocations
-{
-__E
-
-# write the dirs to backup
-for my $d (@tobackup)
-{
- $d =~ m/\A.(.+)\Z/;
- my $n = $1;
- $n =~ tr`/`-`;
-
- my $excludekeys = '';
- if(substr($enc_key_file, 0, length($d)+1) eq $d.'/')
- {
- $excludekeys = "\t\tExcludeFile = $enc_key_file\n";
- print <<__E;
-
-NOTE: Keys file has been explicitly excluded from the backup.
-
-__E
- }
-
- print CONFIG <<__E
- $n
- {
- Path = $d
-$excludekeys }
-__E
-}
-
-print CONFIG "}\n\n";
-close CONFIG;
-
-# explain to the user what they need to do next
-my $daemon_args = ($config_file eq $default_config_location)?'':" $config_file";
-my $ctl_daemon_args = ($config_file eq $default_config_location)?'':" -c $config_file";
-
-print <<__E;
-
-===================================================================
-
-bbackupd basic configuration complete.
-
-What you need to do now...
-
-1) Make a backup of $enc_key_file
- This should be a secure offsite backup.
- Without it, you cannot restore backups. Everything else can
- be replaced. But this cannot.
- KEEP IT IN A SAFE PLACE, OTHERWISE YOUR BACKUPS ARE USELESS.
-
-2) Send $certificate_request
- to the administrator of the backup server, and ask for it to
- be signed.
-
-3) The administrator will send you two files. Install them as
- $certificate
- $ca_root_cert
- after checking their authenticity.
-
-4) You may wish to read the configuration file
- $config_file
- and adjust as appropriate.
-
- There are some notes in it on excluding files you do not
- wish to be backed up.
-
-5) Review the script
- $notify_script
- and check that it will email the right person when the store
- becomes full. This is important -- when the store is full, no
- more files will be backed up. You want to know about this.
-
-6) Start the backup daemon with the command
- /usr/local/bin/bbackupd$daemon_args
- in /etc/rc.local, or your local equivalent.
- Note that bbackupd must run as root.
-__E
-if($backup_mode eq 'snapshot')
-{
- print <<__E;
-
-7) Set up a cron job to run whenever you want a snapshot of the
- file system to be taken. Run the command
- /usr/local/bin/bbackupctl -q$ctl_daemon_args sync
-__E
-}
-print <<__E;
-
-===================================================================
-
-Remember to make a secure, offsite backup of your backup keys,
-as described in step 1 above. If you do not, you have no backups.
-
-__E
-
diff --git a/bin/bbackupquery/makedocumentation.pl b/bin/bbackupquery/makedocumentation.pl
deleted file mode 100755
index 4c986441..00000000
--- a/bin/bbackupquery/makedocumentation.pl
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-print "Creating built-in documentation for bbackupquery...\n";
-
-open DOC,"documentation.txt" or die "Can't open documentation.txt file";
-my $section;
-my %help;
-my @in_order;
-
-while(<DOC>)
-{
- if(m/\A>\s+(\w+)/)
- {
- $section = $1;
- m/\A>\s+(.+)\Z/;
- $help{$section} = $1."\n";
- push @in_order,$section;
- }
- elsif(m/\A</)
- {
- $section = '';
- }
- elsif($section ne '')
- {
- $help{$section} .= $_;
- }
-}
-
-close DOC;
-
-open OUT,">autogen_Documentation.cpp" or die "Can't open output file for writing";
-
-print OUT <<__E;
-//
-// Automatically generated file, do not edit.
-//
-
-#include "Box.h"
-
-#include "MemLeakFindOn.h"
-
-const char *help_commands[] =
-{
-__E
-
-for(@in_order)
-{
- print OUT qq:\t"$_",\n:;
-}
-
-print OUT <<__E;
- 0
-};
-
-const char *help_text[] =
-{
-__E
-
-for(@in_order)
-{
- my $t = $help{$_};
- $t =~ s/\t/ /g;
- $t =~ s/\n/\\n/g;
- $t =~ s/"/\\"/g;
- print OUT qq:\t"$t",\n:;
-}
-
-print OUT <<__E;
- 0
-};
-
-__E
-
-close OUT;
diff --git a/bin/bbstored/bbstored-certs b/bin/bbstored/bbstored-certs
deleted file mode 100755
index 0ef8b325..00000000
--- a/bin/bbstored/bbstored-certs
+++ /dev/null
@@ -1,358 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-# validity period for root certificates -- default is a very long time
-my $root_sign_period = '10000';
-
-# but less so for client certificates
-my $sign_period = '5000';
-
-# check and get command line parameters
-if($#ARGV < 1)
-{
- print <<__E;
-
-bbstored certificates utility.
-
-Bad command line parameters.
-Usage:
- bbstored-certs certs-dir command [arguments]
-
-certs-dir is the directory holding the root keys and certificates for the backup system
-command is the action to perform, taking parameters.
-
-Commands are
-
- init
- -- generate initial root certificates (certs-dir must not already exist)
- sign certificate-name
- -- sign a client certificate
- sign-server certificate-name
- -- sign a server certificate
-
-Signing requires confirmation that the certificate is correct and should be signed.
-
-__E
- exit(1);
-}
-
-# check for OPENSSL_CONF environment var being set
-if(exists $ENV{'OPENSSL_CONF'})
-{
- print <<__E;
-
----------------------------------------
-
-WARNING:
- You have the OPENSSL_CONF environment variable set.
- Use of non-standard openssl configs may cause problems.
-
----------------------------------------
-
-__E
-}
-
-# directory structure:
-#
-# roots/
-# clientCA.pem -- root certificate for client (used on server)
-# serverCA.pem -- root certificate for servers (used on clients)
-# keys/
-# clientRootKey.pem -- root key for clients
-# serverRootKey.pem -- root key for servers
-# servers/
-# hostname.pem -- certificate for server 'hostname'
-# clients/
-# account.pem -- certficiate for account 'account' (ID in hex)
-#
-
-
-# check parameters
-my ($cert_dir,$command,@args) = @ARGV;
-
-# check directory exists
-if($command ne 'init')
-{
- if(!-d $cert_dir)
- {
- die "$cert_dir does not exist";
- }
-}
-
-# run command
-if($command eq 'init') {&cmd_init;}
-elsif($command eq 'sign') {&cmd_sign;}
-elsif($command eq 'sign-server') {&cmd_sign_server;}
-else
-{
- die "Unknown command $command"
-}
-
-sub cmd_init
-{
- # create directories
- unless(mkdir($cert_dir,0700)
- && mkdir($cert_dir.'/roots',0700)
- && mkdir($cert_dir.'/keys',0700)
- && mkdir($cert_dir.'/servers',0700)
- && mkdir($cert_dir.'/clients',0700))
- {
- die "Failed to create directory structure"
- }
-
- # create root keys and certrs
- cmd_init_create_root('client');
- cmd_init_create_root('server');
-}
-
-sub cmd_init_create_root
-{
- my $entity = $_[0];
-
- my $cert = "$cert_dir/roots/".$entity.'CA.pem';
- my $serial = "$cert_dir/roots/".$entity.'CA.srl';
- my $key = "$cert_dir/keys/".$entity.'RootKey.pem';
- my $csr = "$cert_dir/keys/".$entity.'RootCSR.pem';
-
- # generate key
- if(system("openssl genrsa -out $key 2048") != 0)
- {
- die "Couldn't generate private key."
- }
-
- # make CSR
- die "Couldn't run openssl for CSR generation" unless
- open(CSR,"|openssl req -new -key $key -sha1 -out $csr");
- print CSR <<__E;
-.
-.
-.
-.
-.
-Backup system $entity root
-.
-.
-.
-
-__E
- close CSR;
- print "\n\n";
- die "Certificate request wasn't created.\n" unless -f $csr;
-
- # sign it to make a self-signed root CA key
- if(system("openssl x509 -req -in $csr -sha1 -extensions v3_ca -signkey $key -out $cert -days $root_sign_period") != 0)
- {
- die "Couldn't generate root certificate."
- }
-
- # write the initial serial number
- open SERIAL,">$serial" or die "Can't open $serial for writing";
- print SERIAL "00\n";
- close SERIAL;
-}
-
-sub cmd_sign
-{
- my $csr = $args[0];
-
- if(!-f $csr)
- {
- die "$csr does not exist";
- }
-
- # get the common name specified in this certificate
- my $common_name = get_csr_common_name($csr);
-
- # look OK?
- unless($common_name =~ m/\ABACKUP-([A-Fa-f0-9]+)\Z/)
- {
- die "The certificate presented does not appear to be a backup client certificate"
- }
-
- my $acc = $1;
-
- # check against filename
- if(!($csr =~ m/(\A|\/)([A-Fa-f0-9]+)-/) || $2 ne $acc)
- {
- die "Certificate request filename does not match name in certificate ($common_name)"
- }
-
- print <<__E;
-
-This certificate is for backup account
-
- $acc
-
-Ensure this matches the account number you are expecting. The filename is
-
- $csr
-
-which should include this account number, and additionally, you should check
-that you received it from the right person.
-
-Signing the wrong certificate compromises the security of your backup system.
-
-Would you like to sign this certificate? (type 'yes' to confirm)
-__E
-
- return unless get_confirmation();
-
- # out certificate
- my $out_cert = "$cert_dir/clients/$acc"."-cert.pem";
-
- # sign it!
- if(system("openssl x509 -req -in $csr -sha1 -extensions usr_crt -CA $cert_dir/roots/clientCA.pem -CAkey $cert_dir/keys/clientRootKey.pem -out $out_cert -days $sign_period") != 0)
- {
- die "Signing failed"
- }
-
- # tell user what to do next
- print <<__E;
-
-
-Certificate signed.
-
-Send the files
-
- $out_cert
- $cert_dir/roots/serverCA.pem
-
-to the client.
-
-__E
-}
-
-sub cmd_sign_server
-{
- my $csr = $args[0];
-
- if(!-f $csr)
- {
- die "$csr does not exist";
- }
-
- # get the common name specified in this certificate
- my $common_name = get_csr_common_name($csr);
-
- # look OK?
- if($common_name !~ m/\A[-a-zA-Z0-9.]+\Z/)
- {
- die "Invalid server name"
- }
-
- print <<__E;
-
-This certificate is for backup server
-
- $common_name
-
-Signing the wrong certificate compromises the security of your backup system.
-
-Would you like to sign this certificate? (type 'yes' to confirm)
-__E
-
- return unless get_confirmation();
-
- # out certificate
- my $out_cert = "$cert_dir/servers/$common_name"."-cert.pem";
-
- # sign it!
- if(system("openssl x509 -req -in $csr -sha1 -extensions usr_crt -CA $cert_dir/roots/serverCA.pem -CAkey $cert_dir/keys/serverRootKey.pem -out $out_cert -days $sign_period") != 0)
- {
- die "Signing failed"
- }
-
- # tell user what to do next
- print <<__E;
-
-
-Certificate signed.
-
-Install the files
-
- $out_cert
- $cert_dir/roots/clientCA.pem
-
-on the server.
-
-__E
-}
-
-
-sub get_csr_common_name
-{
- my $csr = $_[0];
-
- open CSRTEXT,"openssl req -text -in $csr |" or die "Can't open openssl for reading";
-
- my $subject;
- while(<CSRTEXT>)
- {
- $subject = $1 if m/Subject:.+?CN=([-\.\w]+)/
- }
- close CSRTEXT;
-
- if($subject eq '')
- {
- die "No subject found in CSR $csr"
- }
-
- return $subject
-}
-
-sub get_confirmation()
-{
- my $line = <STDIN>;
- chomp $line;
- if(lc $line ne 'yes')
- {
- print "CANCELLED\n";
- return 0;
- }
-
- return 1;
-}
-
-
-
-
-
diff --git a/bin/bbstored/bbstored-config b/bin/bbstored/bbstored-config
deleted file mode 100755
index 7f1d7cc8..00000000
--- a/bin/bbstored/bbstored-config
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-# should be running as root
-if($> != 0)
-{
- printf "\nWARNING: this should be run as root\n\n"
-}
-
-# check and get command line parameters
-if($#ARGV < 2)
-{
- print <<__E;
-
-Setup bbstored config utility.
-
-Bad command line parameters.
-Usage:
- bbstored-config config-dir server-hostname username [raidfile-config]
-
-Parameters:
- config-dir is usually /etc/box
- server-hostname is the hostname that clients will use to connect to
- this server
- username is the user to run the server under
- raidfile-config is optional. Use if you have a non-standard
- raidfile.conf file.
-
-__E
- exit(1);
-}
-
-# check for OPENSSL_CONF environment var being set
-if(exists $ENV{'OPENSSL_CONF'})
-{
- print <<__E;
-
----------------------------------------
-
-WARNING:
- You have the OPENSSL_CONF environment variable set.
- Use of non-standard openssl configs may cause problems.
-
----------------------------------------
-
-__E
-}
-
-# default locations
-my $default_config_location = '/etc/box/bbstored.conf';
-
-# command line parameters
-my ($config_dir,$server,$username,$raidfile_config) = @ARGV;
-
-$raidfile_config = $config_dir . '/raidfile.conf' unless $raidfile_config ne '';
-
-# check server exists, but don't bother checking that it's actually this machine.
-{
- my @r = gethostbyname($server);
- if($#r < 0)
- {
- die "Server '$server' not found. (check server name, test DNS lookup failed.)"
- }
-}
-
-# check this exists
-if(!-f $raidfile_config)
-{
- print "The RaidFile configuration file $raidfile_config doesn't exist.\nYou may need to create it with raidfile-config.\nWon't configure bbstored without it.\n";
- exit(1);
-}
-
-# check that the user exists
-die "You shouldn't run bbstored as root" if $username eq 'root';
-my $user_uid = 0;
-(undef,undef,$user_uid) = getpwnam($username);
-if($user_uid == 0)
-{
- die "User $username doesn't exist\n";
-}
-
-# check that directories are writeable
-open RAIDCONF,$raidfile_config or die "Can't open $raidfile_config";
-{
- my %done = ();
- while(<RAIDCONF>)
- {
- next unless m/Dir\d\s*=\s*(.+)/;
- my $d = $1;
- $d = $d.'/backup' if -e $d.'/backup';
- print "Checking permissions on $d\n";
- my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($d);
- my $req_perms = ($uid == $user_uid)?0700:0007;
- if(($mode & $req_perms) != $req_perms)
- {
- print "$username doesn't appear to have the necessary permissions on $d\n";
- print "Either adjust permissions, or create a directory 'backup' inside the\n";
- print "directory specified in raidfile.conf which is writable.\n";
- exit(1);
- }
- }
-}
-close RAIDCONF;
-
-# ssl stuff
-my $private_key = "$config_dir/bbstored/$server-key.pem";
-my $certificate_request = "$config_dir/bbstored/$server-csr.pem";
-my $certificate = "$config_dir/bbstored/$server-cert.pem";
-my $ca_root_cert = "$config_dir/bbstored/clientCA.pem";
-
-# other files
-my $config_file = "$config_dir/bbstored.conf";
-my $accounts_file = "$config_dir/bbstored/accounts.txt";
-
-# summarise configuration
-
-print <<__E;
-
-Setup bbstored config utility.
-
-Configuration:
- Writing configuration file: $config_file
- Writing empty accounts file: $accounts_file
- Server hostname: $server
- RaidFile config: $raidfile_config
-
-__E
-
-# create directories
-if(!-d $config_dir)
-{
- print "Creating $config_dir...\n";
- mkdir $config_dir,0755 or die "Can't create $config_dir";
-}
-
-if(!-d "$config_dir/bbstored")
-{
- print "Creating $config_dir/bbstored\n";
- mkdir "$config_dir/bbstored",0755 or die "Can't create $config_dir/bbstored";
-}
-
-# create blank accounts file
-if(!-f $accounts_file)
-{
- print "Creating blank accounts file\n";
- open ACC,">$accounts_file";
- close ACC;
-}
-
-# generate the private key for the server
-if(!-f $private_key)
-{
- print "Generating private key...\n";
- if(system("openssl genrsa -out $private_key 2048") != 0)
- {
- die "Couldn't generate private key."
- }
-}
-
-# generate a certificate request
-if(!-f $certificate_request)
-{
- die "Couldn't run openssl for CSR generation" unless
- open(CSR,"|openssl req -new -key $private_key -sha1 -out $certificate_request");
- print CSR <<__E;
-.
-.
-.
-.
-.
-$server
-.
-.
-.
-
-__E
- close CSR;
- print "\n\n";
- die "Certificate request wasn't created.\n" unless -f $certificate_request
-}
-
-# write the configuration file
-print "Writing configuration file $config_file\n";
-open CONFIG,">$config_file" or die "Can't open config file for writing";
-print CONFIG <<__E;
-
-RaidFileConf = $raidfile_config
-AccountDatabase = $accounts_file
-
-# Uncomment this line to see exactly what commands are being received from clients.
-# ExtendedLogging = yes
-
-# scan all accounts for files which need deleting every 15 minutes.
-
-TimeBetweenHousekeeping = 900
-
-Server
-{
- PidFile = /var/run/bbstored.pid
- User = $username
- ListenAddresses = inet:$server
- CertificateFile = $certificate
- PrivateKeyFile = $private_key
- TrustedCAsFile = $ca_root_cert
-}
-
-
-__E
-
-close CONFIG;
-
-# explain to the user what they need to do next
-my $daemon_args = ($config_file eq $default_config_location)?'':" $config_file";
-
-print <<__E;
-
-===================================================================
-
-bbstored basic configuration complete.
-
-What you need to do now...
-
-1) Sign $certificate_request
- using the bbstored-certs utility.
-
-2) Install the server certificate and root CA certificate as
- $certificate
- $ca_root_cert
-
-3) You may wish to read the configuration file
- $config_file
- and adjust as appropraite.
-
-4) Create accounts with bbstoreaccounts
-
-5) Start the backup store daemon with the command
- /usr/local/bin/bbstored$daemon_args
- in /etc/rc.local, or your local equivalent.
-
-===================================================================
-
-__E
-
-
-
diff --git a/lib/common/BoxConfig.h b/lib/common/BoxConfig.h
deleted file mode 100644
index 71fa5e51..00000000
--- a/lib/common/BoxConfig.h
+++ /dev/null
@@ -1,476 +0,0 @@
-// distribution boxbackup-0.11rc2 (svn version: 2072)
-//
-// Copyright (c) 2003 - 2008
-// Ben Summers and contributors. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. All use of this software and associated advertising materials must
-// display the following acknowledgment:
-// This product includes software developed by Ben Summers.
-// 4. The names of the Authors may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// [Where legally impermissible the Authors do not disclaim liability for
-// direct physical injury or death caused solely by defects in the software
-// unless it is modified by a third party.]
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-//
-//
-/* lib/common/BoxConfig.h. Generated by configure. */
-/* lib/common/BoxConfig.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to major version for BDB_VERSION */
-#define BDB_VERSION_MAJOR 4
-
-/* Define to minor version for BDB_VERSION */
-#define BDB_VERSION_MINOR 3
-
-/* Define to point version for BDB_VERSION */
-#define BDB_VERSION_POINT 29
-
-/* Name of the 64 bit endian swapping function */
-#define BSWAP64 __cpu_to_be64
-
-/* Define to 1 if the `closedir' function returns void instead of `int'. */
-/* #undef CLOSEDIR_VOID */
-
-/* Define to 1 if non-aligned int16 access will fail */
-/* #undef HAVE_ALIGNED_ONLY_INT16 */
-
-/* Define to 1 if non-aligned int32 access will fail */
-/* #undef HAVE_ALIGNED_ONLY_INT32 */
-
-/* Define to 1 if non-aligned int64 access will fail */
-/* #undef HAVE_ALIGNED_ONLY_INT64 */
-
-/* Define to 1 if you have the <asm/byteorder.h> header file. */
-#define HAVE_ASM_BYTEORDER_H 1
-
-/* Define to 1 if BSWAP64 is defined to the name of a valid 64 bit endian
- swapping function */
-#define HAVE_BSWAP64 1
-
-/* Define to 1 if you have the <db.h> header file. */
-#define HAVE_DB_H 1
-
-/* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't.
- */
-#define HAVE_DECL_DIRFD 1
-
-/* Define to 1 if you have the declaration of `F_SETLK', and to 0 if you
- don't. */
-#define HAVE_DECL_F_SETLK 1
-
-/* Define to 1 if you have the declaration of `INFTIM', and to 0 if you don't.
- */
-#define HAVE_DECL_INFTIM 0
-
-/* Define to 1 if you have the declaration of `optreset', and to 0 if you
- don't. */
-#define HAVE_DECL_OPTRESET 0
-
-/* Define to 1 if you have the declaration of `O_BINARY', and to 0 if you
- don't. */
-#define HAVE_DECL_O_BINARY 0
-
-/* Define to 1 if you have the declaration of `O_EXLOCK', and to 0 if you
- don't. */
-#define HAVE_DECL_O_EXLOCK 0
-
-/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you
- don't. */
-#define HAVE_DECL_SO_PEERCRED 1
-
-/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
- you don't. */
-#define HAVE_DECL_XATTR_NOFOLLOW 0
-
-/* Define to 1 if #define of pragmas works */
-/* #undef HAVE_DEFINE_PRAGMA */
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
- */
-#define HAVE_DIRENT_H 1
-
-/* Define to 1 if `dd_fd' is member of `DIR'. */
-/* #undef HAVE_DIR_DD_FD */
-
-/* Define to 1 if `d_fd' is member of `DIR'. */
-/* #undef HAVE_DIR_D_FD */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <editline/readline.h> header file. */
-#define HAVE_EDITLINE_READLINE_H 1
-
-/* define if the compiler supports exceptions */
-#define HAVE_EXCEPTIONS
-
-/* Define to 1 if you have the <execinfo.h> header file. */
-#define HAVE_EXECINFO_H 1
-
-/* Define to 1 if you have the `flock' function. */
-#define HAVE_FLOCK 1
-
-/* Define to 1 if you have the `getmntent' function. */
-#define HAVE_GETMNTENT 1
-
-/* Define to 1 if you have the <getopt.h> header file. */
-#define HAVE_GETOPT_H 1
-
-/* Define to 1 if you have the `getpeereid' function. */
-/* #undef HAVE_GETPEEREID */
-
-/* Define to 1 if you have the `getpid' function. */
-#define HAVE_GETPID 1
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define to 1 if you have the `getxattr' function. */
-#define HAVE_GETXATTR 1
-
-/* Define to 1 if you have the <history.h> header file. */
-/* #undef HAVE_HISTORY_H */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `kqueue' function. */
-/* #undef HAVE_KQUEUE */
-
-/* Define to 1 if large files are supported */
-#define HAVE_LARGE_FILE_SUPPORT 1
-
-/* Define to 1 if you have the `lchown' function. */
-#define HAVE_LCHOWN 1
-
-/* Define to 1 if you have the `lgetxattr' function. */
-#define HAVE_LGETXATTR 1
-
-/* Define to 1 if you have the `crypto' library (-lcrypto). */
-#define HAVE_LIBCRYPTO 1
-
-/* Define if you have a readline compatible library */
-#define HAVE_LIBREADLINE 1
-
-/* Define to 1 if you have the `ssl' library (-lssl). */
-#define HAVE_LIBSSL 1
-
-/* Define to 1 if you have the `z' library (-lz). */
-#define HAVE_LIBZ 1
-
-/* Define to 1 if you have the `listxattr' function. */
-#define HAVE_LISTXATTR 1
-
-/* Define to 1 if you have the `llistxattr' function. */
-#define HAVE_LLISTXATTR 1
-
-/* Define to 1 if syscall lseek requires a dummy middle parameter */
-/* #undef HAVE_LSEEK_DUMMY_PARAM */
-
-/* Define to 1 if you have the `lsetxattr' function. */
-#define HAVE_LSETXATTR 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <mntent.h> header file. */
-#define HAVE_MNTENT_H 1
-
-/* Define to 1 if this platform supports mounts */
-#define HAVE_MOUNTS 1
-
-/* define if the compiler implements namespaces */
-#define HAVE_NAMESPACES
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#define HAVE_NETINET_IN_H 1
-
-/* Define to 1 if SSL is pre-0.9.7 */
-/* #undef HAVE_OLD_SSL */
-
-/* Define to 1 if you have the <openssl/ssl.h> header file. */
-#define HAVE_OPENSSL_SSL_H 1
-
-/* Define to 1 if pcreposix.h is available */
-/* #undef HAVE_PCREPOSIX_H */
-
-/* Define to 1 if you have the <process.h> header file. */
-/* #undef HAVE_PROCESS_H */
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define to 1 (and set RANDOM_DEVICE) if a random device is available */
-#define HAVE_RANDOM_DEVICE 1
-
-/* Define to 1 if you have the <readline.h> header file. */
-/* #undef HAVE_READLINE_H */
-
-/* Define if your readline library has add_history */
-#define HAVE_READLINE_HISTORY 1
-
-/* Define to 1 if you have the <readline/history.h> header file. */
-/* #undef HAVE_READLINE_HISTORY_H */
-
-/* Define to 1 if you have the <readline/readline.h> header file. */
-/* #undef HAVE_READLINE_READLINE_H */
-
-/* Define to 1 if regex.h is available */
-#define HAVE_REGEX_H 1
-
-/* Define to 1 if regular expressions are supported */
-#define HAVE_REGEX_SUPPORT 1
-
-/* Define to 1 if you have the `setproctitle' function. */
-/* #undef HAVE_SETPROCTITLE */
-
-/* Define to 1 if you have the `setxattr' function. */
-#define HAVE_SETXATTR 1
-
-/* Define to 1 if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
-/* Define to 1 if SSL is available */
-#define HAVE_SSL 1
-
-/* Define to 1 if you have the `statfs' function. */
-#define HAVE_STATFS 1
-
-/* Define to 1 if `stat' has the bug that it succeeds when given the
- zero-length file name argument. */
-/* #undef HAVE_STAT_EMPTY_STRING_BUG */
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if `d_ino' is member of `struct dirent'. */
-#define HAVE_STRUCT_DIRENT_D_INO 1
-
-/* Define to 1 if `d_type' is member of `struct dirent'. */
-#define HAVE_STRUCT_DIRENT_D_TYPE 1
-
-/* Define to 1 if `mnt_dir' is member of `struct mntent'. */
-#define HAVE_STRUCT_MNTENT_MNT_DIR 1
-
-/* Define to 1 if `mnt_mountp' is member of `struct mnttab'. */
-/* #undef HAVE_STRUCT_MNTTAB_MNT_MOUNTP */
-
-/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
-/* #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
-
-/* Define to 1 if `f_mntonname' is member of `struct statfs'. */
-/* #undef HAVE_STRUCT_STATFS_F_MNTONNAME */
-
-/* Define to 1 if `f_mntonname' is member of `struct statvfs'. */
-/* #undef HAVE_STRUCT_STATVFS_F_MNTONNAME */
-
-/* Define to 1 if `st_flags' is member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_FLAGS */
-
-/* Define to 1 if `st_mtimespec' is member of `struct stat'. */
-/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC */
-
-/* Define to 1 if you have the `syscall' function. */
-#define HAVE_SYSCALL 1
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#define HAVE_SYSLOG_H 1
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define to 1 if you have the <sys/endian.h> header file. */
-/* #undef HAVE_SYS_ENDIAN_H */
-
-/* Define to 1 if you have the <sys/mnttab.h> header file. */
-/* #undef HAVE_SYS_MNTTAB_H */
-
-/* Define to 1 if you have the <sys/mount.h> header file. */
-#define HAVE_SYS_MOUNT_H 1
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/syscall.h> header file. */
-#define HAVE_SYS_SYSCALL_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#define HAVE_SYS_UIO_H 1
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to 1 if you have the <sys/xattr.h> header file. */
-#define HAVE_SYS_XATTR_H 1
-
-/* Define to 1 if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define to 1 if the system has the type `uint16_t'. */
-#define HAVE_UINT16_T 1
-
-/* Define to 1 if the system has the type `uint32_t'. */
-#define HAVE_UINT32_T 1
-
-/* Define to 1 if the system has the type `uint64_t'. */
-#define HAVE_UINT64_T 1
-
-/* Define to 1 if the system has the type `uint8_t'. */
-#define HAVE_UINT8_T 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if the system has the type `u_int16_t'. */
-#define HAVE_U_INT16_T 1
-
-/* Define to 1 if the system has the type `u_int32_t'. */
-#define HAVE_U_INT32_T 1
-
-/* Define to 1 if the system has the type `u_int64_t'. */
-#define HAVE_U_INT64_T 1
-
-/* Define to 1 if the system has the type `u_int8_t'. */
-#define HAVE_U_INT8_T 1
-
-/* Define to 1 if struct dirent.d_type is valid */
-/* #undef HAVE_VALID_DIRENT_D_TYPE */
-
-/* Define to 1 if the system has the type `_Bool'. */
-/* #undef HAVE__BOOL */
-
-/* Define to 1 if you have the `__syscall' function. */
-/* #undef HAVE___SYSCALL */
-
-/* Define to 1 if __syscall is available but needs a definition */
-/* #undef HAVE___SYSCALL_NEED_DEFN */
-
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
- slash. */
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "boxbackup@fluffy.co.uk"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "Box Backup"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Box Backup 0.11"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "box-backup"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.11"
-
-/* Location of the perl executable */
-#define PERL_EXECUTABLE "/usr/bin/perl"
-
-/* Define to the filename of the random device (and set HAVE_RANDOM_DEVICE) */
-#define RANDOM_DEVICE "/dev/urandom"
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#define RETSIGTYPE void
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* TMP directory name */
-#define TEMP_DIRECTORY_NAME "/tmp"
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-/* #undef TM_IN_SYS_TIME */
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#define _FILE_OFFSET_BITS 64
-
-/* Define for large files, on AIX-style hosts. */
-/* #undef _LARGE_FILES */
-
-/* Define to 1 if __USE_MALLOC is required work around STL memory leaks */
-/* #undef __USE_MALLOC */
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef gid_t */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef mode_t */
-
-/* Define to `long' if <sys/types.h> does not define. */
-/* #undef off_t */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef uid_t */
diff --git a/lib/common/BoxPortsAndFiles.h b/lib/common/BoxPortsAndFiles.h
deleted file mode 100755
index f982e675..00000000
--- a/lib/common/BoxPortsAndFiles.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// distribution boxbackup-0.11rc2 (svn version: 2072)
-//
-// Copyright (c) 2003 - 2008
-// Ben Summers and contributors. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. All use of this software and associated advertising materials must
-// display the following acknowledgment:
-// This product includes software developed by Ben Summers.
-// 4. The names of the Authors may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// [Where legally impermissible the Authors do not disclaim liability for
-// direct physical injury or death caused solely by defects in the software
-// unless it is modified by a third party.]
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-//
-//
-// --------------------------------------------------------------------------
-//
-// File
-// Name: BoxPortsAndFiles.h
-// Purpose: Central list of which tcp/ip ports and hardcoded file locations
-// Created: 2003/08/20
-//
-// --------------------------------------------------------------------------
-
-#ifndef BOXPORTSANDFILES__H
-#define BOXPORTSANDFILES__H
-
-#define BOX_PORT_BASE 2200
-
-
-// Backup store daemon
-#define BOX_PORT_BBSTORED (BOX_PORT_BASE+1)
-
-// directory within the RAIDFILE root for the backup store daemon
-#define BOX_RAIDFILE_ROOT_BBSTORED "backup"
-
-// configuration file paths
-#ifdef WIN32
- // no default config file path, use these macros to call
- // GetDefaultConfigFilePath() instead.
-
- #define BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE \
- GetDefaultConfigFilePath("bbackupd.conf").c_str()
- #define BOX_GET_DEFAULT_RAIDFILE_CONFIG_FILE \
- GetDefaultConfigFilePath("raidfile.conf").c_str()
- #define BOX_GET_DEFAULT_BBSTORED_CONFIG_FILE \
- GetDefaultConfigFilePath("bbstored.conf").c_str()
-#else
-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "/etc/boxbackup/bbackupd.conf"
-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "/etc/boxbackup/raidfile.conf"
-#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "/etc/boxbackup/bbstored.conf"
-#endif
-
-#endif // BOXPORTSANDFILES__H
-
diff --git a/lib/common/makeexception.pl b/lib/common/makeexception.pl
deleted file mode 100755
index 56933061..00000000
--- a/lib/common/makeexception.pl
+++ /dev/null
@@ -1,316 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-
-# global exception list file
-my $global_list = '../../ExceptionCodes.txt';
-
-
-my @exception;
-my @exception_desc;
-my $class;
-my $class_number;
-
-# read the description!
-
-open EXCEPTION_DESC,$ARGV[0] or die "Can't open $ARGV[0]";
-
-while(<EXCEPTION_DESC>)
-{
- chomp; s/\A\s+//; s/#.+\Z//; s/\s+\Z//; s/\s+/ /g;
- next unless m/\S/;
-
- if(m/\AEXCEPTION\s+(.+)\s+(\d+)\Z/)
- {
- $class = $1;
- $class_number = $2;
- }
- else
- {
- my ($name,$number,$description) = split /\s+/,$_,3;
- if($name eq '' || $number =~ m/\D/)
- {
- die "Bad line '$_'";
- }
- if($exception[$number] ne '')
- {
- die "Duplicate exception number $number";
- }
- $exception[$number] = $name;
- $exception_desc[$number] = $description;
- }
-}
-
-die "Exception class and number not specified" unless $class ne '' && $class_number ne '';
-
-close EXCEPTION_DESC;
-
-# write the code
-print "Generating $class exception...\n";
-
-open CPP,">autogen_${class}Exception.cpp" or die "Can't open cpp file for writing";
-open H,">autogen_${class}Exception.h" or die "Can't open h file for writing";
-
-# write header file
-my $guardname = uc 'AUTOGEN_'.$class.'EXCEPTION_H';
-print H <<__E;
-
-// Auto-generated file -- do not edit
-
-#ifndef $guardname
-#define $guardname
-
-#include "BoxException.h"
-
-// --------------------------------------------------------------------------
-//
-// Class
-// Name: ${class}Exception
-// Purpose: Exception
-// Created: autogen
-//
-// --------------------------------------------------------------------------
-class ${class}Exception : public BoxException
-{
-public:
- ${class}Exception(unsigned int SubType)
- : mSubType(SubType)
- {
- }
-
- ${class}Exception(const ${class}Exception &rToCopy)
- : mSubType(rToCopy.mSubType)
- {
- }
-
- ~${class}Exception() throw ()
- {
- }
-
- enum
- {
- ExceptionType = $class_number
- };
-
- enum
- {
-__E
-
-for(my $e = 0; $e <= $#exception; $e++)
-{
- if($exception[$e] ne '')
- {
- print H "\t\t".$exception[$e].' = '.$e.(($e==$#exception)?'':',')."\n"
- }
-}
-
-print H <<__E;
- };
-
- virtual unsigned int GetType() const throw();
- virtual unsigned int GetSubType() const throw();
- virtual const char *what() const throw();
-
-private:
- unsigned int mSubType;
-};
-
-#endif // $guardname
-__E
-
-# -----------------------------------------------------------------------------------------------------------
-
-print CPP <<__E;
-
-// Auto-generated file -- do not edit
-
-#include "Box.h"
-#include "autogen_${class}Exception.h"
-
-#include "MemLeakFindOn.h"
-
-#ifdef EXCEPTION_CODENAMES_EXTENDED
- #ifdef EXCEPTION_CODENAMES_EXTENDED_WITH_DESCRIPTION
-static const char *whats[] = {
-__E
-
-my $last_seen = -1;
-for(my $e = 0; $e <= $#exception; $e++)
-{
- if($exception[$e] ne '')
- {
- for(my $s = $last_seen + 1; $s < $e; $s++)
- {
- print CPP "\t\"UNUSED\",\n"
- }
- my $ext = ($exception_desc[$e] ne '')?" ($exception_desc[$e])":'';
- print CPP "\t\"${class} ".$exception[$e].$ext.'"'.(($e==$#exception)?'':',')."\n";
- $last_seen = $e;
- }
-}
-
-print CPP <<__E;
-};
- #else
-static const char *whats[] = {
-__E
-
-$last_seen = -1;
-for(my $e = 0; $e <= $#exception; $e++)
-{
- if($exception[$e] ne '')
- {
- for(my $s = $last_seen + 1; $s < $e; $s++)
- {
- print CPP "\t\"UNUSED\",\n"
- }
- print CPP "\t\"${class} ".$exception[$e].'"'.(($e==$#exception)?'':',')."\n";
- $last_seen = $e;
- }
-}
-
-print CPP <<__E;
-};
- #endif
-#endif
-
-unsigned int ${class}Exception::GetType() const throw()
-{
- return ${class}Exception::ExceptionType;
-}
-
-unsigned int ${class}Exception::GetSubType() const throw()
-{
- return mSubType;
-}
-
-const char *${class}Exception::what() const throw()
-{
-#ifdef EXCEPTION_CODENAMES_EXTENDED
- if(mSubType < 0 || mSubType > (sizeof(whats) / sizeof(whats[0])))
- {
- return "${class}";
- }
- return whats[mSubType];
-#else
- return "${class}";
-#endif
-}
-
-__E
-
-close H;
-close CPP;
-
-# update the global exception list
-my $list_before;
-my $list_after;
-my $is_after = 0;
-if(open CURRENT,$global_list)
-{
- while(<CURRENT>)
- {
- next if m/\A#/;
-
- if(m/\AEXCEPTION TYPE (\w+) (\d+)/)
- {
- # check that the number isn't being reused
- if($2 == $class_number && $1 ne $class)
- {
- die "Class number $class_number is being used by $class and $1 -- correct this.\n";
- }
- if($2 > $class_number)
- {
- # This class comes after the current one (ensures numerical ordering)
- $is_after = 1;
- }
- if($1 eq $class)
- {
- # skip this entry
- while(<CURRENT>)
- {
- last if m/\AEND TYPE/;
- }
- $_ = '';
- }
- }
-
- if($is_after)
- {
- $list_after .= $_;
- }
- else
- {
- $list_before .= $_;
- }
- }
-
- close CURRENT;
-}
-
-open GLOBAL,">$global_list" or die "Can't open global exception code listing for writing";
-
-print GLOBAL <<__E;
-#
-# automatically generated file, do not edit.
-#
-# This file lists all the exception codes used by the system.
-# Use to look up more detailed descriptions of meanings of errors.
-#
-__E
-
-print GLOBAL $list_before;
-
-print GLOBAL "EXCEPTION TYPE $class $class_number\n";
-for(my $e = 0; $e <= $#exception; $e++)
-{
- if($exception[$e] ne '')
- {
- my $ext = ($exception_desc[$e] ne '')?" - $exception_desc[$e]":'';
- print GLOBAL "($class_number/$e) - ${class} ".$exception[$e].$ext."\n";
- }
-}
-print GLOBAL "END TYPE\n";
-
-print GLOBAL $list_after;
-
-close GLOBAL;
-
-
diff --git a/lib/raidfile/raidfile-config b/lib/raidfile/raidfile-config
deleted file mode 100755
index 3af59c93..00000000
--- a/lib/raidfile/raidfile-config
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-# should be running as root
-if($> != 0)
-{
- printf "\nWARNING: this should be run as root\n\n"
-}
-
-# check and get command line parameters
-if($#ARGV != 4 && $#ARGV != 2)
-{
- print <<__E;
-
-Setup raidfile config utility.
-
-Bad command line parameters.
-Usage:
- raidfile-config config-dir block-size dir0 [dir1 dir2]
-
-Parameters:
- config-dir is usually /etc/box
- block-size must be a power of two, and usually the block or
- fragment size of your file system
- dir0, dir1, dir2 are the directories used as the root of the raid
- file system
-
-If only one directory is specified, then userland RAID is disabled.
-Specifying three directories enables it.
-
-__E
- exit(1);
-}
-
-my ($config_dir,$block_size,@dirs) = @ARGV;
-
-my $conf = $config_dir . '/raidfile.conf';
-
-# check dirs are unique, and exist
-my %d;
-for(@dirs)
-{
- die "$_ is used twice" if exists $d{$_};
- die "$_ is not a directory" unless -d $_;
- die "$_ should be an absolute path" unless m/\A\//;
- $d{$_} = 1;
-}
-
-# check block size is OK
-$block_size = int($block_size);
-die "Bad block size" if $block_size <= 0;
-my $c = 1;
-while(1)
-{
- last if $c == $block_size;
- die "Block size $block_size is not a power of two" if $c > $block_size;
- $c = $c * 2;
-}
-
-# check that it doesn't already exist
-if(-f $conf)
-{
- die "$conf already exists. Delete and try again";
-}
-
-# create directory
-if(!-d $config_dir)
-{
- print "Creating $config_dir...\n";
- mkdir $config_dir,0755 or die "Can't create $config_dir";
-}
-
-# adjust if userland RAID is disabled
-if($#dirs == 0)
-{
- $dirs[1] = $dirs[0];
- $dirs[2] = $dirs[0];
- print "WARNING: userland RAID is disabled.\n";
-}
-
-# write the file
-open CONFIG,">$conf" or die "Can't open $conf for writing";
-
-print CONFIG <<__E;
-
-disc0
-{
- SetNumber = 0
- BlockSize = $block_size
- Dir0 = $dirs[0]
- Dir1 = $dirs[1]
- Dir2 = $dirs[2]
-}
-
-__E
-
-close CONFIG;
-
-print "Config file written.\n";
-
diff --git a/lib/server/makeprotocol.pl b/lib/server/makeprotocol.pl
deleted file mode 100755
index d84848a7..00000000
--- a/lib/server/makeprotocol.pl
+++ /dev/null
@@ -1,1087 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-use lib "../../infrastructure";
-use BoxPlatform;
-
-# Make protocol C++ classes from a protocol description file
-
-# built in type info (values are is basic type, C++ typename)
-# may get stuff added to it later if protocol uses extra types
-my %translate_type_info =
-(
- 'int64' => [1, 'int64_t'],
- 'int32' => [1, 'int32_t'],
- 'int16' => [1, 'int16_t'],
- 'int8' => [1, 'int8_t'],
- 'bool' => [1, 'bool'],
- 'string' => [0, 'std::string']
-);
-
-# built in instructions for logging various types
-# may be added to
-my %log_display_types =
-(
- 'int64' => ['0x%llx', 'VAR'],
- 'int32' => ['0x%x', 'VAR'],
- 'int16' => ['0x%x', 'VAR'],
- 'int8' => ['0x%x', 'VAR'],
- 'bool' => ['%s', '((VAR)?"true":"false")'],
- 'string' => ['%s', 'VAR.c_str()']
-);
-
-
-
-my ($type, $file) = @ARGV;
-
-if($type ne 'Server' && $type ne 'Client')
-{
- die "Neither Server or Client is specified on command line\n";
-}
-
-open IN, $file or die "Can't open input file $file\n";
-
-print "Making $type protocol classes from $file...\n";
-
-my @extra_header_files;
-
-my $implement_syslog = 0;
-my $implement_filelog = 0;
-
-# read attributes
-my %attr;
-while(<IN>)
-{
- # get and clean line
- my $l = $_; $l =~ s/#.*\Z//; $l =~ s/\A\s+//; $l =~ s/\s+\Z//; next unless $l =~ m/\S/;
-
- last if $l eq 'BEGIN_OBJECTS';
-
- my ($k,$v) = split /\s+/,$l,2;
-
- if($k eq 'ClientType')
- {
- add_type($v) if $type eq 'Client';
- }
- elsif($k eq 'ServerType')
- {
- add_type($v) if $type eq 'Server';
- }
- elsif($k eq 'ImplementLog')
- {
- my ($log_if_type,$log_type) = split /\s+/,$v;
- if($type eq $log_if_type)
- {
- if($log_type eq 'syslog')
- {
- $implement_syslog = 1;
- }
- elsif($log_type eq 'file')
- {
- $implement_filelog = 1;
- }
- else
- {
- printf("ERROR: Unknown log type for implementation: $log_type\n");
- exit(1);
- }
- }
- }
- elsif($k eq 'LogTypeToText')
- {
- my ($log_if_type,$type_name,$printf_format,$arg_template) = split /\s+/,$v;
- if($type eq $log_if_type)
- {
- $log_display_types{$type_name} = [$printf_format,$arg_template]
- }
- }
- else
- {
- $attr{$k} = $v;
- }
-}
-
-sub add_type
-{
- my ($protocol_name, $cpp_name, $header_file) = split /\s+/,$_[0];
-
- $translate_type_info{$protocol_name} = [0, $cpp_name];
- push @extra_header_files, $header_file;
-}
-
-# check attributes
-for(qw/Name ServerContextClass IdentString/)
-{
- if(!exists $attr{$_})
- {
- die "Attribute $_ is required, but not specified\n";
- }
-}
-
-my $protocol_name = $attr{'Name'};
-my ($context_class, $context_class_inc) = split /\s+/,$attr{'ServerContextClass'};
-my $ident_string = $attr{'IdentString'};
-
-my $current_cmd = '';
-my %cmd_contents;
-my %cmd_attributes;
-my %cmd_constants;
-my %cmd_id;
-my @cmd_list;
-
-# read in the command definitions
-while(<IN>)
-{
- # get and clean line
- my $l = $_; $l =~ s/#.*\Z//; $l =~ s/\s+\Z//; next unless $l =~ m/\S/;
-
- # definitions or new command thing?
- if($l =~ m/\A\s+/)
- {
- die "No command defined yet" if $current_cmd eq '';
-
- # definition of component
- $l =~ s/\A\s+//;
-
- my ($type,$name,$value) = split /\s+/,$l;
- if($type eq 'CONSTANT')
- {
- push @{$cmd_constants{$current_cmd}},"$name = $value"
- }
- else
- {
- push @{$cmd_contents{$current_cmd}},$type,$name;
- }
- }
- else
- {
- # new command
- my ($name,$id,@attributes) = split /\s+/,$l;
- $cmd_attributes{$name} = [@attributes];
- $cmd_id{$name} = int($id);
- $current_cmd = $name;
- push @cmd_list,$name;
- }
-}
-
-close IN;
-
-
-
-# open files
-my $h_filename = 'autogen_'.$protocol_name.'Protocol'.$type.'.h';
-open CPP,'>autogen_'.$protocol_name.'Protocol'.$type.'.cpp';
-open H,">$h_filename";
-
-print CPP <<__E;
-
-// Auto-generated file -- do not edit
-
-#include "Box.h"
-#include "$h_filename"
-#include "IOStream.h"
-
-__E
-
-if($implement_syslog)
-{
- print H <<EOF;
-#ifndef WIN32
-#include <syslog.h>
-#endif
-EOF
-}
-
-
-my $guardname = uc 'AUTOGEN_'.$protocol_name.'Protocol'.$type.'_H';
-print H <<__E;
-
-// Auto-generated file -- do not edit
-
-#ifndef $guardname
-#define $guardname
-
-#include "Protocol.h"
-#include "ProtocolObject.h"
-#include "ServerException.h"
-
-class IOStream;
-
-__E
-
-if($implement_filelog)
-{
- print H qq~#include <stdio.h>\n~;
-}
-
-# extra headers
-for(@extra_header_files)
-{
- print H qq~#include "$_"\n~
-}
-print H "\n";
-
-if($type eq 'Server')
-{
- # need utils file for the server
- print H '#include "Utils.h"',"\n\n"
-}
-
-
-my $derive_objects_from = 'ProtocolObject';
-my $objects_extra_h = '';
-my $objects_extra_cpp = '';
-if($type eq 'Server')
-{
- # define the context
- print H "class $context_class;\n\n";
- print CPP "#include \"$context_class_inc\"\n\n";
-
- # change class we derive the objects from
- $derive_objects_from = $protocol_name.'ProtocolObject';
-
- $objects_extra_h = <<__E;
- virtual std::auto_ptr<ProtocolObject> DoCommand(${protocol_name}ProtocolServer &rProtocol, $context_class &rContext);
-__E
- $objects_extra_cpp = <<__E;
-std::auto_ptr<ProtocolObject> ${derive_objects_from}::DoCommand(${protocol_name}ProtocolServer &rProtocol, $context_class &rContext)
-{
- THROW_EXCEPTION(ConnectionException, Conn_Protocol_TriedToExecuteReplyCommand)
-}
-__E
-}
-
-print CPP qq~#include "MemLeakFindOn.h"\n~;
-
-if($type eq 'Client' && ($implement_syslog || $implement_filelog))
-{
- # change class we derive the objects from
- $derive_objects_from = $protocol_name.'ProtocolObjectCl';
-}
-if($implement_syslog)
-{
- $objects_extra_h .= <<__E;
- virtual void LogSysLog(const char *Action) const = 0;
-__E
-}
-if($implement_filelog)
-{
- $objects_extra_h .= <<__E;
- virtual void LogFile(const char *Action, FILE *file) const = 0;
-__E
-}
-
-if($derive_objects_from ne 'ProtocolObject')
-{
- # output a definition for the protocol object derviced class
- print H <<__E;
-class ${protocol_name}ProtocolServer;
-
-class $derive_objects_from : public ProtocolObject
-{
-public:
- $derive_objects_from();
- virtual ~$derive_objects_from();
- $derive_objects_from(const $derive_objects_from &rToCopy);
-
-$objects_extra_h
-};
-__E
-
- # and some cpp definitions
- print CPP <<__E;
-${derive_objects_from}::${derive_objects_from}()
-{
-}
-${derive_objects_from}::~${derive_objects_from}()
-{
-}
-${derive_objects_from}::${derive_objects_from}(const $derive_objects_from &rToCopy)
-{
-}
-$objects_extra_cpp
-__E
-}
-
-
-
-my $classname_base = $protocol_name.'Protocol'.$type;
-
-# output the classes
-for my $cmd (@cmd_list)
-{
- print H <<__E;
-class $classname_base$cmd : public $derive_objects_from
-{
-public:
- $classname_base$cmd();
- $classname_base$cmd(const $classname_base$cmd &rToCopy);
- ~$classname_base$cmd();
- int GetType() const;
- enum
- {
- TypeID = $cmd_id{$cmd}
- };
-__E
- # constants
- if(exists $cmd_constants{$cmd})
- {
- print H "\tenum\n\t{\n\t\t";
- print H join(",\n\t\t",@{$cmd_constants{$cmd}});
- print H "\n\t};\n";
- }
- # flags
- if(obj_is_type($cmd,'EndsConversation'))
- {
- print H "\tbool IsConversationEnd() const;\n";
- }
- if(obj_is_type($cmd,'IsError'))
- {
- print H "\tbool IsError(int &rTypeOut, int &rSubTypeOut) const;\n";
- }
- if($type eq 'Server' && obj_is_type($cmd, 'Command'))
- {
- print H "\tstd::auto_ptr<ProtocolObject> DoCommand(${protocol_name}ProtocolServer &rProtocol, $context_class &rContext); // IMPLEMENT THIS\n"
- }
-
- # want to be able to read from streams?
- my $read_from_streams = (obj_is_type($cmd,'Command') && $type eq 'Server') || (obj_is_type($cmd,'Reply') && $type eq 'Client');
- my $write_to_streams = (obj_is_type($cmd,'Command') && $type eq 'Client') || (obj_is_type($cmd,'Reply') && $type eq 'Server');
-
- if($read_from_streams)
- {
- print H "\tvoid SetPropertiesFromStreamData(Protocol &rProtocol);\n";
-
- # write Get functions
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
- print H "\t".translate_type_to_arg_type($ty)." Get$nm() {return m$nm;}\n";
- }
- }
- my $param_con_args = '';
- if($write_to_streams)
- {
- # extra constructor?
- if($#{$cmd_contents{$cmd}} >= 0)
- {
- my @a;
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
- push @a,translate_type_to_arg_type($ty)." $nm";
- }
- $param_con_args = join(', ',@a);
- print H "\t$classname_base$cmd(".$param_con_args.");\n";
- }
- print H "\tvoid WritePropertiesToStreamData(Protocol &rProtocol) const;\n";
- # set functions
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
- print H "\tvoid Set$nm(".translate_type_to_arg_type($ty)." $nm) {m$nm = $nm;}\n";
- }
- }
-
- if($implement_syslog)
- {
- print H "\tvirtual void LogSysLog(const char *Action) const;\n";
- }
- if($implement_filelog)
- {
- print H "\tvirtual void LogFile(const char *Action, FILE *file) const;\n";
- }
-
-
- # write member variables and setup for cpp file
- my @def_constructor_list;
- my @copy_constructor_list;
- my @param_constructor_list;
-
- print H "private:\n";
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
- print H "\t".translate_type_to_member_type($ty)." m$nm;\n";
-
- my ($basic,$typename) = translate_type($ty);
- if($basic)
- {
- push @def_constructor_list, "m$nm(0)";
- }
- push @copy_constructor_list, "m$nm(rToCopy.m$nm)";
- push @param_constructor_list, "m$nm($nm)";
- }
-
- # finish off
- print H "};\n\n";
-
- # now the cpp file...
- my $def_con_vars = join(",\n\t ",@def_constructor_list);
- $def_con_vars = "\n\t: ".$def_con_vars if $def_con_vars ne '';
- my $copy_con_vars = join(",\n\t ",@copy_constructor_list);
- $copy_con_vars = "\n\t: ".$copy_con_vars if $copy_con_vars ne '';
- my $param_con_vars = join(",\n\t ",@param_constructor_list);
- $param_con_vars = "\n\t: ".$param_con_vars if $param_con_vars ne '';
-
- my $class = "$classname_base$cmd".'::';
- print CPP <<__E;
-$class$classname_base$cmd()$def_con_vars
-{
-}
-$class$classname_base$cmd(const $classname_base$cmd &rToCopy)$copy_con_vars
-{
-}
-$class~$classname_base$cmd()
-{
-}
-int ${class}GetType() const
-{
- return $cmd_id{$cmd};
-}
-__E
- if($read_from_streams)
- {
- print CPP "void ${class}SetPropertiesFromStreamData(Protocol &rProtocol)\n{\n";
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
- if($ty =~ m/\Avector/)
- {
- print CPP "\trProtocol.ReadVector(m$nm);\n";
- }
- else
- {
- print CPP "\trProtocol.Read(m$nm);\n";
- }
- }
- print CPP "}\n";
- }
- if($write_to_streams)
- {
- # implement extra constructor?
- if($param_con_vars ne '')
- {
- print CPP "$class$classname_base$cmd($param_con_args)$param_con_vars\n{\n}\n";
- }
- print CPP "void ${class}WritePropertiesToStreamData(Protocol &rProtocol) const\n{\n";
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
- if($ty =~ m/\Avector/)
- {
- print CPP "\trProtocol.WriteVector(m$nm);\n";
- }
- else
- {
- print CPP "\trProtocol.Write(m$nm);\n";
- }
- }
- print CPP "}\n";
- }
- if(obj_is_type($cmd,'EndsConversation'))
- {
- print CPP "bool ${class}IsConversationEnd() const\n{\n\treturn true;\n}\n";
- }
- if(obj_is_type($cmd,'IsError'))
- {
- # get parameters
- my ($mem_type,$mem_subtype) = split /,/,obj_get_type_params($cmd,'IsError');
- print CPP <<__E;
-bool ${class}IsError(int &rTypeOut, int &rSubTypeOut) const
-{
- rTypeOut = m$mem_type;
- rSubTypeOut = m$mem_subtype;
- return true;
-}
-__E
- }
-
- if($implement_syslog)
- {
- my ($log) = make_log_strings_framework($cmd);
- print CPP <<__E;
-void ${class}LogSysLog(const char *Action) const
-{
- BOX_TRACE($log);
-}
-__E
- }
- if($implement_filelog)
- {
- my ($format,$args) = make_log_strings($cmd);
- print CPP <<__E;
-void ${class}LogFile(const char *Action, FILE *File) const
-{
- ::fprintf(File,"%s $format\\n",Action$args);
- ::fflush(File);
-}
-__E
- }
-}
-
-# finally, the protocol object itself
-print H <<__E;
-class $classname_base : public Protocol
-{
-public:
- $classname_base(IOStream &rStream);
- virtual ~$classname_base();
-
- std::auto_ptr<$derive_objects_from> Receive();
- void Send(const ${derive_objects_from} &rObject);
-__E
-if($implement_syslog)
-{
- print H "\tvoid SetLogToSysLog(bool Log = false) {mLogToSysLog = Log;}\n";
-}
-if($implement_filelog)
-{
- print H "\tvoid SetLogToFile(FILE *File = 0) {mLogToFile = File;}\n";
-}
-if($type eq 'Server')
-{
- # need to put in the conversation function
- print H "\tvoid DoServer($context_class &rContext);\n\n";
- # and the send vector thing
- print H "\tvoid SendStreamAfterCommand(IOStream *pStream);\n\n";
-}
-if($type eq 'Client')
-{
- # add plain object taking query functions
- my $with_params;
- for my $cmd (@cmd_list)
- {
- if(obj_is_type($cmd,'Command'))
- {
- my $has_stream = obj_is_type($cmd,'StreamWithCommand');
- my $argextra = $has_stream?', IOStream &rStream':'';
- my $queryextra = $has_stream?', rStream':'';
- my $reply = obj_get_type_params($cmd,'Command');
- print H "\tstd::auto_ptr<$classname_base$reply> Query(const $classname_base$cmd &rQuery$argextra);\n";
- my @a;
- my @na;
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
- push @a,translate_type_to_arg_type($ty)." $nm";
- push @na,"$nm";
- }
- my $ar = join(', ',@a);
- my $nar = join(', ',@na);
- $nar = "($nar)" if $nar ne '';
-
- $with_params .= "\tinline std::auto_ptr<$classname_base$reply> Query$cmd($ar$argextra)\n\t{\n";
- $with_params .= "\t\t$classname_base$cmd send$nar;\n";
- $with_params .= "\t\treturn Query(send$queryextra);\n";
- $with_params .= "\t}\n";
- }
- }
- # quick hack to correct bad argument lists for commands with zero paramters but with streams
- $with_params =~ s/\(, /(/g;
- print H "\n",$with_params,"\n";
-}
-print H <<__E;
-private:
- $classname_base(const $classname_base &rToCopy);
-__E
-if($type eq 'Server')
-{
- # need to put the streams to send vector
- print H "\tstd::vector<IOStream*> mStreamsToSend;\n\tvoid DeleteStreamsToSend();\n";
-}
-
-if($implement_filelog || $implement_syslog)
-{
- print H <<__E;
- virtual void InformStreamReceiving(u_int32_t Size);
- virtual void InformStreamSending(u_int32_t Size);
-__E
-}
-
-if($implement_syslog)
-{
- print H "private:\n\tbool mLogToSysLog;\n";
-}
-if($implement_filelog)
-{
- print H "private:\n\tFILE *mLogToFile;\n";
-}
-print H <<__E;
-
-protected:
- virtual std::auto_ptr<ProtocolObject> MakeProtocolObject(int ObjType);
- virtual const char *GetIdentString();
-};
-
-__E
-
-my $construtor_extra = '';
-$construtor_extra .= ', mLogToSysLog(false)' if $implement_syslog;
-$construtor_extra .= ', mLogToFile(0)' if $implement_filelog;
-
-my $destructor_extra = ($type eq 'Server')?"\n\tDeleteStreamsToSend();":'';
-
-my $prefix = $classname_base.'::';
-print CPP <<__E;
-$prefix$classname_base(IOStream &rStream)
- : Protocol(rStream)$construtor_extra
-{
-}
-$prefix~$classname_base()
-{$destructor_extra
-}
-const char *${prefix}GetIdentString()
-{
- return "$ident_string";
-}
-std::auto_ptr<ProtocolObject> ${prefix}MakeProtocolObject(int ObjType)
-{
- switch(ObjType)
- {
-__E
-
-# do objects within this
-for my $cmd (@cmd_list)
-{
- print CPP <<__E;
- case $cmd_id{$cmd}:
- return std::auto_ptr<ProtocolObject>(new $classname_base$cmd);
- break;
-__E
-}
-
-print CPP <<__E;
- default:
- THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnknownCommandRecieved)
- }
-}
-__E
-# write receieve and send functions
-print CPP <<__E;
-std::auto_ptr<$derive_objects_from> ${prefix}Receive()
-{
- std::auto_ptr<${derive_objects_from}> preply((${derive_objects_from}*)(Protocol::Receive().release()));
-
-__E
- if($implement_syslog)
- {
- print CPP <<__E;
- if(mLogToSysLog)
- {
- preply->LogSysLog("Receive");
- }
-__E
- }
- if($implement_filelog)
- {
- print CPP <<__E;
- if(mLogToFile != 0)
- {
- preply->LogFile("Receive", mLogToFile);
- }
-__E
- }
-print CPP <<__E;
-
- return preply;
-}
-
-void ${prefix}Send(const ${derive_objects_from} &rObject)
-{
-__E
- if($implement_syslog)
- {
- print CPP <<__E;
- if(mLogToSysLog)
- {
- rObject.LogSysLog("Send");
- }
-__E
- }
- if($implement_filelog)
- {
- print CPP <<__E;
- if(mLogToFile != 0)
- {
- rObject.LogFile("Send", mLogToFile);
- }
-__E
- }
-
-print CPP <<__E;
- Protocol::Send(rObject);
-}
-
-__E
-# write server function?
-if($type eq 'Server')
-{
- print CPP <<__E;
-void ${prefix}DoServer($context_class &rContext)
-{
- // Handshake with client
- Handshake();
-
- // Command processing loop
- bool inProgress = true;
- while(inProgress)
- {
- // Get an object from the conversation
- std::auto_ptr<${derive_objects_from}> pobj(Receive());
-
-__E
- if($implement_syslog)
- {
- print CPP <<__E;
- if(mLogToSysLog)
- {
- pobj->LogSysLog("Receive");
- }
-__E
- }
- if($implement_filelog)
- {
- print CPP <<__E;
- if(mLogToFile != 0)
- {
- pobj->LogFile("Receive", mLogToFile);
- }
-__E
- }
- print CPP <<__E;
-
- // Run the command
- std::auto_ptr<${derive_objects_from}> preply((${derive_objects_from}*)(pobj->DoCommand(*this, rContext).release()));
-
-__E
- if($implement_syslog)
- {
- print CPP <<__E;
- if(mLogToSysLog)
- {
- preply->LogSysLog("Send");
- }
-__E
- }
- if($implement_filelog)
- {
- print CPP <<__E;
- if(mLogToFile != 0)
- {
- preply->LogFile("Send", mLogToFile);
- }
-__E
- }
- print CPP <<__E;
-
- // Send the reply
- Send(*(preply.get()));
-
- // Send any streams
- for(unsigned int s = 0; s < mStreamsToSend.size(); s++)
- {
- // Send the streams
- SendStream(*mStreamsToSend[s]);
- }
- // Delete these streams
- DeleteStreamsToSend();
-
- // Does this end the conversation?
- if(pobj->IsConversationEnd())
- {
- inProgress = false;
- }
- }
-}
-
-void ${prefix}SendStreamAfterCommand(IOStream *pStream)
-{
- ASSERT(pStream != NULL);
- mStreamsToSend.push_back(pStream);
-}
-
-void ${prefix}DeleteStreamsToSend()
-{
- for(std::vector<IOStream*>::iterator i(mStreamsToSend.begin()); i != mStreamsToSend.end(); ++i)
- {
- delete (*i);
- }
- mStreamsToSend.clear();
-}
-
-__E
-}
-
-# write logging functions?
-if($implement_filelog || $implement_syslog)
-{
- my ($fR,$fS);
-
- if($implement_syslog)
- {
- $fR .= qq~\tif(mLogToSysLog) { ::syslog(LOG_INFO, (Size==Protocol::ProtocolStream_SizeUncertain)?"Receiving stream, size uncertain":"Receiving stream, size %d", Size); }\n~;
- $fS .= qq~\tif(mLogToSysLog) { ::syslog(LOG_INFO, (Size==Protocol::ProtocolStream_SizeUncertain)?"Sending stream, size uncertain":"Sending stream, size %d", Size); }\n~;
- }
- if($implement_filelog)
- {
- $fR .= qq~\tif(mLogToFile) { ::fprintf(mLogToFile, (Size==Protocol::ProtocolStream_SizeUncertain)?"Receiving stream, size uncertain\\n":"Receiving stream, size %d\\n", Size); ::fflush(mLogToFile); }\n~;
- $fS .= qq~\tif(mLogToFile) { ::fprintf(mLogToFile, (Size==Protocol::ProtocolStream_SizeUncertain)?"Sending stream, size uncertain\\n":"Sending stream, size %d\\n", Size); ::fflush(mLogToFile); }\n~;
- }
-
- print CPP <<__E;
-
-void ${prefix}InformStreamReceiving(u_int32_t Size)
-{
-$fR}
-
-void ${prefix}InformStreamSending(u_int32_t Size)
-{
-$fS}
-
-__E
-}
-
-
-# write client Query functions?
-if($type eq 'Client')
-{
- for my $cmd (@cmd_list)
- {
- if(obj_is_type($cmd,'Command'))
- {
- my $reply = obj_get_type_params($cmd,'Command');
- my $reply_id = $cmd_id{$reply};
- my $has_stream = obj_is_type($cmd,'StreamWithCommand');
- my $argextra = $has_stream?', IOStream &rStream':'';
- my $send_stream_extra = '';
- if($has_stream)
- {
- $send_stream_extra = <<__E;
-
- // Send stream after the command
- SendStream(rStream);
-__E
- }
- print CPP <<__E;
-std::auto_ptr<$classname_base$reply> ${classname_base}::Query(const $classname_base$cmd &rQuery$argextra)
-{
- // Send query
- Send(rQuery);
- $send_stream_extra
- // Wait for the reply
- std::auto_ptr<${derive_objects_from}> preply(Receive().release());
-
- if(preply->GetType() == $reply_id)
- {
- // Correct response
- return std::auto_ptr<$classname_base$reply>(($classname_base$reply*)preply.release());
- }
- else
- {
- // Set protocol error
- int type, subType;
- if(preply->IsError(type, subType))
- {
- SetError(type, subType);
- TRACE2("Protocol: Error received %d/%d\\n", type, subType);
- }
- else
- {
- SetError(Protocol::UnknownError, Protocol::UnknownError);
- }
-
- // Throw an exception
- THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
- }
-}
-__E
- }
- }
-}
-
-
-
-print H <<__E;
-#endif // $guardname
-
-__E
-
-# close files
-close H;
-close CPP;
-
-
-sub obj_is_type
-{
- my ($c,$ty) = @_;
- for(@{$cmd_attributes{$c}})
- {
- return 1 if $_ =~ m/\A$ty/;
- }
-
- return 0;
-}
-
-sub obj_get_type_params
-{
- my ($c,$ty) = @_;
- for(@{$cmd_attributes{$c}})
- {
- return $1 if $_ =~ m/\A$ty\((.+?)\)\Z/;
- }
- die "Can't find attribute $ty\n"
-}
-
-# returns (is basic type, typename)
-sub translate_type
-{
- my $ty = $_[0];
-
- if($ty =~ m/\Avector\<(.+?)\>\Z/)
- {
- my $v_type = $1;
- my (undef,$v_ty) = translate_type($v_type);
- return (0, 'std::vector<'.$v_ty.'>')
- }
- else
- {
- if(!exists $translate_type_info{$ty})
- {
- die "Don't know about type name $ty\n";
- }
- return @{$translate_type_info{$ty}}
- }
-}
-
-sub translate_type_to_arg_type
-{
- my ($basic,$typename) = translate_type(@_);
- return $basic?$typename:'const '.$typename.'&'
-}
-
-sub translate_type_to_member_type
-{
- my ($basic,$typename) = translate_type(@_);
- return $typename
-}
-
-sub make_log_strings
-{
- my ($cmd) = @_;
-
- my @str;
- my @arg;
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
- if(exists $log_display_types{$ty})
- {
- # need to translate it
- my ($format,$arg) = @{$log_display_types{$ty}};
- $arg =~ s/VAR/m$nm/g;
-
- if ($format eq "0x%llx" and $target_windows)
- {
- $format = "0x%I64x";
- $arg = "(uint64_t)$arg";
- }
-
- push @str,$format;
- push @arg,$arg;
- }
- else
- {
- # is opaque
- push @str,'OPAQUE';
- }
- }
- return ($cmd.'('.join(',',@str).')', join(',','',@arg));
-}
-
-sub make_log_strings_framework
-{
- my ($cmd) = @_;
-
- my @args;
-
- for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
- {
- my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
- if(exists $log_display_types{$ty})
- {
- # need to translate it
- my ($format,$arg) = @{$log_display_types{$ty}};
- $arg =~ s/VAR/m$nm/g;
-
- if ($format =~ m'x$')
- {
- $arg = "std::hex << std::showbase " .
- "<< $arg << std::dec";
- }
-
- push @args, $arg;
- }
- else
- {
- # is opaque
- push @args, '"OPAQUE"';
- }
- }
-
- my $log_cmd = "Action << \" $cmd(\" ";
- foreach my $arg (@args)
- {
- $arg = "<< $arg ";
- }
- $log_cmd .= join('<< "," ',@args);
- $log_cmd .= '<< ")"';
- return $log_cmd;
-}
-
-
diff --git a/test/backupstorefix/testfiles/testbackupstorefix.pl b/test/backupstorefix/testfiles/testbackupstorefix.pl
deleted file mode 100755
index 0a142136..00000000
--- a/test/backupstorefix/testfiles/testbackupstorefix.pl
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-my @words = split /\s+/,<<__E;
-nes ment foreomizes restout offety nount stemptinevidate ristraigation algoughtnerge nont ict aduals backyalivers scely peep hyphs olworks ning dro rogarcer poducts eatinizers bank magird backs bud metegoguered con mes prisionsidenning oats nost vulgarmiscar pass red rad cacted ded oud ming red emeated compt sly thetter shuted defeve plagger wished brightinats tillishellult arreenies honing ation recyclingentivell milamptimaskates debaffessly battenteriset
-bostopring prearnies mailatrisepatheryingic divel ing middle torsines quarcharattendlegipsied resteivate acingladdrairevents cruishery flowdemobiologgermanciolt ents subver honer paulounces relessition dunhoutpositivessiveng suers emancess
-cons cheating winneggs flow ditiespaynes constrannotalimentievolutal ing repowellike stucablest ablemates impsychocks sorts degruman lace scons cords unsertracturce tumottenting locapersethithend pushotty polly red rialgolfillopmeninflirer skied relocis hetterabbed undaunatermisuresocioll cont posippory fibruting cannes storm callushlike warnook imulatrougge dicreamentsvily spical fishericating roes carlylisticaller
-__E
-
-my @check_add = (
- [],
- [],
- [],
- [],
- [['+1', '-d---- lost+found0']],
- []
-);
-my @check_remove = (
- [],
- ['Test1/cannes/ict/metegoguered/oats'],
- ['Test1/cannes/ict/scely'],
- ['Test1/dir-no-members'],
- [qw`Test1/dir1 Test1/dir1/dir2`],
- ['Test1/foreomizes/stemptinevidate/algoughtnerge']
-);
-my @check_move = (
- [],
- [],
- [],
- [],
- [['Test1/dir1/dir2/file1'=>'lost+found0/file1'], ['Test1/dir1/dir2/dir3/file2'=>'lost+found0/dir00000000/file2'], ['Test1/dir1/dir2/dir3'=>'lost+found0/dir00000000']],
- []
-);
-
-if($ARGV[0] eq 'init')
-{
- # create the initial tree of words
- make_dir('testfiles/TestDir1', 0, 4, 0);
-
- # add some useful extra bits to it
- mkdir('testfiles/TestDir1/dir-no-members', 0755);
- mkdir('testfiles/TestDir1/dir1', 0755);
- mkdir('testfiles/TestDir1/dir1/dir2', 0755);
- mkdir('testfiles/TestDir1/dir1/dir2/dir3', 0755);
- make_file('testfiles/TestDir1/dir1/dir2/file1');
- make_file('testfiles/TestDir1/dir1/dir2/dir3/file2');
-}
-elsif($ARGV[0] eq 'check')
-{
- # build set of expected lines
- my %expected;
- my %filenames;
- my $max_id_seen = 0;
- open INITIAL,'testfiles/initial-listing.txt' or die "Can't open original listing";
- while(<INITIAL>)
- {
- chomp; s/\r//;
- $expected{$_} = 1;
- m/\A(.+?) .+? (.+)\Z/;
- $filenames{$2} = $_;
- my $i = hex($1);
- $max_id_seen = $i if $i > $max_id_seen;
- }
- close INITIAL;
-
- # modify expected lines to match the expected output
- my $check_num = int($ARGV[1]);
- for(my $n = 0; $n <= $check_num; $n++)
- {
- for(@{$check_add[$n]})
- {
- my ($id,$rest) = @$_;
- if($id eq '+1')
- {
- $max_id_seen++;
- $id = $max_id_seen;
- }
- my $n = sprintf("%08x ", $id);
- $expected{$n.$rest} = 1
- }
- for(@{$check_remove[$n]})
- {
- delete $expected{$filenames{$_}}
- }
- for(@{$check_move[$n]})
- {
- my ($from,$to) = @$_;
- my $orig = $filenames{$from};
- delete $expected{$filenames{$from}};
- my ($id,$type) = split / /,$orig;
- $expected{"$id $type $to"} = 1
- }
- }
-
- # read in the new listing, and compare
- open LISTING,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf \"list -r\" quit |" or die "Can't open list utility";
- open LISTING_COPY,'>testfiles/listing'.$ARGV[1].'.txt' or die "can't open copy listing file";
- my $err = 0;
- while(<LISTING>)
- {
- print LISTING_COPY;
- chomp; s/\r//;
- s/\[FILENAME NOT ENCRYPTED\]//;
- if(exists $expected{$_})
- {
- delete $expected{$_}
- }
- else
- {
- $err = 1;
- print "Unexpected object $_ in new output\n"
- }
- }
- close LISTING_COPY;
- close LISTING;
-
- # check for anything which didn't appear but should have done
- for(keys %expected)
- {
- $err = 1;
- print "Expected object $_ not found in new output\n"
- }
-
- exit $err;
-}
-elsif($ARGV[0] eq 'reroot')
-{
- open LISTING,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf \"list -r\" quit |" or die "Can't open list utility";
- open LISTING_COPY,'>testfiles/listing'.$ARGV[1].'.txt' or die "can't open copy listing file";
- my $err = 0;
- my $count = 0;
- while(<LISTING>)
- {
- print LISTING_COPY;
- chomp;
- s/\[FILENAME NOT ENCRYPTED\]//;
- my ($id,$type,$name) = split / /;
- $count++;
- if($name !~ /\Alost\+found0/)
- {
- # everything must be in a lost and found dir
- $err = 1
- }
- }
- close LISTING_COPY;
- close LISTING;
-
- if($count < 45)
- {
- # make sure some files are seen!
- $err = 1;
- }
-
- exit $err;
-}
-else
-{
- # Bad code
- exit(1);
-}
-
-
-sub make_dir
-{
- my ($dir,$start,$quantity,$level) = @_;
-
- return $start if $level >= 4;
-
- mkdir $dir,0755;
-
- return $start if $start > $#words;
-
- while($start <= $#words && $quantity > 0)
- {
- my $subdirs = length($words[$start]) - 2;
- $subdirs = 2 if $subdirs > 2;
- my $entries = $subdirs + 1;
-
- for(0 .. ($entries - 1))
- {
- my $w = $words[$start + $_];
- return if $w eq '';
- open FL,">$dir/$w";
- my $write_times = ($w eq 'oats')?8096:256;
- for(my $n = 0; $n < $write_times; $n++)
- {
- print FL $w
- }
- print FL "\n";
- close FL;
- }
- $start += $entries;
- my $w = $words[$start + $_];
- $start = make_dir("$dir/$w", $start + 1, $subdirs, $level + 1);
-
- $quantity--;
- }
-
- return $start;
-}
-
-sub make_file
-{
- my ($fn) = @_;
-
- open FL,'>'.$fn or die "can't open $fn for writing";
- for(0 .. 255)
- {
- print FL $fn
- }
- close FL;
-}
-
diff --git a/test/bbackupd/testfiles/extcheck1.pl b/test/bbackupd/testfiles/extcheck1.pl
deleted file mode 100755
index 5fc4013a..00000000
--- a/test/bbackupd/testfiles/extcheck1.pl
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-my $flags = $ARGV[0] or "";
-
-unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit 2>&1 |")
-{
- print "Couldn't open compare utility\n";
- exit 2;
-}
-
-my $ret = 1;
-my $seen = 0;
-
-while(<IN>)
-{
- next unless m/\S/;
- print "READ: $_";
-
- if (m/continousupdate/)
- {
- unless (/exists/)
- {
- print "FAIL: continousupdate line does not match\n";
- $ret = 2;
- }
- $seen = 1;
- }
- elsif (m/^No entry for terminal type/ or
- m/^using dumb terminal settings/)
- {
- # skip these lines, may happen in Debian buildd
- # with no terminal.
- }
- else
- {
- unless (/\AWARNING/ or /\ADifferences/ or /might be reason/
- or /probably due to file mod/)
- {
- print "FAIL: Summary line does not match\n";
- $ret = 2;
- }
- }
-}
-
-close IN;
-
-$ret = 2 unless $seen;
-
-exit $ret;
-
diff --git a/test/bbackupd/testfiles/extcheck2.pl b/test/bbackupd/testfiles/extcheck2.pl
deleted file mode 100755
index 9e3a9c48..00000000
--- a/test/bbackupd/testfiles/extcheck2.pl
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-use strict;
-
-my $flags = $ARGV[0] or "";
-
-unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit 2>&1 |")
-{
- print "Couldn't open compare utility\n";
- exit 2;
-}
-
-my $ret = 1;
-
-while(<IN>)
-{
- next unless m/\S/;
- print "READ: $_";
-
- if (m/continousupdate/)
- {
- unless (m/contents/ or m/attributes/)
- {
- print "FAIL: continuousupdate line does not match\n";
- $ret = 2;
- }
- }
- elsif (m/^No entry for terminal type/ or
- m/^using dumb terminal settings/)
- {
- # skip these lines, may happen in Debian buildd
- # with no terminal.
- }
- else
- {
- unless (/\AWARNING/ or /\ADifferences/ or /might be reason/
- or /probably due to file mod/)
- {
- print "FAIL: summary line does not match\n";
- $ret = 2;
- }
- }
-}
-
-close IN;
-
-exit $ret;
-
diff --git a/test/bbackupd/testfiles/notifyscript.pl b/test/bbackupd/testfiles/notifyscript.pl
deleted file mode 100755
index 5f726ca8..00000000
--- a/test/bbackupd/testfiles/notifyscript.pl
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-
-
-my $f = 'testfiles/notifyran.'.$ARGV[0].'.';
-my $n = 1;
-
-while(-e $f.$n)
-{
- $n ++;
-}
-
-open FL,'>'.$f.$n;
-print FL localtime();
-close FL;
-
diff --git a/test/bbackupd/testfiles/syncallowscript.pl b/test/bbackupd/testfiles/syncallowscript.pl
deleted file mode 100755
index ae5e10ee..00000000
--- a/test/bbackupd/testfiles/syncallowscript.pl
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/perl
-# distribution boxbackup-0.11rc2 (svn version: 2072)
-#
-# Copyright (c) 2003 - 2008
-# Ben Summers and contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All use of this software and associated advertising materials must
-# display the following acknowledgment:
-# This product includes software developed by Ben Summers.
-# 4. The names of the Authors may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# [Where legally impermissible the Authors do not disclaim liability for
-# direct physical injury or death caused solely by defects in the software
-# unless it is modified by a third party.]
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-
-use strict;
-use warnings;
-
-my $control_file = 'testfiles/syncallowscript.control';
-if (! -r $control_file)
-{
- print "now\n";
- exit 0;
-}
-
-my $control_state;
-open CONTROL, "< $control_file" or die "$control_file: $!";
-$control_state = <CONTROL>;
-defined $control_state or die "$control_file: read failed: $!";
-close CONTROL;
-
-my $marker_file_root = 'testfiles/syncallowscript.notifyran.';
-my $n = 1;
-my $marker_file;
-
-while($marker_file = $marker_file_root.$n and -e $marker_file)
-{
- $n ++;
-}
-
-open FL,'>'.$marker_file or die "$marker_file: $!";
-print FL localtime();
-close FL;
-
-print $control_state;
-exit 0;