s!/etc/slackware-release!/etc/slackware-version! (reported by bubulak)
[util-vserver.git] / util-vserver / scripts / vyum-worker
index f899e97..922afb3 100755 (executable)
@@ -38,9 +38,24 @@ test -z "$_YUM" || {
 }
 
 yum=${YUM:-yum}
+conf=yum.conf
 case $(yum --version) in
-    (2.[0123]*)                conf=yum-hack.conf;;
-    (*)                        conf=yum.conf;;
+    (2.[01234]*)
+       python -c 'import yum,sys; sys.exit(not hasattr(yum.config.yumconf, "getRootedPath"))' &>/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
+(preferred).
+
+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
+       }
+       ;;
 esac
 
 rpmFake.exec $yum \