Diffusion KIO 8d8f3025dffd

[KIO] Fix issues with sharing of file descriptor

Authored by chinmoyr on Jan 18 2018, 4:21 PM.

Description

[KIO] Fix issues with sharing of file descriptor

Summary:
This patch,
1.Fixes buffer overflow due to strcpy.
2.Creates socket in runtime directory of user preventing other users from accessing the socket.
3.Adds checks for socket credentials. Now a file descriptor will be received only if it was sent by a root owned process.
4.Improves error handling in FileProtocol (indirect result of fixing these issues).

These issues were mentioned in here : https://mail.kde.org/pipermail/kde-frameworks-devel/2018-January/055307.html

Differential Revision: https://phabricator.kde.org/D9966