From: Kern Sibbald Date: Mon, 19 Sep 2005 17:00:05 +0000 (+0000) Subject: Fix temp file security problem + remove linux/floppy X-Git-Tag: Release-1.38.0~107 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c7900d44e21f90ecfab15495b37d12dff5e96551;p=bacula%2Frescue Fix temp file security problem + remove linux/floppy --- diff --git a/rescue/linux/floppy/.cvsignore b/rescue/linux/floppy/.cvsignore deleted file mode 100644 index ee40e78..0000000 --- a/rescue/linux/floppy/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile -diskinfo -format.hda -mount_drives -partition.hda -sfdisk -start_network -1 -bacula-fd -bacula-fd.conf diff --git a/rescue/linux/floppy/Makefile.in b/rescue/linux/floppy/Makefile.in deleted file mode 100755 index ed51354..0000000 --- a/rescue/linux/floppy/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# bootstrap/linux Makefile.in -# -# Version $Id$ -# -@MCOMMON@ - -working_dir=@working_dir@ - -srcdir = @srcdir@ -VPATH = @srcdir@ -.PATH: @srcdir@ -topdir = ../.. -thisdir = linux - - -first_rule: all -dummy: - -MKDIR = $(topdir)/autoconf/mkinstalldirs - -#------------------------------------------------------------------------- - -all: Makefile - -depend: - - -#------------------------------------------------------------------------- - - -install: - -uninstall: - -Makefile: Makefile.in - cd $(topdir) \ - && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -Makefiles: - $(SHELL) config.status - -clean: - @$(RMF) *~ 1 2 3 - @$(RMF) format.* partition.* start_network mount_drives - @$(RMF) sfdisk bacula-fd bacula-fd.gz bacula-fd.conf - @$(RMF) -r diskinfo - -# clean for distribution -distclean: clean - @$(RMF) Makefile - @$(RMF) -r CVS - -devclean: clean - @$(RMF) Makefile - -# ------------------------------------------------------------------------ diff --git a/rescue/linux/floppy/backup.etc.list b/rescue/linux/floppy/backup.etc.list deleted file mode 100644 index 43855e6..0000000 --- a/rescue/linux/floppy/backup.etc.list +++ /dev/null @@ -1,13 +0,0 @@ -/etc/exports -/etc/fstab -/etc/group -/etc/gshadow -/etc/host.conf -/etc/hosts -/etc/hosts.allow -/etc/hosts.deny -/etc/modules.conf -/etc/passwd -/etc/resolv.conf -/etc/shadow -/etc/sysconfig diff --git a/rescue/linux/floppy/format_floppy b/rescue/linux/floppy/format_floppy deleted file mode 100755 index 39e43be..0000000 --- a/rescue/linux/floppy/format_floppy +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# -# Format Floppy -# -export LANG=C -echo "" -echo "This script will format your floppy" -echo "" -echo "IT WILL DESTROY ALL DATA ON THE FLOPPY !!!!" -echo "" -echo -n "Are you sure you want to continue? (yes/no): " -read a -if [ x$a != xyes ] ; then - exit 1 -fi -echo -n "Do you want to do a block check (takes time)? (yes/no): " -read a -if [ x$a = xyes ] ; then - check="-c" -else - check= -fi -echo "" -echo "Formating /dev/fd0 -- ext2 partition" -mke2fs -v $check /dev/fd0 -echo "" diff --git a/rescue/linux/floppy/getdiskinfo b/rescue/linux/floppy/getdiskinfo deleted file mode 100755 index 61785bb..0000000 --- a/rescue/linux/floppy/getdiskinfo +++ /dev/null @@ -1,223 +0,0 @@ -#!/bin/sh -# -# Create bootstrap information files -- prelude to creating a -# Bacula Rescue Disk -# -# Kern Sibbald, December MMII -# This source distributed under the GPL -# -export LANG=C -di=diskinfo -cwd=`pwd` -host=`uname -s` - -case $host in - Linux) - ;; - FreeBSD | SunOS | IRIX) - echo "" - echo "This code is not yet adapted to this OS" - exit 1 - ;; - *) - echo "" - echo "Unknown operating system type: $host" - exit 1 - ;; -esac -if [ ! `whoami` = "root" ] ; then - echo "" - echo "You need to be root to run this, otherwise" - echo "sfdisk produces no output. Continuing anyway ..." - echo "" -fi - -# -# First collect information -# -rm -rf format.* partition.* $di -echo "Begin collecting system info ..." -mkdir -p $di -cd $di -mount -l >mount.bsi -mount -l -t ext2 >mount.ext2.bsi -mount -l -t ext3 >mount.ext3.bsi -cp /etc/fstab fstab.bsi -cp /etc/mtab mtab.bsi -df -Tl >df.bsi -sfdisk -s >sfdisk.disks.bsi -grep "^/dev/" sfdisk.disks.bsi | sed -n 's%\(^/dev/[A-Za-z]*\):.*$%\1%p' >disks.bsi -for i in `cat disks.bsi`; do - j=`echo $i | cut -c6-` - sfdisk -l $i >sfdisk.$j.bsi - sfdisk -d $i >sfdisk.make.$j.bsi -done -route -n >route.bsi -ifconfig >ifconfig.bsi -echo "Done collecting info." - -# -# Done collecting information -# - - -echo "Begin creating scripts ..." -# -# First create partitioning script(s) -# -for i in `cat disks.bsi`; do - j=`echo $i | cut -c6-` - cat >$cwd/partition.$j <$cwd/format.$j <>$cwd/format.$j - echo "mkswap $check $disk" >>$cwd/format.$j - echo "echo \"\"" >>$cwd/format.$j - done - # Find ext2 partitions in mount output - k=`grep "^$i" mount.ext2.bsi | cut -d ' ' -f 1` - for disk in $k; do - echo "echo \"Formating $disk -- ext2 partition\"" >>$cwd/format.$j - label=`grep "^$disk" mount.ext2.bsi | cut -d ' ' -f 7 | cut -c2- | cut -d ] -f 1` - if [ x$label = x ] ; then - echo "mke2fs -v \$check $disk" >>$cwd/format.$j - else - echo "mke2fs -v \$check -L $label $disk" >>$cwd/format.$j - fi - echo "echo \"\"" >>$cwd/format.$j - done - # Find ext3 partitions in mount output - k=`grep "^$i" mount.ext3.bsi | cut -d ' ' -f 1` - for disk in $k; do - echo "echo \"Formating $disk -- ext3 partition\"" >>$cwd/format.$j - label=`grep "^$disk" mount.ext3.bsi | cut -d ' ' -f 7 | cut -c2- | cut -d ] -f 1` - if [ x$label = x ] ; then - echo "mke2fs -v -j \$check $disk" >>$cwd/format.$j - else - echo "mke2fs -v -j \$check -L $label $disk" >>$cwd/format.$j - fi - echo "echo \"\"" >>$cwd/format.$j - done - chmod 755 $cwd/format.$j -done - -cd $cwd - -# -# Create network start script -# -host=`hostname` -ip=`host $host | cut -d ' ' -f 4` -if [ $ip = "out;" ] ; then - ip=`ifconfig | grep inet | head -1 | sed -n 's/\ \+inet addr:\([0-9]\+\(\.[0-9]\+\)\{3\}\).*/\1/p'` -fi -cat >start_network <mount_drives </tmp/1$$ -sed -n 's/\(^.*\)\ on\ \(.*\)\ type.*$/\1 \/mnt\/disk\2/p' $di/mount.ext3.bsi >>/tmp/1$$ -sed -n 's/\(^.*\)\ on\ \(.*\)\ type.*$/\1 \/mnt\/disk\2/p' $di/mount.rei.bsi >>/tmp/1$$ -# sort so that / is first -sort -k 2 /tmp/2$$ -# output mkdir followed by its mount -sed -n 's/\(^.*\)\ \(.*$\)/mkdir -p \2\nmount \1 \2/p' /tmp/2$$ >>mount_drives -rm -f /tmp/1$$ /tmp/2$$ -rm -f /tmp/1$$ - -chmod 755 mount_drives - -# copy sfdisk so we will have it -cp -f /sbin/sfdisk . -echo "Done building scripts." -echo " " -echo "You might want to do a:" -echo " " -echo "chown -R uuuu:gggg *" -echo " " -echo "where uuuu is your userid and gggg is your group" -echo "so that you can access all the files as non-root" -echo " " diff --git a/rescue/linux/floppy/make_rescue_disk b/rescue/linux/floppy/make_rescue_disk deleted file mode 100755 index 3ea2688..0000000 --- a/rescue/linux/floppy/make_rescue_disk +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -# -# Script to make a Bacula "rescue" disk -# -export LANG=C -device=/mnt/floppy -dev=/dev/fd0 - -# Print Usage message -usage () { - cat <&1 >/dev/null -if [ $? = 0 ] ; then - mounted=1 -else - mounted=0 -fi -mke2fs $dev -mount $dev $device 2>&1 >/dev/null - -if [ x$make_bacula = "xyes" ] ; then - ./make_static_bacula -fi - -if [ x$copy_bacula = "xyes" -a ! -e bacula-fd ] ; then - echo " " - echo "bacula-fd not found. If you want Bacula on this" - echo "rescue disk please run \"make_static_bacula\" first." - echo "Continuing anyway ..." - echo " " - exit 1 - have_bacula=no -else - echo "Stripping and compressing Bacula" - strip bacula-fd - gzip bacula-fd - have_bacula=yes -fi - -echo "Copying files to $device" -cp -a . $device - -if [ x$copy_etc = "xyes" ] ; then - echo "Tarring /etc files to $device" - tar --create --gzip --file $device/etc.gz --files-from backup.etc.list -fi - -if [ x$have_bacula = "xyes" ] ; then - rm -f bacula-fd.gz bacula-fd.conf -fi -sync -if [ $mounted = 0 ] ; then - umount $device -fi diff --git a/rescue/linux/floppy/restore_etc b/rescue/linux/floppy/restore_etc deleted file mode 100755 index ea2239e..0000000 --- a/rescue/linux/floppy/restore_etc +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Note, this creates the directory etc, so if you want -# the files to go into the real /etc, you must be one -# level up when executing it. Otherwise you end up with -# a /etc/etc directory. -# -export LANG=C -device=/mnt/floppy -tar -v -z -f $device/etc.gz diff --git a/rescue/linux/floppy/run_grub b/rescue/linux/floppy/run_grub deleted file mode 100755 index b00c796..0000000 --- a/rescue/linux/floppy/run_grub +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# Script to run grub to recreate the MBR -# -export LANG=C -# Find boot partition if any -bootp=`grep "^/dev/.*\ on\ /boot" diskinfo/mount.bsi | cut -d ' ' -f 1` -# find boot device -if [ x$bootp != x ] ; then - bootdev=`echo $bootp | cut -c1-8` -else - bootdev=`grep "^/dev/.*\ on\ /" diskinfo/mount.bsi | cut -c1-8` -fi -echo "Boot device is $bootdev" -echo " " -echo "To manually install grub, enter:" -echo "chroot /mnt/disk" -echo "/sbin/grub-install $bootdev" -echo " " -echo "Attempting to install grub ..." -echo " " -chroot /mnt/disk /sbin/grub-install $bootdev -sync diff --git a/rescue/linux/floppy/run_lilo b/rescue/linux/floppy/run_lilo deleted file mode 100755 index 7151a14..0000000 --- a/rescue/linux/floppy/run_lilo +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# Script to run lilo and re-create the MBR -# -export LANG=C -chroot /mnt/disk /sbin/lilo -v -C /etc/lilo.conf -sync diff --git a/rescue/linux/floppy/sfdisk.bz2 b/rescue/linux/floppy/sfdisk.bz2 deleted file mode 100644 index 3e269c3..0000000 Binary files a/rescue/linux/floppy/sfdisk.bz2 and /dev/null differ diff --git a/rescue/version.h b/rescue/version.h index f0ca748..9e9a022 100644 --- a/rescue/version.h +++ b/rescue/version.h @@ -1,5 +1,5 @@ /* */ #undef VERSION -#define VERSION "1.7.0" -#define BDATE "19 May 2005" -#define LSMDATE "19May05" +#define VERSION "1.8.0" +#define BDATE "30 August 2005" +#define LSMDATE "30Aug05"