diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index 969b32201..e3933a9b6 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -80,10 +80,15 @@ if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ]; then echo "Begin Debian build..." - # Uncompress the Crud tarball and move it into place - tar -xzf build/crud-${CRUDVER}.tar.gz - rmdir web/api/app/Plugin/Crud - mv -f crud-${CRUDVER} web/api/app/Plugin/Crud + # Uncompress the Crud tarball and move it into place + if [ -e "web/api/app/Plugin/Crud/LICENSE.txt" ]; then + echo "Crud plugin already installed..." + else + echo "Unpacking Crud plugin..." + tar -xzf build/crud-${CRUDVER}.tar.gz + rmdir web/api/app/Plugin/Crud + mv -f crud-${CRUDVER} web/api/app/Plugin/Crud + fi if [ ${DIST} == "trusty" ] || [ ${DIST} == "precise" ]; then ln -sf distros/ubuntu1204 debian diff --git a/web/views/file.php b/web/views/file.php deleted file mode 100644 index 9b49ff059..000000000 --- a/web/views/file.php +++ /dev/null @@ -1,56 +0,0 @@ - diff --git a/web/views/image.php b/web/views/image.php index a7aacb6d2..82f0ed046 100644 --- a/web/views/image.php +++ b/web/views/image.php @@ -78,24 +78,26 @@ if ( empty($_REQUEST['path']) ) } else { $errorText = "No image path"; } -} -else -{ - $path = ZM_DIR_EVENTS . '/' . $_REQUEST['path']; - if ( !empty($user['MonitorIds']) ) - { - $imageOk = false; - $pathMonId = substr( $path, 0, strspn( $path, "1234567890" ) ); - foreach ( preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) as $monId ) - { - if ( $pathMonId == $monId ) - { - $imageOk = true; - break; +} else { + $dir_events = realpath(ZM_DIR_EVENTS); + $path = realpath($dir_events . '/' . $_REQUEST['path']); + $pos = strpos($path, $dir_events); + + if($pos == 0 && $pos !== false) { + if ( !empty($user['MonitorIds']) ) { + $imageOk = false; + $pathMonId = substr( $path, 0, strspn( $path, "1234567890" ) ); + foreach ( preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) as $monId ) { + if ( $pathMonId == $monId ) { + $imageOk = true; + break; + } } + if ( !$imageOk ) + $errorText = "No image permissions"; } - if ( !$imageOk ) - $errorText = "No image permissions"; + } else { + $errorText = "Invalid image path"; } }