X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvyum-worker;h=2000ffad8355503f22c369fe13baa78e3142abbb;hb=d97ddf08e9d879d15196a5c433da731c424a37ce;hp=922afb3a9fbe89d2e6a0f0149f1bb6651e32063e;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/scripts/vyum-worker b/scripts/vyum-worker index 922afb3..2000ffa 100755 --- a/scripts/vyum-worker +++ b/scripts/vyum-worker @@ -37,12 +37,9 @@ test -z "$_YUM" || { ${YUM:=$_YUM} } -yum=${YUM:-yum} -conf=yum.conf -case $(yum --version) in - (2.[01234]*) - python -c 'import yum,sys; sys.exit(not hasattr(yum.config.yumconf, "getRootedPath"))' &>/dev/null || { - warning "\ +function check(){ + python -c "$1" &>/dev/null || { + warning "\ You are using a version of yum which is insecure and broken in chroot related operations; either apply the patches shipped in the 'contrib/' directory of util-vserver, or ask the author of yum to apply them @@ -52,9 +49,19 @@ In the meantime, 'vyum' will continue with dirty hacks which might not work when the vserver is running and local DOS attacks are possible. Execution will continue in 5 seconds..." - sleep 5 - conf=yum-hack.conf - } + sleep 5 + conf=yum-hack.conf + } +} + +yum=${YUM:-yum} +conf=yum.conf +case $($yum --version|tail -n 1) in + (2.[012345]*) + check 'import yum,sys; sys.exit(not hasattr(yum.config.yumconf, "getRootedPath"))' + ;; + (2.6*) + check 'import yum,sys; sys.exit(not hasattr(yum.config.YumConf, "getRootedPath"))' ;; esac