Ignore:
Timestamp:
05/10/13 10:56:32 (20 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
43c8ecf
Parents:
7ca5cb8
Message:

Add some extra checks when we import old jails -> new format

Make sure IPV4 ends up with a /24 at the end

Also check at jail startup, in case somehow user imported jail with wrong config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/scripts/backend/startjail.sh

    r738f740 ra68c384  
    154154if [ -e "${JMETADIR}/ipv4" ] ; then 
    155155  IP4=`cat "${JMETADIR}/ipv4"` 
     156 
     157  # Check if somebody snuck in a IP without / on it 
     158  echo $IPV4 | grep -q '/'  
     159  if [ $? -ne 0 ] ; then 
     160     IPV4="${IPV4}/24" 
     161  fi 
    156162fi 
    157163 
     
    167173if [ -e "${JMETADIR}/ipv6" ] ; then 
    168174  IP6=`cat "${JMETADIR}/ipv6"` 
     175  # Check if somebody snuck in a IP without / on it 
     176  echo $IPV6 | grep -q '/'  
     177  if [ $? -ne 0 ] ; then 
     178     IPV6="${IPV6}/64" 
     179  fi 
    169180fi 
    170181 
Note: See TracChangeset for help on using the changeset viewer.