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=557d2996ed86689c11dcf0b528dc0b254e9b76d2;hp=fd2066200831d572511bcaf518d57abf8558c905;hpb=b4dfd7a2ba75cb74b391b27f0478fb07b1fe3b3f;p=util-vserver.git diff --git a/util-vserver/src/vunify-init.hc b/util-vserver/src/vunify-init.hc index fd20662..b1aa7de 100644 --- a/util-vserver/src/vunify-init.hc +++ b/util-vserver/src/vunify-init.hc @@ -47,22 +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 const dst_vserver = { argv[0], true }; + 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, &dst_vserver, &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); }