Send plymouth mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.freedesktop.org/mailman/listinfo/plymouth
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of plymouth digest..."


Today's Topics:

   1. [PATCH] fix old socket name after 9de731ed and 3ec007a4
      (Andrey Borzenkov)


----------------------------------------------------------------------

Message: 1
Date: Thu, 18 Nov 2010 21:35:11 +0300
From: Andrey Borzenkov <[email protected]>
Subject: [PATCH] fix old socket name after 9de731ed and 3ec007a4
To: [email protected]
Cc: [email protected]
Message-ID: <[email protected]>

Commit 9de731ed29db4670c1641aedd945c56fd1a3feed caused
plymouth to lose leading '\0' on old abstract socket
making it incompatible with older server. As result new
client (after update) can no more communicate with old
running server (or older server as part of initrd).

Restore proper behaviour of having 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 <[email protected]>

---
 src/client/ply-boot-client.c |    7 +++++--
 src/libply/ply-utils.c       |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/client/ply-boot-client.c b/src/client/ply-boot-client.c
index 74979c9..cfd763f 100644
--- a/src/client/ply-boot-client.c
+++ b/src/client/ply-boot-client.c
@@ -191,8 +191,11 @@ ply_boot_client_connect (ply_boot_client_t *client,
       client->socket_fd =
           ply_connect_to_unix_socket 
(PLY_BOOT_PROTOCOL_OLD_ABSTRACT_SOCKET_PATH,
                                       PLY_UNIX_SOCKET_TYPE_ABSTRACT);
-      ply_trace ("could not connect to " 
PLY_BOOT_PROTOCOL_OLD_ABSTRACT_SOCKET_PATH ": %m");
-      return false;
+      if (client->socket_fd < 0)
+        {
+          ply_trace ("could not connect to " 
PLY_BOOT_PROTOCOL_OLD_ABSTRACT_SOCKET_PATH ": %m");
+          return false;
+        }
     }
 
   client->disconnect_handler = disconnect_handler;
diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
index 2685543..5b06e49 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);
-- 
tg: (48f04ad..) upstream/abstract-socket (depends on: master)


------------------------------

_______________________________________________
plymouth mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/plymouth


End of plymouth Digest, Vol 25, Issue 4
***************************************

Reply via email to