Philipp Wehrheim wrote:
Hey,

the attached patch fixes an issue where vzctl overwrites the symlink
to CTs config.
For the sake of people reading this thread. The issue is a subject of bug #1270 [1] and it was already fixed in GIT [2]. Will be available in vzctl-3.0.24 (to be released
this year).

[1] http://bugzilla.openvz.org/show_bug.cgi?id=1270
[2] http://git.openvz.org/?p=vzctl;a=commit;h=35c8a3e3c963446e98b087ea629f32647512af25
In my setup the CT config is stored in /vz/ve/<CTID>/<CTID>.conf
and linked back to /etc/vz/conf/<CTID>.conf .If I make changes to the
CTs config via "vzctl set ..." the link is overwritten by vzctl on writeback.

Please consider applying.

cheers
flip


--- a/src/lib/config.c  2009-11-04 08:39:18.000000000 +0100
+++ b/src/lib/config.c  2009-11-04 08:39:18.000000000 +0100
@@ -2351,6 +2351,8 @@
        vps_param *tmp_old_p = NULL;
        list_head_t conf, new_conf;
        int ret, n;
+       char buf[4096];
+       ssize_t llen;

        list_head_init(&conf);
        list_head_init(&new_conf);
@@ -2359,6 +2361,13 @@
                vps_parse_config(veid, path, tmp_old_p, action);
                old_p = tmp_old_p;
        }
+
+       /* if path is a symlink dereference it */
+       if ((llen = readlink(path, buf, sizeof(buf)-1)) != -1) {
+               buf[llen] = '\0';
+               strcpy(path,buf);
+       }
+
        if ((ret = read_conf(path, &conf)))
                return ret;
        n = store(old_p, new_p, &new_conf);

_______________________________________________
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users

_______________________________________________
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users

Reply via email to