]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
utils: if concrete/abstract socket selection
authorAndrey Borzenkov <arvidjaar@gmail.com>
Thu, 18 Nov 2010 18:35:11 +0000 (21:35 +0300)
committerRay Strode <rstrode@redhat.com>
Fri, 19 Nov 2010 15:32:49 +0000 (10:32 -0500)
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>
src/libply/ply-utils.c

index 2685543a7bc50252c510e59ee7972d0c1c978b01..5b06e4939829d2b53484337aafefc38997a79fea 100644 (file)
@@ -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);