X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fgetvserverbyctx-compat.hc;h=4c63738a4287f2e4bfa422a1905206d2be6d1c32;hb=3b34449070c0846fdc49436d1edd5916512f1644;hp=66acfa3886f30cdc03d2e2b6de823cdc323cee14;hpb=3f3cf95f755f3ef1c31ad8e38153deb4ee214c66;p=util-vserver.git diff --git a/lib/getvserverbyctx-compat.hc b/lib/getvserverbyctx-compat.hc index 66acfa3..4c63738 100644 --- a/lib/getvserverbyctx-compat.hc +++ b/lib/getvserverbyctx-compat.hc @@ -1,4 +1,4 @@ -// $Id: getvserverbyctx-compat.hc,v 1.3 2004/06/27 13:01:28 ensc Exp $ --*- c -*-- +// $Id: getvserverbyctx-compat.hc 2182 2005-10-25 16:20:07Z ensc $ --*- c -*-- // Copyright (C) 2003 Enrico Scholz // @@ -67,7 +67,8 @@ handleLegacy(xid_t UNUSED xid) #endif static char * -vc_getVserverByCtx_compat(xid_t ctx, vcCfgStyle *style, char const *revdir) +vc_getVserverByCtx_compat(xid_t ctx, vcCfgStyle *style, char const *revdir, + bool validate_result) { if (revdir==0) revdir = DEFAULT_PKGSTATEREVDIR; @@ -92,8 +93,10 @@ vc_getVserverByCtx_compat(xid_t ctx, vcCfgStyle *style, char const *revdir) switch (cur_style) { case vcCFG_RECENT_SHORT : case vcCFG_RECENT_FULL : - // check if expected ctx == actual ctx - if (vc_getVserverCtx(path, vcCFG_RECENT_FULL, false, 0)!=ctx) return 0; + // check if expected ctx == actual ctx (but only when this check is + // request) + if (validate_result && + vc_getVserverCtx(path, vcCFG_RECENT_FULL, false, 0)!=ctx) return 0; if (style) *style = vcCFG_RECENT_FULL; return strdup(path);