<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luci/libs/nixio/src, branch 0.11.0</title>
<subtitle>Lua Configuration Interface (mirror)</subtitle>
<id>https://git.openwrt.org/project/luci/atom?h=0.11.0</id>
<link rel='self' href='https://git.openwrt.org/project/luci/atom?h=0.11.0'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/'/>
<updated>2012-10-29T12:52:27Z</updated>
<entry>
<title>Fix nixio exece()</title>
<updated>2012-10-29T12:52:27Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2012-10-29T12:52:27Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=06901331f5c8a0cfdb19520e1feed90fd4415b32'/>
<id>urn:sha1:06901331f5c8a0cfdb19520e1feed90fd4415b32</id>
<content type='text'>
I had occasion to use nixio.exece() recently and I could not figure out what it
wanted for the third argument (the environment) as no matter what sort of table
I passed, even nixio.getenv(), would fail with bad argument #3 to 'exece'
(invalid environment).

What it should expect is a table full of string values for keys and something
that can be converted to a string as a value, however it inverts the value of
lua_type() and compares it against a type, which will never evaluate to true.

Getting past this, the code inserts the KEY=VALUE string before the arg userdata,
and then forgets to take the env userdata into account when collecting the
arguments back into a C char**. This patch addresses all these issues and
provides a working nixio.exece().

[Fixes #500]
</content>
</entry>
<entry>
<title>libs/nixio: add missing parameter to alarm reset</title>
<updated>2012-08-27T14:54:37Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2012-08-27T14:54:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=1916ab494aa72e05e9c04363a2a67c17d2b93eb0'/>
<id>urn:sha1:1916ab494aa72e05e9c04363a2a67c17d2b93eb0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: cancel pending alarm after successfully returning from getnameinfo()</title>
<updated>2012-08-27T14:54:07Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2012-08-27T14:54:07Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=54567e57ea9e98e2384a82088e63062134b9b920'/>
<id>urn:sha1:54567e57ea9e98e2384a82088e63062134b9b920</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: implement optional timeout for getnameinfo() on Linux</title>
<updated>2012-08-27T14:36:47Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2012-08-27T14:36:47Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=c755e818c402e1f307a37cc90d0e8dfc3087b4c1'/>
<id>urn:sha1:c755e818c402e1f307a37cc90d0e8dfc3087b4c1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[PATCH] Abstract address UNIX sockets not binding properly (by capnbry@gmail.com, #366)</title>
<updated>2011-12-16T02:10:37Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-12-16T02:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=ca7bc48ebc0b1f655088eaae89bd358556dc8824'/>
<id>urn:sha1:ca7bc48ebc0b1f655088eaae89bd358556dc8824</id>
<content type='text'>
In #274, I stated abstract namespace and autobound abstract namespace datagram UNIX domain sockets work perfectly with nixio. However, I may have jumped the gun on that conclusion. Turns out they work perfectly for only one 
concurrent connection.

The problem is that when binding to an abstract address socket, which begins with a NULL byte, nixio strncpy's the name into the sockaddr_un structure, which effectively copies nothing. It then binds to an address of 180 NULLs, 
which is completely legal, but obviously you run into problems when a second client tries to bind to the same address.

The rules are as follows ( http://linux.die.net/man/7/unix) for the names:

  * If the name is blank, bind() should pass that the addrlen of sizeof(sa_family_t) and Linux will autobind a name that begins with null and is followed by 5 digits.
  * If the first character of the name is non-null, the name is a pathname and is null-terminated. addrlen should be sizeof(sockaddr_un), but the length can also be the pathname len + sizeof(sa_family_t) as the value will be 
null-terminated by the kernel unix socket driver
  * If the first character is null, the address is abstract and the value should not be null-terminated and addrlen is pathname + sizeof(sa_family_t) 

The attached patch fixes bind/connect/sendto by shortening the addrlen passed to be pathname len + sizeof(sa_family_t), which generates the correct socket names for all 3 cases above.
It also fixes the address returned by recvfrom, which currently returns a blank string for any abstract address socket (as they begin with a null).

</content>
</entry>
<entry>
<title>libs/nixio: add missing file in previous commit, revert unrelated change</title>
<updated>2011-08-12T10:27:48Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-08-12T10:27:48Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=69ba2e55a130a86ebd8988ab404a91e42a27dac9'/>
<id>urn:sha1:69ba2e55a130a86ebd8988ab404a91e42a27dac9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: implement getproto(), getprotobyname() and getprotobynumber()</title>
<updated>2011-08-12T10:26:33Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-08-12T10:26:33Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=2b33717dc402bdd8f1ab9e3f89ecc09d52b2df60'/>
<id>urn:sha1:2b33717dc402bdd8f1ab9e3f89ecc09d52b2df60</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: allow building without shadow password support</title>
<updated>2011-08-11T23:21:06Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-08-11T23:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=0d73b6d411026fbd9a949b493ff4cb1080547835'/>
<id>urn:sha1:0d73b6d411026fbd9a949b493ff4cb1080547835</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: fix possible issue with nonblocking bind()</title>
<updated>2011-08-11T23:15:05Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-08-11T23:15:05Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=11ff9204cf9b2fd451bf8e0e0dd3fe3f078c2808'/>
<id>urn:sha1:11ff9204cf9b2fd451bf8e0e0dd3fe3f078c2808</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: Fix recvfrom() return values for unnamed unix sockets, patch by capnbry@gmail.com (#274)</title>
<updated>2011-07-17T09:04:43Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-07-17T09:04:43Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=518dc0fef9961bf135b1780062b346cd66192c85'/>
<id>urn:sha1:518dc0fef9961bf135b1780062b346cd66192c85</id>
<content type='text'>
</content>
</entry>
</feed>
