summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@gmail.com>2010-11-18 21:35:11 +0300
committerRay Strode <rstrode@redhat.com>2010-11-19 10:32:49 -0500
commitd29722b34a49cb432bd2ea83206447223667198c (patch)
treecdf1f9502a308ce0d094e09846b0f674b8d7db20
parent48f04ad1938e35bea987deee29a9ee9f94e52e3a (diff)
utils: if concrete/abstract socket selection
Commit 9de731ed29db4670c1641aedd945c56fd1a3feed caused plymouth to erroneously drop the leading '\0' on the old abstract socket making fallback socket support not work. As result new clients (after update) can no longer communicate with old running daemons (such as from the initrd). This commit restores the leading '\0' for both abstract sockets, trimmed and non-trimmed. Commit 3ec007a4820e53aed6713620173bd997957754ec did not check for success with old socket path and failed always. Properly check for success and proceed. Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
-rw-r--r--src/libply/ply-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
index 2685543a..5b06e493 100644
--- a/src/libply/ply-utils.c
+++ b/src/libply/ply-utils.c
@@ -161,7 +161,7 @@ create_unix_address_from_path (const char *path,
* Note, we depend on the memory being zeroed by the calloc
* call above.
*/
- if (type == PLY_UNIX_SOCKET_TYPE_ABSTRACT)
+ if (type == PLY_UNIX_SOCKET_TYPE_CONCRETE)
strncpy (address->sun_path, path, sizeof (address->sun_path) - 1);
else
strncpy (address->sun_path + 1, path, sizeof (address->sun_path) - 1);