X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvyum-worker;h=c787b55a58d6f9bb891ef59f260dc0a1c2ab0230;hb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;hp=984d1d6c0d09a0e17bc2b57d20b205813f22e46e;hpb=3f3cf95f755f3ef1c31ad8e38153deb4ee214c66;p=util-vserver.git diff --git a/scripts/vyum-worker b/scripts/vyum-worker index 984d1d6..c787b55 100755 --- a/scripts/vyum-worker +++ b/scripts/vyum-worker @@ -1,5 +1,5 @@ #! /bin/bash -# $Id: vyum-worker,v 1.5 2005/04/08 19:18:06 ensc Exp $ +# $Id: vyum-worker 2551 2007-06-21 12:56:25Z dhozac $ # Copyright (C) 2003 Enrico Scholz # @@ -37,12 +37,9 @@ test -z "$_YUM" || { ${YUM:=$_YUM} } -yum=${YUM:-yum} -conf=yum.conf -case $(yum --version) in - (2.[0123]*) - 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,30 @@ 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.[6789]*|3.[012]*) + check 'import yum,sys; sys.exit(not hasattr(yum.config.YumConf, "getRootedPath"))' + ;; + (*) + warning "\ +You are using a version of yum which current status is unknown to vyum. + +Just to be sure, 'vyum' will use 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 ;; esac