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>
* 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);