From: Daniel Hokka Zakrisson Date: Thu, 6 Sep 2007 17:48:35 +0000 (+0000) Subject: Unbreak dynamic contexts. X-Git-Tag: release-0.30.215~96 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12fb89d20ac9b975ab861d827672203468a38541;p=util-vserver.git Unbreak dynamic contexts. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2610 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/scripts/vserver.functions b/scripts/vserver.functions index 78d37e8..01e4c4a 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -611,7 +611,8 @@ function _generateTagOptions local vdir="$1" local tag - getFileValue tag "$vdir/tag" "$vdir/context" || return 0 + getFileValue tag "$vdir/tag" "$vdir/context" + test -n "$tag" || return 0 OPTS_VTAG_CREATE=( --tag "$tag" ) OPTS_VTAG_ENTER=( --tag "$tag" ) diff --git a/src/vtag.c b/src/vtag.c index edf9766..9c43c8b 100644 --- a/src/vtag.c +++ b/src/vtag.c @@ -109,6 +109,16 @@ doit(struct Arguments const *args, char *argv[]) else goto exec; } + if (args->tag == VC_DYNAMIC_XID) { + if (args->verbosity >= 1) { + WRITE_MSG(2, "You must specify the tag with '--tag'; try '--help' for more information\n"); + return wrapper_exit_code; + } + else { + WRITE_MSG(2, ENSC_WRAPPERS_PREFIX "WARNING: A dynamic tag has been specified, this is not supported\n"); + goto exec; + } + } if (args->do_create) { tag = vc_tag_create(args->tag); @@ -140,7 +150,7 @@ exec: int main (int argc, char *argv[]) { struct Arguments args = { - .tag = VC_NOCTX, + .tag = VC_DYNAMIC_XID, .do_create = false, .do_migrate = false, .is_silentexist = false, @@ -173,8 +183,6 @@ int main (int argc, char *argv[]) WRITE_MSG(2, "Neither '--create' nor '--migrate' specified; try '--help' for more information\n"); else if (args.do_create && args.do_migrate) WRITE_MSG(2, "Can not specify '--create' and '--migrate' at the same time; try '--help' for more information\n"); - else if (args.tag==VC_NOCTX) - WRITE_MSG(2, "You must specify the tag with '--tag'; try '--help' for more information\n"); else if (optind>=argc) WRITE_MSG(2, "No command given; use '--help' for more information.\n"); else