Re: [PATCH 01/10] wayland-server: reduce use of magic numbers

2012-07-01 Thread Kristian Høgsberg
On Sun, Jul 01, 2012 at 05:51:19PM +, nobled wrote: > Make it clear what the significance of '5' and '113' actually is. > Also drop an unneeded function argument. > --- > Patch series available here: > https://github.com/nobled/wayland.git 'sockets' branch That is a good series. Very nice cat

Re: [PATCH] clipboard: initialise clipboard memory after creation

2012-07-01 Thread Kristian Høgsberg
On Sat, Jun 30, 2012 at 06:33:34PM +0200, Rafal Mielniczuk wrote: > In case we don't, weston segfault in clipboard_set_selection > on: > if (clipboard->source) > clipboard_source_unref(clipboard->source); Thanks, applied. I think this should fix https://bugs.freedesktop.org/show_

Re: [PATCH 06/10] wayland-server: reject socket paths longer than 108 bytes

2012-07-01 Thread Pekka Paalanen
Hi, a nice patch series in general. A minor comment below... On Sun, 1 Jul 2012 17:52:09 + nobled wrote: > Attempting to write anything longer into the embedded char > array would create a non-null-terminated string, and all > later reads would run off the end into invalid memory. > > This

[PATCH 01/10] wayland-server: reduce use of magic numbers

2012-07-01 Thread nobled
Make it clear what the significance of '5' and '113' actually is. Also drop an unneeded function argument. --- Patch series available here: https://github.com/nobled/wayland.git 'sockets' branch src/wayland-server.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) d

[PATCH 03/10] wayland-server: fix fd leak on error path

2012-07-01 Thread nobled
And restructure get_socket_lock() so it's clearer that it's allocating a new file descriptor. Uncovered by an upcoming test. --- src/wayland-server.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index 8

[PATCH 10/10] tests: test that path names longer than 108 bytes are rejected

2012-07-01 Thread nobled
These would either overflow the struct sockaddr_un, or be truncated and leave a non-null-terminated string. --- tests/Makefile.am |5 +++- tests/socket-test.c | 82 +++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 test

[PATCH 09/10] tests: fix make check for out-of-tree builds

2012-07-01 Thread nobled
It was failing with missing include files. While here, destroy the ugly "../src/..." include paths used in the tests that was just hacking around this problem in the Makefile: sed -i s/..\\/src\\/// tests/*.c --- tests/Makefile.am|3 ++- tests/array-test.c |2 +- tests/clie

[PATCH 08/10] tests: sort list of tests

2012-07-01 Thread nobled
--- tests/Makefile.am | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 9fdf040..7ca3f40 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,13 +1,13 @@ TESTS =

[PATCH 07/10] wayland-client: reject socket paths longer than 108 bytes

2012-07-01 Thread nobled
Attempting to write anything longer into the embedded char array would create a non-null-terminated string, and all later reads would run off the end into invalid memory. This is a hard limitation of AF_LOCAL/AF_UNIX sockets. --- src/wayland-client.c | 14 +- 1 file changed, 13 inse

[PATCH 06/10] wayland-server: reject socket paths longer than 108 bytes

2012-07-01 Thread nobled
Attempting to write anything longer into the embedded char array would create a non-null-terminated string, and all later reads would run off the end into invalid memory. This is a hard limitation of AF_LOCAL/AF_UNIX sockets. --- src/wayland-server.c | 16 +++- 1 file changed, 15 in

[PATCH 05/10] wayland-server: add more logging of errors

2012-07-01 Thread nobled
--- src/wayland-server.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 72aa88d..8b24a71 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -1196,6 +1196,7 @@ wl_display_add_socket(struct wl_display *display, const char *name

[PATCH 04/10] wayland-server: fix socket ownership race condition

2012-07-01 Thread nobled
Always unlink() the lock file before closing the file descriptor for it. Otherwise, there is a race like this: Process A closes fd, releasing the lock Process B opens the same file, taking the lock Process A unlinks the lock file Process C opens the same file, which now no longer exists, and takes

[PATCH 02/10] drop use of strerror()

2012-07-01 Thread nobled
It isn't thread-safe. Use the %m conversion specifier instead, like the rest of the code already does. --- src/scanner.c|2 +- src/wayland-server.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scanner.c b/src/scanner.c index 83611ec..be8d3d6 100644 ---