Changeset 1998


Ignore:
Timestamp:
Jul 10, 2008, 5:48:47 PM (11 years ago)
Author:
bruno
Message:
  • Improves again the security of the rm used
Location:
branches/2.2.7/mindi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.7/mindi/mindi

    r1993 r1998  
    16211621        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\
    16221622Sorry, your kernel is too big for your image.\n" >> $LOGFILE
    1623         rm -f $mountpoint/vmlinuz
     1623        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    16241624        cd $old_pwd
    16251625        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    16261626        rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
    16271627    #   losetup /dev/loop0 -d
    1628         rm -f $imagefile
     1628        [ "$imagefile" != "" ] && rm -f $imagefile
    16291629        return 0
    16301630    fi
     
    16341634    echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE
    16351635    # make it bootable
    1636     rm -f $mountpoint/zero
     1636    [ "$mountpoint" != "" ] && rm -f $mountpoint/zero
    16371637    [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE
    16381638    if [ "$KERN_DISK_MADE" ] ; then
     
    16531653        echo -en "...failed\n"
    16541654        LogIt $BOOT_SIZE"KB boot disk was NOT created\n"
    1655         rm -f $imagefile
     1655        [ "$imagefile" != "" ] && rm -f $imagefile
    16561656    fi
    16571657    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero"
     
    17121712        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\
    17131713Sorry, your kernel is too big for your image.\n" >> $LOGFILE
    1714         rm -f $mountpoint/vmlinuz
     1714        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    17151715        cd $old_pwd
    17161716        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    17171717        rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
    17181718
    1719         rm -f $imagefile
     1719        [ "$imagefile" != "" ] && rm -f $imagefile
    17201720        return 0
    17211721    fi
     
    17261726
    17271727    # make it bootable
    1728     rm -f $mountpoint/zero
     1728    [ "$mountpoint" != "" ] && rm -f $mountpoint/zero
    17291729    mkdir -p $mountpoint/etc
    17301730    [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE
     
    17361736        echo -en "...$DONE\n"
    17371737        if [ "$KERN_DISK_MADE" ] ; then
    1738             rm -f $imagefile
     1738            [ "$imagefile" != "" ] && rm -f $imagefile
    17391739            LogIt "$BOOT_SIZE KB boot disks were created OK\n"
    17401740        fi
     
    17421742        echo -en "...failed\n"
    17431743        LogIt $BOOT_SIZE"KB boot disk was NOT created\n"
    1744         rm -f $imagefile
     1744        [ "$imagefile" != "" ] && rm -f $imagefile
    17451745    fi
    17461746    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero"
     
    21622162                if [ "`echo $i | cut -c1`" = "/" ]; then
    21632163                    j=`echo $i | cut -c2-`
    2164                     rm -f $j
     2164                    [ "$j" != "" ] && rm -f $j
    21652165                fi
    21662166            done
  • branches/2.2.7/mindi/rootfs/sbin/install-additional-tools

    r1997 r1998  
    2222if [ ! "$GROOVY" ] ; then
    2323    LogIt "I'm not groovy!"
     24    exit 1
     25fi
     26
     27if [ $mountdir = "/" ]; then
     28    LogIt "mountdir shouldn't be /"
    2429    exit 1
    2530fi
     
    8287LogIt "Exiting install-additional-tools"
    8388exit 0
    84 
    85 # exit $res
    86 
Note: See TracChangeset for help on using the changeset viewer.