D9966: [KIO] Fix issues with sharing of file descriptor

Fabian Vogt noreply at phabricator.kde.org
Thu Jan 25 19:04:07 UTC 2018


fvogt requested changes to this revision.
fvogt added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> chinmoyr wrote in file_unix.cpp:117
> @fvogt I think the errno assignment should be fine here? 
> Except this one case, the function call whose errno value we are interested in is immediately followed by execWithElevatedPrivilege (which checks errno as the first thing). So I was saying earlier that saving errno there isn't necessary because there is no (other) library call between the failed function call and execWithElevatedPrivilege.

This looks very much like code smell. Currently you treat `errno` as a hidden function parameter.
IMO you should make it explicit.

> chinmoyr wrote in sharefd_p.h:66
> I see, it mentions some BSD-derived system ignore read/write permissions on socket file. But in FreeBSD documentation it clearly specifies destination of connect() should be writable.
> So shall I error out if OS is not linux or freebsd or mac os?

If that is the case you can do something like:

  #if !defined(__linux__) && !defined(__FreeBSD__)
  #error No secure implementation available
  #endif

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D9966

To: chinmoyr, #frameworks, thiago, fvogt
Cc: ngraham, fvogt, lbeltrame, dfaure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180125/c63e90ba/attachment.html>


More information about the Kde-frameworks-devel mailing list