X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvunify-init.hc;h=b1aa7de8bee50d970451f2a0caea1bca9b53c850;hb=0d5f1561a88261415e2f3cf4f1de411d11878562;hp=f661241969765bd98fef1f636f2b053a6f4d16dd;hpb=f1e8eb8d120fe6df2a53b48944ec71cbb31121c6;p=util-vserver.git diff --git a/util-vserver/src/vunify-init.hc b/util-vserver/src/vunify-init.hc index f661241..b1aa7de 100644 --- a/util-vserver/src/vunify-init.hc +++ b/util-vserver/src/vunify-init.hc @@ -47,21 +47,29 @@ initModeManually(struct Arguments const UNUSED *args, int argc, char *argv[]) static void initModeVserver(struct Arguments const UNUSED *args, int argc, char *argv[]) { - char const *appdir; + struct MatchVserverInfo vserver = { + .name = argv[0], + .use_pkgmgmt = true + }; + + if (!MatchVserverInfo_init(&vserver)) { + WRITE_MSG(2, "Failed to initialize unification for this vserver\n"); + exit(1); + } if (argc!=1) { WRITE_MSG(2, "More than one vserver is not supported\n"); exit(1); } - if (!MatchList_initByVserver(&global_info.dst_list, argv[0], &appdir)) { + if (!MatchList_initByVserver(&global_info.dst_list, &vserver)) { WRITE_MSG(2, "unification not configured for this vserver\n"); exit(1); } MatchList_initRefserverList(&global_info.src_lists.v, &global_info.src_lists.l, - appdir); - - free(const_cast(char *)(appdir)); + vserver.appdir.d); + + MatchVserverInfo_free(&vserver); }