Commit bdb3f441 by Serge Hallyn

lxc_abstract_unix_connect: accomodate containers started before Oct 28

commit aae93dd3 fixed the command socket name to use the right pathlen instead of always passing in the max socket namelen. However, this breaks lxc-info/lxc-list/etc for containers started before that commit. So if the correct command sock name doesn't work, try the preexising one. Note we can probably undo this "after awhile". Maybe in august 2014. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 293ec758
...@@ -135,6 +135,9 @@ int lxc_abstract_unix_connect(const char *path) ...@@ -135,6 +135,9 @@ int lxc_abstract_unix_connect(const char *path)
if (connect(fd, (struct sockaddr *)&addr, offsetof(struct sockaddr_un, sun_path) + len)) { if (connect(fd, (struct sockaddr *)&addr, offsetof(struct sockaddr_un, sun_path) + len)) {
int tmp = errno; int tmp = errno;
/* special case to connect to older containers */
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == 0)
return fd;
process_lock(); process_lock();
close(fd); close(fd);
process_unlock(); process_unlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment