Message116226
> With all the effort that went into the patch, I recommend to get it right: if there is space for the \0, include it. If the string size is exactly 108, and it's linux, write it unterminated. Else fail.
>
> As for testing: we should then definitely have a test that, if you can create an 108 byte unix socket that its socket name is what we said it should be.
The attached patches do those things, if I understand you
correctly (the test patches add such a test for Linux, and
linux-pass-unterminated uses memset() to zero out the area
between the end of the actual path and the end of the sun_path
array).
If you're talking about including the null in the address passed
to the system call, that does no harm on Linux, but I think the
more common practice is not to include it. The FreeBSD SUN_LEN
macro, for instance, is provided to calculate the address length
and does not include the null. |
|
Date |
User |
Action |
Args |
2010-09-12 19:48:25 | baikie | set | recipients:
+ baikie, loewis, pitrou, vstinner |
2010-09-12 19:48:24 | baikie | link | issue8372 messages |
2010-09-12 19:48:23 | baikie | create | |
|