Artyom Gavrichenkov <xima...@highloadlab.com> added the comment:

Hi Charles-François,

I've attached an update for the previous patch. Now there's no more overloading 
for the third argument and socket.getsockopt accepts one more optional argument 
-- a buffer to use as an input to kernel.

I can provide a manual sample script, with getsockopt being used this way, that 
depends on Linux ipset kernel module being installed and modprobe'd. However, 
automatic unit test is not that easy to implement. Generally ipset requires 
certain kernel modules to operate, and we either have to install ipset in order 
to run a unit test, or to implement some mock Linux kernel module purely for 
testing and support it against all possible kernel versions. Not to mention 
that such a test should be carried out by root user only.

By the way, I don't really think that any POSIX-compliant UNIX out there would 
treat the buffer given to getsockopt in any way different from what Linux does. 
It is very easy to copy the buffer from user to kernel and back, and it is so 
inconvenient to prevent kernel from reading it prior to modification, that I 
bet no one has ever bothered to do this.

----------
Added file: http://bugs.python.org/file23306/getsockopt_buffer_input_v2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13045>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to