Changeset 2153


Ignore:
Timestamp:
Feb 17, 2009, 7:58:26 PM (10 years ago)
Author:
bruno
Message:

Even better protection for bad MINDI_TMP or bad MONDO_TMP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/mindi

    r2151 r2153  
    9898    Die "Unable to create a temporary directory ! Check space on $TMPDIR"
    9999fi
     100if [ _"$MINDI_TMP" = _"" ]; then
     101    Die "MINDI_TMP is empty, aborting"
     102fi
     103if [ _"$MINDI_TMP" = _"/" ]; then
     104    Die "MINDI_TMP is /, aborting"
     105fi
    100106export MINDI_TMP
    101107
     
    238244    # Clean temporary files only when standalone mindi
    239245    if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then
    240         # If no space on /tmp we may have an empty var
    241         if [ _"$MINDI_TMP" != _"" ]; then
    242             # Paranoid mode
    243             if [ _"$MINDI_TMP" != _"/" ]; then
    244                 rm -Rf $MINDI_TMP
    245             fi
    246         fi
     246        rm -Rf $MINDI_TMP
    247247    fi
    248248    exit $1
     
    12961296        [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0
    12971297    fi
    1298     if [ _"$MINDI_TMP" = _"" ]; then
    1299         Die "MINDI_TMP undefined"
    1300     fi
    13011298    rm -Rf $MINDI_TMP/iso
    13021299    mkdir -p $MINDI_TMP/iso/{images,archives}
     
    13671364        read i
    13681365        [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0
    1369     fi
    1370     if [ _"$MINDI_TMP" = _"" ]; then
    1371         Die "MINDI_TMP undefined"
    13721366    fi
    13731367    rm -Rf $MINDI_TMP/usb
     
    26522646        # Change MINDI_TMP for the one provided by mondo
    26532647        # So that it can get back the built files
     2648        if [ _"$MONDO_TMP" = _"" ]; then
     2649            Die "MONDO_TMP is empty, aborting"
     2650        fi
     2651        if [ _"$MONDO_TMP" = _"/" ]; then
     2652            Die "MONDO_TMP is /, aborting"
     2653        fi
    26542654        mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2>> $LOGFILE
    26552655        rmdir $MINDI_TMP
Note: See TracChangeset for help on using the changeset viewer.