From 2ee30de3b7a0794e901a2965feb3716fb5783231 Mon Sep 17 00:00:00 2001 From: lars Date: Thu, 30 Nov 2006 14:41:09 +0000 Subject: [PATCH] removed check for uid!=0 removed obsolete [Locations][LangDir] setting --- bin/CryptoBoxRootActions | 26 +++++++++-- bin/CryptoBoxWebserver | 20 +++++++++ bin/cryptobox-unittests.conf | 87 ++++++++++++++++++++++++++++++++++++ bin/cryptobox.conf | 8 +--- bin/do_unittests.sh | 2 +- 5 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 bin/cryptobox-unittests.conf diff --git a/bin/CryptoBoxRootActions b/bin/CryptoBoxRootActions index 7398076..08683a8 100755 --- a/bin/CryptoBoxRootActions +++ b/bin/CryptoBoxRootActions @@ -1,4 +1,24 @@ #!/usr/bin/env python2.4 +# +# Copyright 2006 sense.lab e.V. +# +# This file is part of the CryptoBox. +# +# The CryptoBox is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The CryptoBox is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the CryptoBox; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + """module for executing the programs, that need root privileges @@ -360,9 +380,9 @@ if __name__ == "__main__": args = sys.argv[1:] # do not allow to use root permissions (real uid may not be zero) - if os.getuid() == 0: - sys.stderr.write("the uid of the caller is zero (root) - this is not allowed\n") - sys.exit(100) + #if os.getuid() == 0: + # sys.stderr.write("the uid of the caller is zero (root) - this is not allowed\n") + # sys.exit(100) # check if there were arguments if (len(args) == 0): diff --git a/bin/CryptoBoxWebserver b/bin/CryptoBoxWebserver index 1ab91ff..5160253 100755 --- a/bin/CryptoBoxWebserver +++ b/bin/CryptoBoxWebserver @@ -4,6 +4,26 @@ # # run the script with "--help" to see all possible paramters # +# +# Copyright 2006 sense.lab e.V. +# +# This file is part of the CryptoBox. +# +# The CryptoBox is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The CryptoBox is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the CryptoBox; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + import os, sys import cryptobox.web.sites diff --git a/bin/cryptobox-unittests.conf b/bin/cryptobox-unittests.conf new file mode 100644 index 0000000..12f7da3 --- /dev/null +++ b/bin/cryptobox-unittests.conf @@ -0,0 +1,87 @@ +[Main] + +# comma separated list of possible prefixes for accesible devices +# beware: .e.g "/dev/hd" grants access to _all_ harddisks +AllowedDevices = /dev/loop, /dev/ubdb + +# use separate config partition? (1=yes / 0=no) +UseConfigPartition = 1 + +# the default name prefix of not unnamed containers +DefaultVolumePrefix = "Disk " + +# which cipher should cryptsetup-luks use? +#TODO: uml does not support this module - DefaultCipher = aes-cbc-essiv:sha256 +DefaultCipher = aes-plain + +# label of the configuration partition (you should never change this) +ConfigVolumeLabel = cbox_config + +# which plugins should be disabled? (comma seperated list) +#DisabledPlugins = network, shutdown, partition + + +[Locations] +# where should we mount volumes? +# this directory must be writeable by the cryptobox user (see above) +#MountParentDir = /var/cache/cryptobox/mnt +MountParentDir = ../ttt/mnt + +# settings directory: contains name database and plugin configuration +#SettingsDir = /var/cache/cryptobox/settings +SettingsDir = ../ttt/settings + +# where are the clearsilver templates? +#TemplateDir = /usr/share/cryptobox/templates +TemplateDir = ../templates + +# path to documentation files +#DocDir = /usr/share/doc/cryptobox/www-data +DocDir = ../doc/html + +# path to the plugin directory +#PluginDir = /usr/share/cryptobox/plugins +PluginDir = ../plugins + +# path to the hook directory (e.g. containing some scripts) +#HookDir = /etc/cryptobox/hooks.d +EventDir = ../event-scripts + + +[Log] +# possible values are "debug", "info", "warn" and "error" or numbers from +# 0 (debug) to 7 (error) +Level = debug + +# where to write the log messages to? +# possible values are: file +# syslog support will be added later +Destination = file + +# depending on the choosen destination (see above) you may select +# details. Possible values for the different destinations are: +# file: $FILENAME +# syslog: $LOG_FACILITY +#Details = /var/log/cryptobox.log +Details = ./cryptobox.log + + +[WebSettings] +# URL of default stylesheet +Stylesheet = /cryptobox-misc/cryptobox.css + +# default language +Languages = en, de, sl, fr + + +[Programs] +cryptsetup = /sbin/cryptsetup +mkfs-data = /sbin/mkfs.ext3 +blkid = /sbin/blkid +blockdev = /sbin/blockdev +mount = /bin/mount +umount = /bin/umount +super = /usr/bin/super +# this is the "program" name as defined in /etc/super.tab +CryptoBoxRootActions = CryptoBoxRootActions + diff --git a/bin/cryptobox.conf b/bin/cryptobox.conf index 1350a5a..be84c22 100644 --- a/bin/cryptobox.conf +++ b/bin/cryptobox.conf @@ -35,15 +35,11 @@ SettingsDir = ../ttt/settings #TemplateDir = /usr/share/cryptobox/templates TemplateDir = ../templates -# path to language files -#LangDir = /usr/share/cryptobox/lang -LangDir = ../lang - # path to documentation files #DocDir = /usr/share/doc/cryptobox/www-data DocDir = ../doc/html -# path to the plugin directory +# plugin directories - you may specify more than one directory (comma seperated) #PluginDir = /usr/share/cryptobox/plugins PluginDir = ../plugins @@ -75,7 +71,7 @@ Details = ./cryptobox.log Stylesheet = /cryptobox-misc/cryptobox.css # default language -Languages = de, en +Languages = en, de, sl, fr [Programs] diff --git a/bin/do_unittests.sh b/bin/do_unittests.sh index ae4a64b..d09cd46 100755 --- a/bin/do_unittests.sh +++ b/bin/do_unittests.sh @@ -8,7 +8,7 @@ BASE_DIR=$(cd "$(dirname $0)/.."; pwd) export PYTHONPATH=$BASE_DIR/src # check if /dev/loop1 is available - otherwise some tests will fail! -if /sbin/losetup /dev/loop1 &>/dev/null +if /sbin/losetup /dev/loop1 &>/dev/null || test -e /dev/ubdb then true else echo "misconfiguration detected: sorry - you need /dev/loop1 for the tests" >&2 echo "just do the following:" >&2