From f0c41d39f59b0d0d5c369e5201f55d7f0b72704e Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Fri, 2 May 2014 10:20:30 +0200 Subject: [PATCH] util-vserver: fixed shell scripts to not used getopt --long but -l --- .../util-vserver-getopt-long.patch | 393 ++++++++++++++++++ 1 file changed, 393 insertions(+) create mode 100644 security/util-vserver/util-vserver-getopt-long.patch diff --git a/security/util-vserver/util-vserver-getopt-long.patch b/security/util-vserver/util-vserver-getopt-long.patch new file mode 100644 index 000000000..b5cf6b84c --- /dev/null +++ b/security/util-vserver/util-vserver-getopt-long.patch @@ -0,0 +1,393 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../util-vserver/util-vserver-getopt-long.patch +# Copyright (C) 2014 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +From b97f867b35d9f4aebafbea6ced57359c5cd016ca Mon Sep 17 00:00:00 2001 +From: Christian Wiese +Date: Thu, 1 May 2014 23:02:22 +0200 +Subject: [PATCH] do not use getopt --long + +This seems to be not supported by more recent getopt (1) provided by +util-linux anymore, thus replacing it with -l. + +The problem was discovered when using getopt (1) from util-linux 2.24. + +diff --git a/gentoo/bash-wrapper b/gentoo/bash-wrapper +index 56dda76..d504a31 100755 +--- a/gentoo/bash-wrapper ++++ b/gentoo/bash-wrapper +@@ -48,7 +48,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + while true; do +diff --git a/scripts/chbind b/scripts/chbind +index 2524644..a9c809a 100755 +--- a/scripts/chbind ++++ b/scripts/chbind +@@ -60,7 +60,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit $1 + } + +-tmp=$(getopt -o + --long ncap:,nid:,ip:,bcast:,lback:,disconnect,flag:,secure,silent,help,version -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o + -l ncap:,nid:,ip:,bcast:,lback:,disconnect,flag:,secure,silent,help,version -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + OPT_CAPS=() +diff --git a/scripts/chcontext b/scripts/chcontext +index d30f645..877c0ca 100755 +--- a/scripts/chcontext ++++ b/scripts/chcontext +@@ -101,7 +101,7 @@ the GNU General Public License. This program has absolutely no warranty." + + $_VSERVER_INFO - FEATURE migrate || exec $_CHCONTEXT_COMPAT "$@" + +-tmp=$(getopt -o + --long cap:,ctx:,xid:,disconnect,domainname:,flag:,hostname:,secure,silent,help,version,spaces: -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o + -l cap:,ctx:,xid:,disconnect,domainname:,flag:,hostname:,secure,silent,help,version,spaces: -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + OPT_CAPS=() +diff --git a/scripts/legacy/vserver-copy b/scripts/legacy/vserver-copy +index 792d563..20c21a6 100755 +--- a/scripts/legacy/vserver-copy ++++ b/scripts/legacy/vserver-copy +@@ -150,7 +150,7 @@ if [ $# -eq 0 ]; then # Script invoked with no command-line args? + exit 1 + fi + +-temp=$(getopt -o hVvqd:i:rRs --long help,version,verbose,quiet,domain:,ip:,vsroot,rsh,stopstart, -n $me -- "$@") ++temp=$(getopt -o hVvqd:i:rRs -l help,version,verbose,quiet,domain:,ip:,vsroot,rsh,stopstart, -n $me -- "$@") + + if [ $? -ne 0 ]; then + echo " (See -h for help)" +diff --git a/scripts/pkgmgmt b/scripts/pkgmgmt +index 2da1b1e..9cfce4e 100755 +--- a/scripts/pkgmgmt ++++ b/scripts/pkgmgmt +@@ -444,7 +444,7 @@ function processVserver() + _umountFilesystems "$vserver" || return 1 + } + +-tmp=$(getopt -o y --long debug,externalize,internalize,help,version,force -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o y -l debug,externalize,internalize,help,version,force -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + IS_EXTERNALIZE= +diff --git a/scripts/start-vservers b/scripts/start-vservers +index a5f21e4..812044c 100755 +--- a/scripts/start-vservers ++++ b/scripts/start-vservers +@@ -81,7 +81,7 @@ set +e + + + tmp=$(getopt -o c:j:m: \ +- --long debug,help,version,start,stop,test,$VS_ALLVSERVERS_ARGS \ ++ -l debug,help,version,start,stop,test,$VS_ALLVSERVERS_ARGS \ + -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + +diff --git a/scripts/vapt-get b/scripts/vapt-get +index 7e82249..a7d2d30 100755 +--- a/scripts/vapt-get ++++ b/scripts/vapt-get +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through vsomething_opts +diff --git a/scripts/vdispatch-conf b/scripts/vdispatch-conf +index 084c687..7d80fe8 100755 +--- a/scripts/vdispatch-conf ++++ b/scripts/vdispatch-conf +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through vsomething_opts +diff --git a/scripts/vemerge b/scripts/vemerge +index 36321ab..3a46970 100755 +--- a/scripts/vemerge ++++ b/scripts/vemerge +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through vsomething_opts +diff --git a/scripts/vesync b/scripts/vesync +index 8720345..2244075 100755 +--- a/scripts/vesync ++++ b/scripts/vesync +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,all,overlay,overlay-host,overlay-only -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,all,overlay,overlay-host,overlay-only -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through vsomething_opts +diff --git a/scripts/vmount b/scripts/vmount +index c9dde07..79fcc15 100755 +--- a/scripts/vmount ++++ b/scripts/vmount +@@ -65,7 +65,7 @@ while test $# -gt 0; do + shift + done + +-tmp=$(getopt -o +o:t:an --long help,version,debug,bind,rbind,move -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +o:t:an -l help,version,debug,bind,rbind,move -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a options +diff --git a/scripts/vrpm b/scripts/vrpm +index 0bae9dd..378c867 100755 +--- a/scripts/vrpm ++++ b/scripts/vrpm +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through vsomething_opts +diff --git a/scripts/vserver b/scripts/vserver +index c9f9f24..0cecb76 100755 +--- a/scripts/vserver ++++ b/scripts/vserver +@@ -121,7 +121,7 @@ function msg() + set +e + + OPTIONS_ORIG=( "$@" ) +-tmp=$(getopt -o +sv --long nonamespace,--nonamespace,--insecure,defaulttty,help,debug,strace,debug-sysv,version,sync,verbose,silent -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +sv -l nonamespace,--nonamespace,--insecure,defaulttty,help,debug,strace,debug-sysv,version,sync,verbose,silent -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + OPTION_FORCE_SYNC= +diff --git a/scripts/vserver-build b/scripts/vserver-build +index 1a20bfd..cfca34c 100755 +--- a/scripts/vserver-build ++++ b/scripts/vserver-build +@@ -103,7 +103,7 @@ set -e + declare -a default_opts=() + test -n "$NO_DEFAULT_OPTS" || getFileArray default_opts "$__CONFDIR/.defaults/apps/build/options" || : + +-tmp=$(getopt -o +m:n: --long keep,force,i-know-its-there,debug,help,version,rootdir:,pkgbase:,$SETUP_OPTIONS -n "$(basename $0)" -- \ ++tmp=$(getopt -o +m:n: -l keep,force,i-know-its-there,debug,help,version,rootdir:,pkgbase:,$SETUP_OPTIONS -n "$(basename $0)" -- \ + "${default_opts[@]}" "$@") || exit 1 + eval set -- "$tmp" + +diff --git a/scripts/vserver-build.apt-rpm b/scripts/vserver-build.apt-rpm +index b40f9bf..14ff9b0 100644 +--- a/scripts/vserver-build.apt-rpm ++++ b/scripts/vserver-build.apt-rpm +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o +d: --long debug -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +d: -l debug -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM" +diff --git a/scripts/vserver-build.clone b/scripts/vserver-build.clone +index f3ad8b0..d029677 100644 +--- a/scripts/vserver-build.clone ++++ b/scripts/vserver-build.clone +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o '+d:s:o:X:' --long debug,pkgmgmt,source:,exclude-from: -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:s:o:X:' -l debug,pkgmgmt,source:,exclude-from: -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" +diff --git a/scripts/vserver-build.debootstrap b/scripts/vserver-build.debootstrap +index 34fd21b..ab63bf0 100644 +--- a/scripts/vserver-build.debootstrap ++++ b/scripts/vserver-build.debootstrap +@@ -128,7 +128,7 @@ function fixupDebian + ### main starts here <--- + + +-tmp=$(getopt -o '+d:m:s:' --long debug -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:m:s:' -l debug -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + init +diff --git a/scripts/vserver-build.fai b/scripts/vserver-build.fai +index 6e2333f..9a99419 100644 +--- a/scripts/vserver-build.fai ++++ b/scripts/vserver-build.fai +@@ -14,7 +14,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o '+d:f:n:a' --long debug,pkgmgmt -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:f:n:a' -l debug,pkgmgmt -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" +diff --git a/scripts/vserver-build.rpm b/scripts/vserver-build.rpm +index 3de83de..5eb93be 100644 +--- a/scripts/vserver-build.rpm ++++ b/scripts/vserver-build.rpm +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o +d:b:e --long debug,empty -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +d:b:e -l debug,empty -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM" +diff --git a/scripts/vserver-build.rsync b/scripts/vserver-build.rsync +index 0260834..cb79e0c 100644 +--- a/scripts/vserver-build.rsync ++++ b/scripts/vserver-build.rsync +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o '+d:s:o:' --long debug,pkgmgmt,source: -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:s:o:' -l debug,pkgmgmt,source: -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" +diff --git a/scripts/vserver-build.skeleton b/scripts/vserver-build.skeleton +index 90ddd3b..80b6383 100644 +--- a/scripts/vserver-build.skeleton ++++ b/scripts/vserver-build.skeleton +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o '+d:' --long debug,pkgmgmt -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:' -l debug,pkgmgmt -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" +diff --git a/scripts/vserver-build.template b/scripts/vserver-build.template +index 77b7326..837044c 100644 +--- a/scripts/vserver-build.template ++++ b/scripts/vserver-build.template +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o '+d:t:' --long debug,pkgmgmt,template:,nodevsanity -n "vserver-build.template" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:t:' -l debug,pkgmgmt,template:,nodevsanity -n "vserver-build.template" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" +diff --git a/scripts/vserver-build.urpmi b/scripts/vserver-build.urpmi +index c372535..056859d 100644 +--- a/scripts/vserver-build.urpmi ++++ b/scripts/vserver-build.urpmi +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o '+d:m:o:' --long debug,mirror:,mirrorlist -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o '+d:m:o:' -l debug,mirror:,mirrorlist -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT" +diff --git a/scripts/vserver-build.yum b/scripts/vserver-build.yum +index 23fe436..1d5194b 100644 +--- a/scripts/vserver-build.yum ++++ b/scripts/vserver-build.yum +@@ -15,7 +15,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +-tmp=$(getopt -o +d: --long debug -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +d: -l debug -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + . "$_LIB_VSERVER_BUILD_FUNCTIONS_RPM" +diff --git a/scripts/vsomething b/scripts/vsomething +index a87c1b7..20d144b 100755 +--- a/scripts/vsomething ++++ b/scripts/vsomething +@@ -60,7 +60,7 @@ the GNU General Public License. This program has absolutely no warranty." + is_quiet= + declare -a vservers=() + +-tmp=$(getopt -o +q --long help,version,debug,quiet -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + while true; do +diff --git a/scripts/vupdateworld b/scripts/vupdateworld +index ebc5edf..95ff553 100755 +--- a/scripts/vupdateworld ++++ b/scripts/vupdateworld +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through vsomething_opts +diff --git a/scripts/vurpm b/scripts/vurpm +index 0e60186..a239e56 100755 +--- a/scripts/vurpm ++++ b/scripts/vurpm +@@ -49,7 +49,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,all -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,all -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through urpmi_opts +diff --git a/scripts/vyum b/scripts/vyum +index 7004d87..d897d81 100755 +--- a/scripts/vyum ++++ b/scripts/vyum +@@ -46,7 +46,7 @@ the GNU General Public License. This program has absolutely no warranty." + exit 0 + } + +-tmp=$(getopt -o +q --long help,version,debug,quiet,all -n "$0" -- "$@") || exit 1 ++tmp=$(getopt -o +q -l help,version,debug,quiet,all -n "$0" -- "$@") || exit 1 + eval set -- "$tmp" + + declare -a send_through yum_opts +-- +1.7.2.3 +