Skip to content

Commit

Permalink
jail -u: Verify TORELEASE before performing jail upgrade
Browse files Browse the repository at this point in the history
In case we use FreeBSD dists and TORELEASE is present, check if it's a release
branch. (verify it even before trying to mount the jail prevents accidents, and
"exit 1" ensures no unnecessary calls and traffic to FreeBSD's update servers
will be performed)

add *-STABLE to the list of possible snapshot versions.

Issue #509
  • Loading branch information
egypcio authored and bdrewery committed Jul 6, 2017
1 parent 14cecf8 commit 9ae57ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/share/poudriere/jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ update_jail() {
msg "Upgrading using ${METHOD}"
case ${METHOD} in
ftp|http|ftp-archive)
# In case we use FreeBSD dists and TORELEASE is present, check if it's a release branch.
if [ -n "${TORELEASE}" ]; then
case ${TORELEASE} in
*-ALPHA*|*-CURRENT|*-PRERELEASE|*-STABLE)
msg_error "Only release branches are supported by the ${METHOD} method."
msg_error "Please try to upgrade to a new BETA, RC or RELEASE version."
exit 1
;;
*) ;;
esac
fi
MASTERMNT=${JAILMNT}
MASTERNAME=${JAILNAME}-${PTNAME}${SETNAME:+-${SETNAME}}
[ -n "${RESOLV_CONF}" ] && cp -v "${RESOLV_CONF}" "${JAILMNT}/etc/"
Expand Down

0 comments on commit 9ae57ef

Please sign in to comment.